|
@@ -190,6 +190,19 @@ class Statistics:
|
|
|
capture_duration = float(self.get_capture_duration())
|
|
|
return int(float(packets_sent) / capture_duration)
|
|
|
|
|
|
+ def get_pps_received(self, ip_address: str):
|
|
|
+ """
|
|
|
+ Calculate the packets per second received for a given IP address.
|
|
|
+
|
|
|
+ :param ip_address: The IP address used for the calculation
|
|
|
+ :return: The number of packets per second received
|
|
|
+ """
|
|
|
+ packets_received = self.stats_db.process_db_query("SELECT pktsReceived FROM ip_statistics WHERE ipAddress=?",
|
|
|
+ False,
|
|
|
+ (ip_address,))
|
|
|
+ capture_duration = float(self.get_capture_duration())
|
|
|
+ return int(float(packets_received) / capture_duration)
|
|
|
+
|
|
|
def get_packet_count(self):
|
|
|
"""
|
|
|
:return: The number of packets in the loaded PCAP file
|