stats

package
v0.37.2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 12 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")
	ErrUnexpectedEndOfGroupStats = fmt.Errorf("proto: unexpected end of group")
)

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 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 maximum number of samples loaded in a single execution window.
	PeakLoadedSamples int32 `protobuf:"varint,4,opt,name=peak_loaded_samples,json=peakLoadedSamples,proto3" json:"peak_loaded_samples,omitempty"`
	// The total number of samples loaded for the query
	TotalLoadedSamples   int64    `protobuf:"varint,5,opt,name=total_loaded_samples,json=totalLoadedSamples,proto3" json:"total_loaded_samples,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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) AddFetchedSeries

func (s *Stats) AddFetchedSeries(series uint64)

func (*Stats) AddTotalSamples added in v0.37.0

func (s *Stats) AddTotalSamples(totalSamples int64)

func (*Stats) AddWallTime

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

AddWallTime adds some time to the counter.

func (*Stats) Descriptor

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

func (*Stats) GetFetchedChunkBytes

func (m *Stats) GetFetchedChunkBytes() uint64

func (*Stats) GetFetchedSeriesCount

func (m *Stats) GetFetchedSeriesCount() uint64

func (*Stats) GetPeakLoadedSamples added in v0.37.0

func (m *Stats) GetPeakLoadedSamples() int32

func (*Stats) GetTotalLoadedSamples added in v0.37.0

func (m *Stats) GetTotalLoadedSamples() int64

func (*Stats) GetWallTime

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

func (*Stats) LoadFetchedChunkBytes

func (s *Stats) LoadFetchedChunkBytes() uint64

func (*Stats) LoadFetchedSeries

func (s *Stats) LoadFetchedSeries() uint64

func (*Stats) LoadPeakSamples added in v0.37.0

func (s *Stats) LoadPeakSamples() int32

func (*Stats) LoadTotalSamples added in v0.37.0

func (s *Stats) LoadTotalSamples() int64

func (*Stats) LoadWallTime

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

LoadWallTime returns current wall time.

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) Merge

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

Merge the provide Stats into this one.

func (*Stats) ProtoMessage

func (*Stats) ProtoMessage()

func (*Stats) Reset

func (m *Stats) Reset()

func (*Stats) SetPeakSamples added in v0.37.0

func (s *Stats) SetPeakSamples(peakSamples int32)

func (*Stats) Size

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

func (*Stats) String

func (m *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