mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 00:13:30 +01:00
app/vmselect/promql: re-use metrics.Histogram when calculating histogram function for each point on the graph
This should reduce the amounts memory allocations
This commit is contained in:
parent
0f184affa7
commit
f46fb6c740
@ -187,9 +187,10 @@ func aggrFuncGeomean(tss []*timeseries) []*timeseries {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func aggrFuncHistogram(tss []*timeseries) []*timeseries {
|
func aggrFuncHistogram(tss []*timeseries) []*timeseries {
|
||||||
|
var h metrics.Histogram
|
||||||
m := make(map[string]*timeseries)
|
m := make(map[string]*timeseries)
|
||||||
for i := range tss[0].Values {
|
for i := range tss[0].Values {
|
||||||
var h metrics.Histogram
|
h.Reset()
|
||||||
for _, ts := range tss {
|
for _, ts := range tss {
|
||||||
v := ts.Values[i]
|
v := ts.Values[i]
|
||||||
h.Update(v)
|
h.Update(v)
|
||||||
|
Loading…
Reference in New Issue
Block a user