44import pandas as pd
55import matplotlib .pyplot as plt
66import numpy as np
7+ import os
78
89np .seterr (invalid = "ignore" )
910
@@ -29,6 +30,7 @@ def aggregate_fuzzer_data(fuzzers):
2930 if fuzzer .startswith (tool ):
3031 tool = fuzzer
3132 violations = res ["violations" ]
33+
3234 # We aggregate the bug discovery time.
3335 for bug_id , bug_discovery_time in violations .items ():
3436 if not (tool in discovery_time ):
@@ -39,6 +41,7 @@ def aggregate_fuzzer_data(fuzzers):
3941 per_tool_disc_time [glob_bug_id ] = []
4042 per_bug_disc_time = per_tool_disc_time [glob_bug_id ]
4143 per_bug_disc_time .append (bug_discovery_time )
44+
4245 # We aggregate the number of total bugs.
4346 num_bugs = len (violations )
4447 if not (tool in total_bugs ):
@@ -48,6 +51,7 @@ def aggregate_fuzzer_data(fuzzers):
4851 if not (seed in bugs_per_tool ):
4952 bugs_per_tool [seed ] = 0
5053 bugs_per_tool [seed ] += num_bugs
54+
5155 # We aggregate the campaign duration.
5256 duration = res ["duration" ]
5357 if not (tool in total_duration ):
@@ -114,7 +118,7 @@ def create_bar_chart(total_bugs, time_limit):
114118 plt .savefig (f"{ file_name } .png" , dpi = 300 )
115119
116120
117- time_limit = 28800
121+ time_limit = int ( os . environ . get ( "TIME_LIMIT" , 28800 ))
118122create_bar_chart (total_bugs , time_limit )
119123
120124
0 commit comments