Skip to content

Commit

Permalink
fix: metric y-range render limit for data outliers
Browse files Browse the repository at this point in the history
  • Loading branch information
spacehamster87 committed Aug 18, 2023
1 parent cf91563 commit 129e6a6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions web/frontend/src/plots/MetricPlot.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,18 @@
? statisticsSeries.mean.length
: series.reduce((n, series) => Math.max(n, series.data.length), 0)
const maxX = longestSeries * timestep
const maxY = thresholds != null
? useStatsSeries
let maxY = null
if (thresholds !== null) {
maxY = useStatsSeries
? (statisticsSeries.max.reduce((max, x) => Math.max(max, x), thresholds.normal) || thresholds.normal)
: (series.reduce((max, series) => Math.max(max, series.statistics?.max), thresholds.normal) || thresholds.normal)
: null
if (maxY >= (10 * thresholds.normal)) { // Hard y-range render limit if outliers in series data
maxY = (10 * thresholds.normal)
}
}
const plotSeries = [{label: 'Runtime', value: (u, ts, sidx, didx) => didx == null ? null : formatTime(ts)}]
const plotData = [new Array(longestSeries)]
Expand Down

0 comments on commit 129e6a6

Please sign in to comment.