mirror of
				https://github.com/ClusterCockpit/cc-backend
				synced 2025-11-04 01:25:06 +01:00 
			
		
		
		
	fix: archived statisticsSeries with mean data now shown again
This commit is contained in:
		internal/metricDataDispatcher
pkg/schema
web/frontend/src
@@ -139,11 +139,13 @@ func LoadData(job *schema.Job,
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// FIXME: Review: Is this really necessary or correct.
 | 
							// FIXME: Review: Is this really necessary or correct.
 | 
				
			||||||
		// Note: Lines 142-170 formerly known as prepareJobData(jobData, scoeps)
 | 
							// Note: Lines 147-170 formerly known as prepareJobData(jobData, scopes)
 | 
				
			||||||
		// For /monitoring/job/<job> and some other places, flops_any and mem_bw need
 | 
							// For /monitoring/job/<job> and some other places, flops_any and mem_bw need
 | 
				
			||||||
		// to be available at the scope 'node'. If a job has a lot of nodes,
 | 
							// to be available at the scope 'node'. If a job has a lot of nodes,
 | 
				
			||||||
		// statisticsSeries should be available so that a min/median/max Graph can be
 | 
							// statisticsSeries should be available so that a min/median/max Graph can be
 | 
				
			||||||
		// used instead of a lot of single lines.
 | 
							// used instead of a lot of single lines.
 | 
				
			||||||
 | 
							// NOTE: New StatsSeries will always be calculated as 'min/median/max'
 | 
				
			||||||
 | 
							//       Existing (archived) StatsSeries can be 'min/mean/max'!
 | 
				
			||||||
		const maxSeriesSize int = 15
 | 
							const maxSeriesSize int = 15
 | 
				
			||||||
		for _, scopes := range jd {
 | 
							for _, scopes := range jd {
 | 
				
			||||||
			for _, jm := range scopes {
 | 
								for _, jm := range scopes {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -123,6 +123,7 @@ func (jd *JobData) Size() int {
 | 
				
			|||||||
		for _, metric := range scopes {
 | 
							for _, metric := range scopes {
 | 
				
			||||||
			if metric.StatisticsSeries != nil {
 | 
								if metric.StatisticsSeries != nil {
 | 
				
			||||||
				n += len(metric.StatisticsSeries.Max)
 | 
									n += len(metric.StatisticsSeries.Max)
 | 
				
			||||||
 | 
									n += len(metric.StatisticsSeries.Mean)
 | 
				
			||||||
				n += len(metric.StatisticsSeries.Median)
 | 
									n += len(metric.StatisticsSeries.Median)
 | 
				
			||||||
				n += len(metric.StatisticsSeries.Min)
 | 
									n += len(metric.StatisticsSeries.Min)
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -98,6 +98,7 @@
 | 
				
			|||||||
          timestep
 | 
					          timestep
 | 
				
			||||||
          statisticsSeries {
 | 
					          statisticsSeries {
 | 
				
			||||||
            min
 | 
					            min
 | 
				
			||||||
 | 
					            mean
 | 
				
			||||||
            median
 | 
					            median
 | 
				
			||||||
            max
 | 
					            max
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -53,6 +53,7 @@
 | 
				
			|||||||
          timestep
 | 
					          timestep
 | 
				
			||||||
          statisticsSeries {
 | 
					          statisticsSeries {
 | 
				
			||||||
            min
 | 
					            min
 | 
				
			||||||
 | 
					            mean
 | 
				
			||||||
            median
 | 
					            median
 | 
				
			||||||
            max
 | 
					            max
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -133,8 +133,8 @@
 | 
				
			|||||||
  export let zoomState = null;
 | 
					  export let zoomState = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (useStatsSeries == null) useStatsSeries = statisticsSeries != null;
 | 
					  if (useStatsSeries == null) useStatsSeries = statisticsSeries != null;
 | 
				
			||||||
 | 
					 | 
				
			||||||
  if (useStatsSeries == false && series == null) useStatsSeries = true;
 | 
					  if (useStatsSeries == false && series == null) useStatsSeries = true;
 | 
				
			||||||
 | 
					  const usesMeanStatsSeries = (useStatsSeries && statisticsSeries.mean.length != 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const dispatch = createEventDispatcher();
 | 
					  const dispatch = createEventDispatcher();
 | 
				
			||||||
  const subClusterTopology = getContext("getHardwareTopology")(cluster, subCluster);
 | 
					  const subClusterTopology = getContext("getHardwareTopology")(cluster, subCluster);
 | 
				
			||||||
@@ -278,7 +278,7 @@
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const longestSeries = useStatsSeries
 | 
					  const longestSeries = useStatsSeries
 | 
				
			||||||
    ? statisticsSeries.median.length
 | 
					    ? (usesMeanStatsSeries ? statisticsSeries.mean.length : statisticsSeries.median.length)
 | 
				
			||||||
    : series.reduce((n, series) => Math.max(n, series.data.length), 0);
 | 
					    : series.reduce((n, series) => Math.max(n, series.data.length), 0);
 | 
				
			||||||
  const maxX = longestSeries * timestep;
 | 
					  const maxX = longestSeries * timestep;
 | 
				
			||||||
  let maxY = null;
 | 
					  let maxY = null;
 | 
				
			||||||
@@ -327,7 +327,11 @@
 | 
				
			|||||||
  if (useStatsSeries) {
 | 
					  if (useStatsSeries) {
 | 
				
			||||||
    plotData.push(statisticsSeries.min);
 | 
					    plotData.push(statisticsSeries.min);
 | 
				
			||||||
    plotData.push(statisticsSeries.max);
 | 
					    plotData.push(statisticsSeries.max);
 | 
				
			||||||
    plotData.push(statisticsSeries.median);
 | 
					    if (usesMeanStatsSeries) {
 | 
				
			||||||
 | 
					      plotData.push(statisticsSeries.mean);
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      plotData.push(statisticsSeries.median);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* deprecated: sparse data handled by uplot */
 | 
					    /* deprecated: sparse data handled by uplot */
 | 
				
			||||||
    // if (forNode === true) {
 | 
					    // if (forNode === true) {
 | 
				
			||||||
@@ -426,7 +430,7 @@
 | 
				
			|||||||
          // Draw plot type label:
 | 
					          // Draw plot type label:
 | 
				
			||||||
          let textl = `${scope}${plotSeries.length > 2 ? "s" : ""}${
 | 
					          let textl = `${scope}${plotSeries.length > 2 ? "s" : ""}${
 | 
				
			||||||
            useStatsSeries
 | 
					            useStatsSeries
 | 
				
			||||||
              ? ": min/median/max"
 | 
					              ? (usesMeanStatsSeries ? ": min/mean/max" : ": min/median/max")
 | 
				
			||||||
              : metricConfig != null && scope != metricConfig.scope
 | 
					              : metricConfig != null && scope != metricConfig.scope
 | 
				
			||||||
                ? ` (${metricConfig.aggregation})`
 | 
					                ? ` (${metricConfig.aggregation})`
 | 
				
			||||||
                : ""
 | 
					                : ""
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -74,6 +74,7 @@
 | 
				
			|||||||
          timestep
 | 
					          timestep
 | 
				
			||||||
          statisticsSeries {
 | 
					          statisticsSeries {
 | 
				
			||||||
            min
 | 
					            min
 | 
				
			||||||
 | 
					            mean
 | 
				
			||||||
            median
 | 
					            median
 | 
				
			||||||
            max
 | 
					            max
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user