Skip to content

Commit 637a4fd

Browse files
committed
Add an environment variable.
1 parent 0ec69cf commit 637a4fd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

show-stats.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import pandas as pd
55
import matplotlib.pyplot as plt
66
import numpy as np
7+
import os
78

89
np.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))
118122
create_bar_chart(total_bugs, time_limit)
119123

120124

0 commit comments

Comments
 (0)