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

Commit

Permalink
Merge pull request #1921 from grafana/getdata-use-pointslicepool
Browse files Browse the repository at this point in the history
use pointslicepool for /getdata cluster-fan out requests
  • Loading branch information
robert-milan committed Oct 21, 2020
2 parents 2edab76 + ec83e22 commit 8f037dd
Show file tree
Hide file tree
Showing 8 changed files with 696 additions and 663 deletions.
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

0 comments on commit 8f037dd

Please sign in to comment.