| 277 | } |
| 278 | |
| 279 | func (a *MetricsAggregate) result(multiplier float64) SeriesSet { |
| 280 | if a.agg != nil { |
| 281 | ss := a.agg.Series() |
| 282 | |
| 283 | // These operations don't get scaled by the multiplier. |
| 284 | switch a.op { |
| 285 | case metricsAggregateMinOverTime, metricsAggregateMaxOverTime: |
| 286 | return ss |
| 287 | } |
| 288 | |
| 289 | if multiplier > 1.0 { |
| 290 | for _, s := range ss { |
| 291 | for i := range s.Values { |
| 292 | s.Values[i] *= multiplier |
| 293 | } |
| 294 | } |
| 295 | } |
| 296 | return ss |
| 297 | } |
| 298 | |
| 299 | // In the frontend-version the results come from |
| 300 | // the job-level aggregator |
| 301 | return a.seriesAgg.Results() |
| 302 | } |
| 303 | |
| 304 | func (a *MetricsAggregate) length() int { |
| 305 | if a.agg != nil { |