Skip to content

Commit

Permalink
fix axes values
Browse files Browse the repository at this point in the history
  • Loading branch information
insmac committed Nov 29, 2024
1 parent 4ee9314 commit d50ee55
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/web-console/src/scenes/Editor/Metrics/metric.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ const graphDataConfigs = {
latency.map((l) => new Date(l.time).getTime()),
latency.map((l) => parseFloat(l.avg_latency)),
],
yValue: (rawValue: number) => (+rawValue).toFixed(2) + " ms",
yValue: (rawValue: number) => {
if (rawValue >= 1000) {
const seconds = rawValue / 1000
return `${seconds.toFixed(2)} s`
}
return `${rawValue} ms`
},
},
[MetricType.ROWS_APPLIED]: {
getData: (rowsApplied: RowsApplied[]): uPlot.AlignedData => [
Expand All @@ -76,7 +82,7 @@ const graphDataConfigs = {
rowsApplied.map((l) => new Date(l.time).getTime()),
rowsApplied.map((l) => parseFloat(l.avgWalAmplification)),
],
yValue: (rawValue: number) => (+rawValue).toFixed(0) + " x",
yValue: (rawValue: number) => `${rawValue} x`,
},
}

Expand Down

0 comments on commit d50ee55

Please sign in to comment.