stats

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_querier_stats_stats_proto protoreflect.FileDescriptor

Functions

func IsEnabled

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 Stats

type Stats struct {

	// The sum of all wall time spent in the querier to execute the query.
	WallTime int64 `protobuf:"varint,1,opt,name=wall_time,json=wallTime,proto3" json:"wall_time,omitempty"`
	// 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 chunks fetched for the query
	FetchedChunksCount uint64 `protobuf:"varint,4,opt,name=fetched_chunks_count,json=fetchedChunksCount,proto3" json:"fetched_chunks_count,omitempty"`
	// The number of sharded queries executed. 0 if sharding is disabled or the query can't be sharded.
	ShardedQueries uint32 `protobuf:"varint,5,opt,name=sharded_queries,json=shardedQueries,proto3" json:"sharded_queries,omitempty"`
	// The number of split partial queries executed. 0 if splitting is disabled or the query can't be split.
	SplitQueries uint32 `protobuf:"varint,6,opt,name=split_queries,json=splitQueries,proto3" json:"split_queries,omitempty"`
	// The number of index bytes fetched on the store-gateway for the query
	FetchedIndexBytes uint64 `protobuf:"varint,7,opt,name=fetched_index_bytes,json=fetchedIndexBytes,proto3" json:"fetched_index_bytes,omitempty"`
	// contains filtered or unexported fields
}

func ContextWithEmptyStats

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

ContextWithEmptyStats returns a context with empty stats.

func FromContext

func FromContext(ctx context.Context) *Stats

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

func (*Stats) AddFetchedChunkBytes

func (s *Stats) AddFetchedChunkBytes(bytes uint64)

func (*Stats) AddFetchedChunks

func (s *Stats) AddFetchedChunks(chunks uint64)

func (*Stats) AddFetchedIndexBytes

func (s *Stats) AddFetchedIndexBytes(indexBytes uint64)

func (*Stats) AddFetchedSeries

func (s *Stats) AddFetchedSeries(series uint64)

func (*Stats) AddShardedQueries

func (s *Stats) AddShardedQueries(num uint32)

func (*Stats) AddSplitQueries

func (s *Stats) AddSplitQueries(num uint32)

func (*Stats) AddWallTime

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

AddWallTime adds some time to the counter.

func (*Stats) Descriptor deprecated

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

Deprecated: Use Stats.ProtoReflect.Descriptor instead.

func (*Stats) GetFetchedChunkBytes

func (x *Stats) GetFetchedChunkBytes() uint64

func (*Stats) GetFetchedChunksCount

func (x *Stats) GetFetchedChunksCount() uint64

func (*Stats) GetFetchedIndexBytes

func (x *Stats) GetFetchedIndexBytes() uint64

func (*Stats) GetFetchedSeriesCount

func (x *Stats) GetFetchedSeriesCount() uint64

func (*Stats) GetShardedQueries

func (x *Stats) GetShardedQueries() uint32

func (*Stats) GetSplitQueries

func (x *Stats) GetSplitQueries() uint32

func (*Stats) GetWallTime

func (x *Stats) GetWallTime() int64

func (*Stats) LoadFetchedChunkBytes

func (s *Stats) LoadFetchedChunkBytes() uint64

func (*Stats) LoadFetchedChunks

func (s *Stats) LoadFetchedChunks() uint64

func (*Stats) LoadFetchedIndexBytes

func (s *Stats) LoadFetchedIndexBytes() uint64

func (*Stats) LoadFetchedSeries

func (s *Stats) LoadFetchedSeries() uint64

func (*Stats) LoadShardedQueries

func (s *Stats) LoadShardedQueries() uint32

func (*Stats) LoadSplitQueries

func (s *Stats) LoadSplitQueries() uint32

func (*Stats) LoadWallTime

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

LoadWallTime returns current wall time.

func (*Stats) MarshalToSizedBufferVT

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

func (*Stats) MarshalToVT

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

func (*Stats) MarshalVT

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

func (*Stats) Merge

func (s *Stats) Merge(other *Stats)

Merge the provided Stats into this one.

func (*Stats) ProtoMessage

func (*Stats) ProtoMessage()

func (*Stats) ProtoReflect

func (x *Stats) ProtoReflect() protoreflect.Message

func (*Stats) Reset

func (x *Stats) Reset()

func (*Stats) SizeVT

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

func (*Stats) String

func (x *Stats) String() string

func (*Stats) UnmarshalVT

func (m *Stats) UnmarshalVT(dAtA []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