Skip to content

Commit

Permalink
+/- 5 standard deviations lines
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaclarke committed Jul 26, 2021
1 parent dd6528c commit 77ef3d3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions conbench/app/_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ def time_series_plot(history, distribution, benchmark_id, height=250, width=1000
commits_mean = [w["message"] for w in with_dist]
dates_mean = [dateutil.parser.isoparse(w["timestamp"]) for w in with_dist]

alert_min, alert_max, commits_alert, dates_alert = [], [], [], []
for w in with_dist:
alert = 5 * float(w["mean_sd"])
alert_min.append(float(w["mean_mean"]) - alert)
alert_max.append(float(w["mean_mean"]) + alert)
commits_alert.append(w["message"])
dates_alert.append(dateutil.parser.isoparse(w["timestamp"]))

source_data = dict(x=dates, y=times, commit=commits)
source = bokeh.models.ColumnDataSource(data=source_data)

Expand All @@ -134,6 +142,12 @@ def time_series_plot(history, distribution, benchmark_id, height=250, width=1000
source_data_mean = dict(x=dates_mean, y=times_mean, commit=commits_mean)
source_mean = bokeh.models.ColumnDataSource(data=source_data_mean)

source_data_alert_min = dict(x=dates_alert, y=alert_min, commit=commits_alert)
source_alert_min = bokeh.models.ColumnDataSource(data=source_data_alert_min)

source_data_alert_max = dict(x=dates_alert, y=alert_max, commit=commits_alert)
source_alert_max = bokeh.models.ColumnDataSource(data=source_data_alert_max)

tooltips = [
("date", "$x{%F}"),
("mean", "$y{0.000}"),
Expand All @@ -158,6 +172,8 @@ def time_series_plot(history, distribution, benchmark_id, height=250, width=1000

p.line(source=source, legend_label="History")
p.line(source=source_mean, color="#ffa600", legend_label="Mean")
p.line(source=source_alert_min, color="Silver", legend_label="+/- 5 σ")
p.line(source=source_alert_max, color="Silver")
p.circle(source=source_x, size=8, color="#ff6361", legend_label="Benchmark")

p.legend.location = "bottom_left"
Expand Down

0 comments on commit 77ef3d3

Please sign in to comment.