stats

package
v1.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowStats   = fmt.Errorf("proto: integer overflow")
)

Functions

func IsEnabled added in v1.7.0

func IsEnabled(ctx context.Context) bool

IsEnabled returns whether stats tracking is enabled in the context.

func ShouldTrackHTTPGRPCResponse

func ShouldTrackHTTPGRPCResponse(r *httpgrpc.HTTPResponse) bool

Types

type QueryStats added in v1.15.0

type QueryStats struct {
	Stats
	// contains filtered or unexported fields
}

func ContextWithEmptyStats

func ContextWithEmptyStats(ctx context.Context) (*QueryStats, context.Context)

ContextWithEmptyStats returns a context with empty stats.

func FromContext

func FromContext(ctx context.Context) *QueryStats

FromContext gets the Stats out of the Context. Returns nil if stats have not been initialised in the context.

func (*QueryStats) AddExtraFields added in v1.15.0

func (s *QueryStats) AddExtraFields(fieldsVals ...interface{})

func (*QueryStats) AddFetchedChunkBytes added in v1.15.0

func (s *QueryStats) AddFetchedChunkBytes(bytes uint64)

func (*QueryStats) AddFetchedChunks added in v1.15.0

func (s *QueryStats) AddFetchedChunks(count uint64)

func (*QueryStats) AddFetchedDataBytes added in v1.15.0

func (s *QueryStats) AddFetchedDataBytes(bytes uint64)

func (*QueryStats) AddFetchedSamples added in v1.15.0

func (s *QueryStats) AddFetchedSamples(count uint64)

func (*QueryStats) AddFetchedSeries added in v1.15.0

func (s *QueryStats) AddFetchedSeries(series uint64)

func (*QueryStats) AddWallTime added in v1.15.0

func (s *QueryStats) AddWallTime(t time.Duration)

AddWallTime adds some time to the counter.

func (*QueryStats) LoadExtraFields added in v1.15.0

func (s *QueryStats) LoadExtraFields() []interface{}

func (*QueryStats) LoadFetchedChunkBytes added in v1.15.0

func (s *QueryStats) LoadFetchedChunkBytes() uint64

func (*QueryStats) LoadFetchedChunks added in v1.15.0

func (s *QueryStats) LoadFetchedChunks() uint64

func (*QueryStats) LoadFetchedDataBytes added in v1.15.0

func (s *QueryStats) LoadFetchedDataBytes() uint64

func (*QueryStats) LoadFetchedSamples added in v1.15.0

func (s *QueryStats) LoadFetchedSamples() uint64

func (*QueryStats) LoadFetchedSeries added in v1.15.0

func (s *QueryStats) LoadFetchedSeries() uint64

func (*QueryStats) LoadWallTime added in v1.15.0

func (s *QueryStats) LoadWallTime() time.Duration

LoadWallTime returns current wall time.

func (*QueryStats) Merge added in v1.15.0

func (s *QueryStats) Merge(other *QueryStats)

Merge the provided Stats into this one.

type Stats

type Stats struct {
	// The sum of all wall time spent in the querier to execute the query.
	WallTime time.Duration `protobuf:"bytes,1,opt,name=wall_time,json=wallTime,proto3,stdduration" json:"wall_time"`
	// The number of series fetched for the query
	FetchedSeriesCount uint64 `protobuf:"varint,2,opt,name=fetched_series_count,json=fetchedSeriesCount,proto3" json:"fetched_series_count,omitempty"`
	// The number of bytes of the chunks fetched for the query
	FetchedChunkBytes uint64 `protobuf:"varint,3,opt,name=fetched_chunk_bytes,json=fetchedChunkBytes,proto3" json:"fetched_chunk_bytes,omitempty"`
	// The number of bytes of data fetched for the query
	FetchedDataBytes uint64 `protobuf:"varint,4,opt,name=fetched_data_bytes,json=fetchedDataBytes,proto3" json:"fetched_data_bytes,omitempty"`
	// Extra fields to be reported on the stats log
	ExtraFields map[string]string `` /* 182-byte string literal not displayed */
	// The number of chunks fetched for the query
	FetchedChunksCount uint64 `protobuf:"varint,6,opt,name=fetched_chunks_count,json=fetchedChunksCount,proto3" json:"fetched_chunks_count,omitempty"`
	// The number of samples fetched for the query
	FetchedSamplesCount uint64 `protobuf:"varint,7,opt,name=fetched_samples_count,json=fetchedSamplesCount,proto3" json:"fetched_samples_count,omitempty"`
	// The limit hit when executing the query
	LimitHit string `protobuf:"bytes,8,opt,name=limit_hit,json=limitHit,proto3" json:"limit_hit,omitempty"`
}

func (*Stats) Descriptor

func (*Stats) Descriptor() ([]byte, []int)

func (*Stats) Equal

func (this *Stats) Equal(that interface{}) bool

func (*Stats) GetExtraFields added in v1.15.0

func (m *Stats) GetExtraFields() map[string]string

func (*Stats) GetFetchedChunkBytes added in v1.11.0

func (m *Stats) GetFetchedChunkBytes() uint64

func (*Stats) GetFetchedChunksCount added in v1.15.0

func (m *Stats) GetFetchedChunksCount() uint64

func (*Stats) GetFetchedDataBytes added in v1.14.0

func (m *Stats) GetFetchedDataBytes() uint64

func (*Stats) GetFetchedSamplesCount added in v1.15.0

func (m *Stats) GetFetchedSamplesCount() uint64

func (*Stats) GetFetchedSeriesCount added in v1.11.0

func (m *Stats) GetFetchedSeriesCount() uint64

func (*Stats) GetLimitHit added in v1.16.0

func (m *Stats) GetLimitHit() string

func (*Stats) GetWallTime

func (m *Stats) GetWallTime() time.Duration

func (*Stats) GoString

func (this *Stats) GoString() string

func (*Stats) Marshal

func (m *Stats) Marshal() (dAtA []byte, err error)

func (*Stats) MarshalTo

func (m *Stats) MarshalTo(dAtA []byte) (int, error)

func (*Stats) MarshalToSizedBuffer

func (m *Stats) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Stats) ProtoMessage

func (*Stats) ProtoMessage()

func (*Stats) Reset

func (m *Stats) Reset()

func (*Stats) Size

func (m *Stats) Size() (n int)

func (*Stats) String

func (this *Stats) String() string

func (*Stats) Unmarshal

func (m *Stats) Unmarshal(dAtA []byte) error

func (*Stats) XXX_DiscardUnknown

func (m *Stats) XXX_DiscardUnknown()

func (*Stats) XXX_Marshal

func (m *Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Stats) XXX_Merge

func (m *Stats) XXX_Merge(src proto.Message)

func (*Stats) XXX_Size

func (m *Stats) XXX_Size() int

func (*Stats) XXX_Unmarshal

func (m *Stats) XXX_Unmarshal(b []byte) error

type WallTimeMiddleware

type WallTimeMiddleware struct{}

WallTimeMiddleware tracks the wall time.

func NewWallTimeMiddleware

func NewWallTimeMiddleware() WallTimeMiddleware

NewWallTimeMiddleware makes a new WallTimeMiddleware.

func (WallTimeMiddleware) Wrap

Wrap implements middleware.Interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL