-
Notifications
You must be signed in to change notification settings - Fork 13
Description
I started an instance and went to metrics. Because my instance had just started and the time range for metrics ended at now
, all my graphs had one data point. Unfortunately, we always drop the first data point because it is the cumulative value up until now, and then the chart component treats an empty list of points as a loading state.
I think in this case we probably want to keep the former but change the latter. I'm not sure we can usefully display the cumulative value, though maybe we can get cute and do what we kinda used to do, start with that value and sort of synthetically fill out the data with a bunch of identical values using it. (We would have to make sure we don't project that value into the future.)
console/app/components/oxql-metrics/util.ts
Lines 140 to 145 in 1fe4a7e
const chartData = timestamps | |
.map((timestamp, idx) => ({ timestamp, value: summedValues[idx] })) | |
// Drop the first datapoint, which — for delta metric types — is the cumulative sum of all previous | |
// datapoints (like CPU utilization). We've accounted for this by adjusting the start time earlier; | |
// We could use a more elegant approach to this down the road | |
.slice(1) |
console/app/components/TimeSeriesChart.tsx
Lines 223 to 229 in 1fe4a7e
if (!data || data.length === 0) { | |
return ( | |
<SkeletonMetric shimmer className={wrapperClass}> | |
<MetricsLoadingIndicator /> | |
</SkeletonMetric> | |
) | |
} |