Skip to content

Commit

Permalink
Fix vertical drop in throughput charts
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiri Holusa committed May 20, 2021
1 parent 1d3dce6 commit 728d9db
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions dist/src/main/dist/conf/benchmark-report.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,6 @@ def load_workers(self):
agents[agent] = worker

def lookup_period(self):
#print("---------------------------------------")

for worker_name in os.listdir(self.src_dir):
if not worker_name.startswith("A"):
continue
Expand All @@ -940,19 +938,23 @@ def lookup_period(self):
v = float(row[0])
end_time = str(v - cooldown_seconds)

#print("agent:"+agent_name)
#print(str(start_time))
#print(str(end_time))
self.period = Period(start_time, end_time)

#print("---------------------------------------")
if self.period is None:
# first iteration where the period is not set yet
self.period = Period(start_time, end_time)
else:
# We need to pick the earliest time from all series for the start.
# and the latest for the end.
# That way the series don't get trimmed because of milliseconds (minimal worker reporting
# interval is 1 second, see WORKER_PERFORMANCE_MONITOR_INTERVAL_SECONDS property) causing
# misalignment of the series by one data point in the chart resulting in ugly vertical drop
# at the end of the throughput charts
self.period = Period(min(self.period.start_time, start_time), max(self.period.end_time, end_time))

def init_files(self):
cmd = simulator_home + "/conf/init_report_files.sh " + self.src_dir+ " " + report_dir + " " + str(self.id) + " "+ str(self.period.start_millis()) + " " + str(self.period.end_millis())
print(cmd)
out = subprocess.check_output(cmd.split())
#print(out)


# todo: better name
def x(self, handle):
return handle.load().items
Expand Down

0 comments on commit 728d9db

Please sign in to comment.