Skip to content

Commit

Permalink
Add an environment variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
wuestholz committed Apr 29, 2024
1 parent 826686c commit c3125ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion show-stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import os

np.seterr(invalid="ignore")

Expand All @@ -29,6 +30,7 @@ def aggregate_fuzzer_data(fuzzers):
if fuzzer.startswith(tool):
tool = fuzzer
violations = res["violations"]

# We aggregate the bug discovery time.
for bug_id, bug_discovery_time in violations.items():
if not (tool in discovery_time):
Expand All @@ -39,6 +41,7 @@ def aggregate_fuzzer_data(fuzzers):
per_tool_disc_time[glob_bug_id] = []
per_bug_disc_time = per_tool_disc_time[glob_bug_id]
per_bug_disc_time.append(bug_discovery_time)

# We aggregate the number of total bugs.
num_bugs = len(violations)
if not (tool in total_bugs):
Expand All @@ -48,6 +51,7 @@ def aggregate_fuzzer_data(fuzzers):
if not (seed in bugs_per_tool):
bugs_per_tool[seed] = 0
bugs_per_tool[seed] += num_bugs

# We aggregate the campaign duration.
duration = res["duration"]
if not (tool in total_duration):
Expand Down Expand Up @@ -114,7 +118,7 @@ def create_bar_chart(total_bugs, time_limit):
plt.savefig(f"{file_name}.png", dpi=300)


time_limit = 28800
time_limit = int(os.environ.get("TIME_LIMIT", 28800))
create_bar_chart(total_bugs, time_limit)


Expand Down

0 comments on commit c3125ed

Please sign in to comment.