|
@@ -360,6 +360,24 @@ void statistics_db::writeStatisticsConv(std::unordered_map<conv, entry_convStat>
|
|
|
std::chrono::microseconds conn_duration = end_timesttamp - start_timesttamp;
|
|
|
e.avg_pkt_rate = (float) e.pkts_count * 1000000 / conn_duration.count(); // pkt per sec
|
|
|
|
|
|
+ query.bind(1, f.ipAddressA);
|
|
|
+ query.bind(2, f.portA);
|
|
|
+ query.bind(3, f.ipAddressB);
|
|
|
+ query.bind(4, f.portB);
|
|
|
+ query.bind(5, (int) e.pkts_count);
|
|
|
+ query.bind(6, (float) e.avg_pkt_rate);
|
|
|
+ query.bind(7, (int) e.avg_interarrival_time.count());
|
|
|
+ query.bind(8, minDelay);
|
|
|
+ query.bind(9, maxDelay);
|
|
|
+ query.exec();
|
|
|
+ query.reset();
|
|
|
+ }
|
|
|
+ else if (e.pkts_count == 1){
|
|
|
+ int minDelay = -1;
|
|
|
+ int maxDelay = -1;
|
|
|
+ e.avg_pkt_rate = (float) -1;
|
|
|
+ e.avg_interarrival_time = e.avg_interarrival_time = (std::chrono::microseconds) 0;
|
|
|
+
|
|
|
query.bind(1, f.ipAddressA);
|
|
|
query.bind(2, f.portA);
|
|
|
query.bind(3, f.ipAddressB);
|