add more information to the total report
@@ -88,7 +88,7 @@ class OneLayerEval:
if not label_assignments:
self.logger.warn('Could not read label assignments; continuing anyway.')
- pcap_results = {'succeeded':0, 'failed':0, 'abnormal':0}
+ pcap_results = {}
for pcap in pcaps:
self.logger.info('Processing {0}...'.format(pcap))
source_mac = None
@@ -209,12 +209,15 @@ class OneLayerEval:
self.logger.info('Message: ' + message)
if key is None:
key = source_mac
+ if not label in pcap_results:
+ pcap_results[label] ={'succeeded':0, 'failed':0, 'abnormal':0}
+
if label == decision[key]['classification']['labels'][0]:
- pcap_results['succeeded'] += 1
+ pcap_results[label]['succeeded'] += 1
else:
- pcap_results['failed'] += 1
+ pcap_results[label]['failed'] += 1
if decision[key]['decisions']['behavior'] == 'abnormal':
- pcap_results['abnormal'] += 1
+ pcap_results[label]['abnormal'] += 1
if self.use_rabbit:
self.common.channel.basic_publish(exchange=self.common.exchange,
routing_key=self.common.routing_key,
