Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

use pointslicepool for /getdata cluster-fan out requests #1921

Merged
merged 3 commits into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/init.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package api

import (
"github.com/grafana/metrictank/api/models"
"github.com/grafana/metrictank/expr"
"github.com/grafana/metrictank/pointslicepool"
)
Expand All @@ -10,4 +11,5 @@ var pointSlicePool *pointslicepool.PointSlicePool
func init() {
pointSlicePool = pointslicepool.New(pointslicepool.DefaultPointSliceSize)
expr.Pool(pointSlicePool)
models.Pool(pointSlicePool)
}
7 changes: 7 additions & 0 deletions api/models/init_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package models

import "github.com/grafana/metrictank/pointslicepool"

func init() {
pointSlicePool = pointslicepool.New(100)
}
12 changes: 12 additions & 0 deletions api/models/pointslicepool.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package models

import (
"github.com/grafana/metrictank/pointslicepool"
)

var pointSlicePool *pointslicepool.PointSlicePool

// Pool tells the models package library which pool to use for temporary []schema.Point
func Pool(p *pointslicepool.PointSlicePool) {
pointSlicePool = p
}
2 changes: 1 addition & 1 deletion api/models/series.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

//go:generate msgp
//msgp:ignore SeriesMetaPropertiesExport
//msgp:ignore SeriesMetaPropertiesExport Series

type Series struct {
Target string // for fetched data, set from models.Req.Target, i.e. the metric graphite key. for function output, whatever should be shown as target string (legend)
Expand Down