streamline and unify statsSeries calc and render

This commit is contained in:
Christoph Kluge
2026-03-19 13:30:38 +01:00
parent c42898bd99
commit 16ec1e69d9
6 changed files with 8 additions and 16 deletions

View File

@@ -229,7 +229,7 @@
timestep={metric.data.metric.timestep}
scope={metric.data.scope}
series={metric.data.metric.series}
statisticsSeries={metric.data.metric.statisticsSeries}
statisticsSeries={metric.data.metric?.statisticsSeries}
metric={metric.data.name}
cluster={clusterInfos.find((c) => c.name == job.cluster)}
subCluster={job.subCluster}

View File

@@ -236,7 +236,7 @@
// conditional hide series color markers:
if (
// useStatsSeries || // Min/Max/Median Self-Explanatory
// Min/Max/Median Self-Explanatory
dataSize === 1 || // Only one Y-Dataseries
dataSize > 8 // More than 8 Y-Dataseries
) {
@@ -273,7 +273,7 @@
}
}
if (dataSize <= 12 ) { // || useStatsSeries) {
if (dataSize <= 12 ) {
return {
hooks: {
init: init,

View File

@@ -9,7 +9,6 @@
- `height Number?`: The plot height [Default: 300]
- `timestep Number`: The timestep used for X-axis rendering
- `series [GraphQL.Series]`: The metric data object
- `useStatsSeries Bool?`: If this plot uses the statistics Min/Max/Median representation; automatically set to according bool [Default: false]
- `statisticsSeries [GraphQL.StatisticsSeries]?`: Min/Max/Median representation of metric data [Default: null]
- `cluster String?`: Cluster name of the parent job / data [Default: ""]
- `subCluster String`: Name of the subCluster of the parent job
@@ -37,7 +36,6 @@
height = 300,
timestep,
series,
useStatsSeries = false,
statisticsSeries = null,
cluster = "",
subCluster,
@@ -78,6 +76,7 @@
const resampleTrigger = $derived(resampleConfig?.trigger ? Number(resampleConfig.trigger) : null);
const resampleResolutions = $derived(resampleConfig?.resolutions ? [...resampleConfig.resolutions] : null);
const resampleMinimum = $derived(resampleConfig?.resolutions ? Math.min(...resampleConfig.resolutions) : null);
const useStatsSeries = $derived(!!statisticsSeries); // Display Stats Series By Default if Exists
const thresholds = $derived(findJobAggregationThresholds(
subClusterTopology,
metricConfig,
@@ -243,11 +242,6 @@
return pendingSeries;
})
/* Effects */
$effect(() => {
if (!useStatsSeries && statisticsSeries != null) useStatsSeries = true;
})
// This updates plot on all size changes if wrapper (== data) exists
$effect(() => {
if (plotWrapper) {

View File

@@ -197,7 +197,6 @@
{zoomState}
{thresholdState}
statisticsSeries={statsSeries[selectedScopeIndex]}
useStatsSeries={!!statsSeries[selectedScopeIndex]}
enableFlip
/>
{/if}

View File

@@ -174,7 +174,7 @@
<p>No dataset(s) returned for <b>{selectedMetrics[i]}</b></p>
<p class="mb-1">Metric or host was not found in metric store for cluster <b>{cluster}</b>.</p>
</Card>
{:else if !!metricData.data?.metric.statisticsSeries}
{:else if !!metricData?.data?.metric?.statisticsSeries}
<!-- "No Data"-Warning included in MetricPlot-Component -->
<MetricPlot
{cluster}
@@ -183,8 +183,7 @@
scope={metricData.data.scope}
timestep={metricData.data.metric.timestep}
series={metricData.data.metric.series}
statisticsSeries={metricData.data?.metric.statisticsSeries}
useStatsSeries={!!metricData.data?.metric.statisticsSeries}
statisticsSeries={metricData.data.metric.statisticsSeries}
height={175}
{plotSync}
forNode