Documentation ¶
Index ¶
- Variables
- func IsEnabled(ctx context.Context) bool
- func ShouldTrackHTTPGRPCResponse(r *httpgrpc.HTTPResponse) bool
- type QueryStats
- func (s *QueryStats) AddExtraFields(fieldsVals ...interface{})
- func (s *QueryStats) AddFetchedChunkBytes(bytes uint64)
- func (s *QueryStats) AddFetchedChunks(count uint64)
- func (s *QueryStats) AddFetchedDataBytes(bytes uint64)
- func (s *QueryStats) AddFetchedSamples(count uint64)
- func (s *QueryStats) AddFetchedSeries(series uint64)
- func (s *QueryStats) AddWallTime(t time.Duration)
- func (s *QueryStats) LoadExtraFields() []interface{}
- func (s *QueryStats) LoadFetchedChunkBytes() uint64
- func (s *QueryStats) LoadFetchedChunks() uint64
- func (s *QueryStats) LoadFetchedDataBytes() uint64
- func (s *QueryStats) LoadFetchedSamples() uint64
- func (s *QueryStats) LoadFetchedSeries() uint64
- func (s *QueryStats) LoadWallTime() time.Duration
- func (s *QueryStats) Merge(other *QueryStats)
- type Stats
- func (*Stats) Descriptor() ([]byte, []int)
- func (this *Stats) Equal(that interface{}) bool
- func (m *Stats) GetExtraFields() map[string]string
- func (m *Stats) GetFetchedChunkBytes() uint64
- func (m *Stats) GetFetchedChunksCount() uint64
- func (m *Stats) GetFetchedDataBytes() uint64
- func (m *Stats) GetFetchedSamplesCount() uint64
- func (m *Stats) GetFetchedSeriesCount() uint64
- func (m *Stats) GetWallTime() time.Duration
- func (this *Stats) GoString() string
- func (m *Stats) Marshal() (dAtA []byte, err error)
- func (m *Stats) MarshalTo(dAtA []byte) (int, error)
- func (m *Stats) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Stats) ProtoMessage()
- func (m *Stats) Reset()
- func (m *Stats) Size() (n int)
- func (this *Stats) String() string
- func (m *Stats) Unmarshal(dAtA []byte) error
- func (m *Stats) XXX_DiscardUnknown()
- func (m *Stats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Stats) XXX_Merge(src proto.Message)
- func (m *Stats) XXX_Size() int
- func (m *Stats) XXX_Unmarshal(b []byte) error
- type WallTimeMiddleware
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
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"` }
func (*Stats) Descriptor ¶
func (*Stats) GetExtraFields ¶ added in v1.15.0
func (*Stats) GetFetchedChunkBytes ¶ added in v1.11.0
func (*Stats) GetFetchedChunksCount ¶ added in v1.15.0
func (*Stats) GetFetchedDataBytes ¶ added in v1.14.0
func (*Stats) GetFetchedSamplesCount ¶ added in v1.15.0
func (*Stats) GetFetchedSeriesCount ¶ added in v1.11.0
func (*Stats) GetWallTime ¶
func (*Stats) ProtoMessage ¶
func (*Stats) ProtoMessage()
func (*Stats) XXX_DiscardUnknown ¶
func (m *Stats) XXX_DiscardUnknown()
func (*Stats) XXX_Marshal ¶
func (*Stats) XXX_Unmarshal ¶
type WallTimeMiddleware ¶
type WallTimeMiddleware struct{}
WallTimeMiddleware tracks the wall time.
func NewWallTimeMiddleware ¶
func NewWallTimeMiddleware() WallTimeMiddleware
NewWallTimeMiddleware makes a new WallTimeMiddleware.
Click to show internal directories.
Click to hide internal directories.