stats

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: AGPL-3.0 Imports: 15 Imported by: 1

Documentation

Overview

Package stats provides primitives for recording metrics across the query path. Statistics are passed through the query context. To start a new query statistics context use:

statsCtx, ctx := stats.NewContext(ctx)

Then you can update statistics by mutating data by using:

statsCtx.Add...(1)

To get the statistic from the current context you can use:

statsCtx := stats.FromContext(ctx)

Finally to get a snapshot of the current query statistic use

statsCtx.Result(time.Since(start), queueTime, totalEntriesReturned)

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 ConvertSecondsToNanoseconds

func ConvertSecondsToNanoseconds(seconds float64) time.Duration

ConvertSecondsToNanoseconds converts time.Duration representation of seconds (float64) into time.Duration representation of nanoseconds (int64)

func JoinIndex

func JoinIndex(ctx context.Context, index Index)

JoinIndex joins the index statistics in a concurrency-safe manner.

func JoinIngesters

func JoinIngesters(ctx context.Context, inc Ingester)

JoinIngesters joins the ingester result statistics in a concurrency-safe manner.

func JoinResults

func JoinResults(ctx context.Context, res Result)

JoinResults merges a Result with the embedded Result in a context in a concurrency-safe manner.

Types

type Cache

type Cache struct {
	EntriesFound      int32 `protobuf:"varint,1,opt,name=entriesFound,proto3" json:"entriesFound"`
	EntriesRequested  int32 `protobuf:"varint,2,opt,name=entriesRequested,proto3" json:"entriesRequested"`
	EntriesStored     int32 `protobuf:"varint,3,opt,name=entriesStored,proto3" json:"entriesStored"`
	BytesReceived     int64 `protobuf:"varint,4,opt,name=bytesReceived,proto3" json:"bytesReceived"`
	BytesSent         int64 `protobuf:"varint,5,opt,name=bytesSent,proto3" json:"bytesSent"`
	Requests          int32 `protobuf:"varint,6,opt,name=requests,proto3" json:"requests"`
	DownloadTime      int64 `protobuf:"varint,7,opt,name=downloadTime,proto3" json:"downloadTime"`
	QueryLengthServed int64 `protobuf:"varint,8,opt,name=queryLengthServed,proto3" json:"queryLengthServed"`
}

func (*Cache) CacheDownloadTime

func (c *Cache) CacheDownloadTime() time.Duration

func (*Cache) CacheQueryLengthServed

func (c *Cache) CacheQueryLengthServed() time.Duration

func (*Cache) Descriptor

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

func (*Cache) Equal

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

func (*Cache) GetBytesReceived

func (m *Cache) GetBytesReceived() int64

func (*Cache) GetBytesSent

func (m *Cache) GetBytesSent() int64

func (*Cache) GetDownloadTime

func (m *Cache) GetDownloadTime() int64

func (*Cache) GetEntriesFound

func (m *Cache) GetEntriesFound() int32

func (*Cache) GetEntriesRequested

func (m *Cache) GetEntriesRequested() int32

func (*Cache) GetEntriesStored

func (m *Cache) GetEntriesStored() int32

func (*Cache) GetQueryLengthServed

func (m *Cache) GetQueryLengthServed() int64

func (*Cache) GetRequests

func (m *Cache) GetRequests() int32

func (*Cache) GoString

func (this *Cache) GoString() string

func (*Cache) Marshal

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

func (*Cache) MarshalTo

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

func (*Cache) MarshalToSizedBuffer

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

func (*Cache) Merge

func (c *Cache) Merge(m Cache)

func (*Cache) ProtoMessage

func (*Cache) ProtoMessage()

func (*Cache) Reset

func (m *Cache) Reset()

func (*Cache) Size

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

func (*Cache) String

func (this *Cache) String() string

func (*Cache) Unmarshal

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

func (*Cache) XXX_DiscardUnknown

func (m *Cache) XXX_DiscardUnknown()

func (*Cache) XXX_Marshal

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

func (*Cache) XXX_Merge

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

func (*Cache) XXX_Size

func (m *Cache) XXX_Size() int

func (*Cache) XXX_Unmarshal

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

type CacheType

type CacheType string
const (
	ChunkCache                CacheType = "chunk"                 //nolint:staticcheck
	IndexCache                CacheType = "index"                 //nolint:staticcheck
	ResultCache               CacheType = "result"                //nolint:staticcheck
	StatsResultCache          CacheType = "stats-result"          //nolint:staticcheck
	VolumeResultCache         CacheType = "volume-result"         //nolint:staticcheck
	InstantMetricResultsCache CacheType = "instant-metric-result" // nolint:staticcheck
	WriteDedupeCache          CacheType = "write-dedupe"          //nolint:staticcheck
	SeriesResultCache         CacheType = "series-result"         //nolint:staticcheck
	LabelResultCache          CacheType = "label-result"          //nolint:staticcheck
	BloomFilterCache          CacheType = "bloom-filter"          //nolint:staticcheck
	BloomBlocksCache          CacheType = "bloom-blocks"          //nolint:staticcheck
	BloomMetasCache           CacheType = "bloom-metas"           //nolint:staticcheck
)

type Caches

type Caches struct {
	Chunk               Cache `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk"`
	Index               Cache `protobuf:"bytes,2,opt,name=index,proto3" json:"index"`
	Result              Cache `protobuf:"bytes,3,opt,name=result,proto3" json:"result"`
	StatsResult         Cache `protobuf:"bytes,4,opt,name=statsResult,proto3" json:"statsResult"`
	VolumeResult        Cache `protobuf:"bytes,5,opt,name=volumeResult,proto3" json:"volumeResult"`
	SeriesResult        Cache `protobuf:"bytes,6,opt,name=seriesResult,proto3" json:"seriesResult"`
	LabelResult         Cache `protobuf:"bytes,7,opt,name=labelResult,proto3" json:"labelResult"`
	InstantMetricResult Cache `protobuf:"bytes,8,opt,name=instantMetricResult,proto3" json:"instantMetricResult"`
}

func (*Caches) Descriptor

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

func (*Caches) Equal

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

func (*Caches) GetChunk

func (m *Caches) GetChunk() Cache

func (*Caches) GetIndex

func (m *Caches) GetIndex() Cache

func (*Caches) GetInstantMetricResult

func (m *Caches) GetInstantMetricResult() Cache

func (*Caches) GetLabelResult

func (m *Caches) GetLabelResult() Cache

func (*Caches) GetResult

func (m *Caches) GetResult() Cache

func (*Caches) GetSeriesResult

func (m *Caches) GetSeriesResult() Cache

func (*Caches) GetStatsResult

func (m *Caches) GetStatsResult() Cache

func (*Caches) GetVolumeResult

func (m *Caches) GetVolumeResult() Cache

func (*Caches) GoString

func (this *Caches) GoString() string

func (Caches) Log

func (c Caches) Log(log log.Logger)

func (*Caches) Marshal

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

func (*Caches) MarshalTo

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

func (*Caches) MarshalToSizedBuffer

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

func (*Caches) Merge

func (c *Caches) Merge(m Caches)

func (*Caches) ProtoMessage

func (*Caches) ProtoMessage()

func (*Caches) Reset

func (m *Caches) Reset()

func (*Caches) Size

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

func (*Caches) String

func (this *Caches) String() string

func (*Caches) Unmarshal

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

func (*Caches) XXX_DiscardUnknown

func (m *Caches) XXX_DiscardUnknown()

func (*Caches) XXX_Marshal

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

func (*Caches) XXX_Merge

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

func (*Caches) XXX_Size

func (m *Caches) XXX_Size() int

func (*Caches) XXX_Unmarshal

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

type Chunk

type Chunk struct {
	// Total bytes processed but was already in memory (found in the headchunk). Includes structured metadata bytes.
	HeadChunkBytes int64 `protobuf:"varint,4,opt,name=headChunkBytes,proto3" json:"headChunkBytes"`
	// Total lines processed but was already in memory. (found in the headchunk)
	HeadChunkLines int64 `protobuf:"varint,5,opt,name=headChunkLines,proto3" json:"headChunkLines"`
	// Total bytes decompressed and processed from chunks. Includes structured metadata bytes.
	DecompressedBytes int64 `protobuf:"varint,6,opt,name=decompressedBytes,proto3" json:"decompressedBytes"`
	// Total lines decompressed and processed from chunks.
	DecompressedLines int64 `protobuf:"varint,7,opt,name=decompressedLines,proto3" json:"decompressedLines"`
	// Total bytes of compressed chunks (blocks) processed.
	CompressedBytes int64 `protobuf:"varint,8,opt,name=compressedBytes,proto3" json:"compressedBytes"`
	// Total duplicates found while processing.
	TotalDuplicates int64 `protobuf:"varint,9,opt,name=totalDuplicates,proto3" json:"totalDuplicates"`
	// Total lines post filtering
	PostFilterLines int64 `protobuf:"varint,10,opt,name=postFilterLines,proto3" json:"postFilterLines"`
	// Total bytes processed for metadata but was already in memory. (found in the headchunk)
	HeadChunkStructuredMetadataBytes int64 `protobuf:"varint,11,opt,name=headChunkStructuredMetadataBytes,proto3" json:"headChunkStructuredMetadataBytes"`
	// Total bytes of entries metadata decompressed and processed from chunks.
	DecompressedStructuredMetadataBytes int64 `protobuf:"varint,12,opt,name=decompressedStructuredMetadataBytes,proto3" json:"decompressedStructuredMetadataBytes"`
}

func (*Chunk) Descriptor

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

func (*Chunk) Equal

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

func (*Chunk) GetCompressedBytes

func (m *Chunk) GetCompressedBytes() int64

func (*Chunk) GetDecompressedBytes

func (m *Chunk) GetDecompressedBytes() int64

func (*Chunk) GetDecompressedLines

func (m *Chunk) GetDecompressedLines() int64

func (*Chunk) GetDecompressedStructuredMetadataBytes

func (m *Chunk) GetDecompressedStructuredMetadataBytes() int64

func (*Chunk) GetHeadChunkBytes

func (m *Chunk) GetHeadChunkBytes() int64

func (*Chunk) GetHeadChunkLines

func (m *Chunk) GetHeadChunkLines() int64

func (*Chunk) GetHeadChunkStructuredMetadataBytes

func (m *Chunk) GetHeadChunkStructuredMetadataBytes() int64

func (*Chunk) GetPostFilterLines

func (m *Chunk) GetPostFilterLines() int64

func (*Chunk) GetTotalDuplicates

func (m *Chunk) GetTotalDuplicates() int64

func (*Chunk) GoString

func (this *Chunk) GoString() string

func (*Chunk) Marshal

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

func (*Chunk) MarshalTo

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

func (*Chunk) MarshalToSizedBuffer

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

func (*Chunk) ProtoMessage

func (*Chunk) ProtoMessage()

func (*Chunk) Reset

func (m *Chunk) Reset()

func (*Chunk) Size

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

func (*Chunk) String

func (this *Chunk) String() string

func (*Chunk) Unmarshal

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

func (*Chunk) XXX_DiscardUnknown

func (m *Chunk) XXX_DiscardUnknown()

func (*Chunk) XXX_Marshal

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

func (*Chunk) XXX_Merge

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

func (*Chunk) XXX_Size

func (m *Chunk) XXX_Size() int

func (*Chunk) XXX_Unmarshal

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

type Component

type Component int64

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context is the statistics context. It is passed through the query path and accumulates statistics.

func FromContext

func FromContext(ctx context.Context) *Context

FromContext returns the statistics context.

func NewContext

func NewContext(ctx context.Context) (*Context, context.Context)

NewContext creates a new statistics context

func (*Context) AddCacheBytesRetrieved

func (c *Context) AddCacheBytesRetrieved(t CacheType, i int)

AddCacheBytesRetrieved counts the amount of bytes retrieved from the cache

func (*Context) AddCacheBytesSent

func (c *Context) AddCacheBytesSent(t CacheType, i int)

AddCacheBytesSent counts the amount of bytes sent to the cache It should be noted that if a background writeback (https://grafana.com/docs/loki/latest/configuration/#cache_config) is configured we cannot know if these bytes actually got stored or not as this happens asynchronously

func (*Context) AddCacheDownloadTime

func (c *Context) AddCacheDownloadTime(t CacheType, i time.Duration)

AddCacheDownloadTime measures the time to download the data from cache

func (*Context) AddCacheEntriesFound

func (c *Context) AddCacheEntriesFound(t CacheType, i int)

AddCacheEntriesFound counts the number of cache entries requested and found

func (*Context) AddCacheEntriesRequested

func (c *Context) AddCacheEntriesRequested(t CacheType, i int)

AddCacheEntriesRequested counts the number of keys requested from the cache

func (*Context) AddCacheEntriesStored

func (c *Context) AddCacheEntriesStored(t CacheType, i int)

AddCacheEntriesStored counts the number of keys *attempted* to be stored in the cache It should be noted that if a background writeback (https://grafana.com/docs/loki/latest/configuration/#cache_config) is configured we cannot know if these store attempts succeeded or not as this happens asynchronously

func (*Context) AddCacheQueryLengthServed

func (c *Context) AddCacheQueryLengthServed(t CacheType, i time.Duration)

AddCacheQueryLengthServed measures the length of the query served from cache

func (*Context) AddCacheRequest

func (c *Context) AddCacheRequest(t CacheType, i int)

AddCacheRequest counts the number of fetch/store requests to the cache

func (*Context) AddChunkRefsFetchTime

func (c *Context) AddChunkRefsFetchTime(i time.Duration)

func (*Context) AddChunksDownloadTime

func (c *Context) AddChunksDownloadTime(i time.Duration)

func (*Context) AddChunksDownloaded

func (c *Context) AddChunksDownloaded(i int64)

func (*Context) AddChunksRef

func (c *Context) AddChunksRef(i int64)

func (*Context) AddCompressedBytes

func (c *Context) AddCompressedBytes(i int64)

func (*Context) AddCongestionControlLatency

func (c *Context) AddCongestionControlLatency(i time.Duration)

func (*Context) AddDecompressedBytes

func (c *Context) AddDecompressedBytes(i int64)

func (*Context) AddDecompressedLines

func (c *Context) AddDecompressedLines(i int64)

func (*Context) AddDecompressedStructuredMetadataBytes

func (c *Context) AddDecompressedStructuredMetadataBytes(i int64)

func (*Context) AddDuplicates

func (c *Context) AddDuplicates(i int64)

func (*Context) AddHeadChunkBytes

func (c *Context) AddHeadChunkBytes(i int64)

func (*Context) AddHeadChunkLines

func (c *Context) AddHeadChunkLines(i int64)

func (*Context) AddHeadChunkStructuredMetadataBytes

func (c *Context) AddHeadChunkStructuredMetadataBytes(i int64)

func (*Context) AddIngesterBatch

func (c *Context) AddIngesterBatch(size int64)

func (*Context) AddIngesterReached

func (c *Context) AddIngesterReached(i int32)

func (*Context) AddIngesterTotalChunkMatched

func (c *Context) AddIngesterTotalChunkMatched(i int64)

func (*Context) AddPipelineWrapperFilterdLines

func (c *Context) AddPipelineWrapperFilterdLines(i int64)

func (*Context) AddPostFilterLines

func (c *Context) AddPostFilterLines(i int64)

func (*Context) AddSplitQueries

func (c *Context) AddSplitQueries(num int64)

func (*Context) Caches

func (c *Context) Caches() Caches

Caches returns the cache statistics accumulated so far.

func (*Context) Index

func (c *Context) Index() Index

Index returns the index statistics accumulated so far.

func (*Context) Ingester

func (c *Context) Ingester() Ingester

Ingester returns the ingester statistics accumulated so far.

func (*Context) Reset

func (c *Context) Reset()

Reset clears the statistics.

func (*Context) Result

func (c *Context) Result(execTime time.Duration, queueTime time.Duration, totalEntriesReturned int) Result

Result calculates the summary based on store and ingester data.

func (*Context) SetQueryReferencedStructuredMetadata

func (c *Context) SetQueryReferencedStructuredMetadata()

func (*Context) Store

func (c *Context) Store() Store

Store returns the store statistics accumulated so far.

type Index

type Index struct {
	// Total chunks
	TotalChunks int64 `protobuf:"varint,1,opt,name=totalChunks,proto3" json:"totalChunks"`
	// Post-filtered chunks
	PostFilterChunks int64 `protobuf:"varint,2,opt,name=postFilterChunks,proto3" json:"postFilterChunks"`
}

Statistics from Index queries TODO(owen-d): include bytes. Needs some index methods added to return _sized_ chunk refs to know

func (*Index) Descriptor

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

func (*Index) Equal

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

func (*Index) GetPostFilterChunks

func (m *Index) GetPostFilterChunks() int64

func (*Index) GetTotalChunks

func (m *Index) GetTotalChunks() int64

func (*Index) GoString

func (this *Index) GoString() string

func (*Index) Marshal

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

func (*Index) MarshalTo

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

func (*Index) MarshalToSizedBuffer

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

func (*Index) Merge

func (i *Index) Merge(m Index)

func (*Index) ProtoMessage

func (*Index) ProtoMessage()

func (*Index) Reset

func (m *Index) Reset()

func (*Index) Size

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

func (*Index) String

func (this *Index) String() string

func (*Index) Unmarshal

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

func (*Index) XXX_DiscardUnknown

func (m *Index) XXX_DiscardUnknown()

func (*Index) XXX_Marshal

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

func (*Index) XXX_Merge

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

func (*Index) XXX_Size

func (m *Index) XXX_Size() int

func (*Index) XXX_Unmarshal

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

type Ingester

type Ingester struct {
	// Total ingester reached for this query.
	TotalReached int32 `protobuf:"varint,1,opt,name=totalReached,proto3" json:"totalReached"`
	// Total of chunks matched by the query from ingesters
	TotalChunksMatched int64 `protobuf:"varint,2,opt,name=totalChunksMatched,proto3" json:"totalChunksMatched"`
	// Total of batches sent from ingesters.
	TotalBatches int64 `protobuf:"varint,3,opt,name=totalBatches,proto3" json:"totalBatches"`
	// Total lines sent by ingesters.
	TotalLinesSent int64 `protobuf:"varint,4,opt,name=totalLinesSent,proto3" json:"totalLinesSent"`
	Store          Store `protobuf:"bytes,5,opt,name=store,proto3" json:"store"`
}

func (*Ingester) Descriptor

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

func (*Ingester) Equal

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

func (*Ingester) GetStore

func (m *Ingester) GetStore() Store

func (*Ingester) GetTotalBatches

func (m *Ingester) GetTotalBatches() int64

func (*Ingester) GetTotalChunksMatched

func (m *Ingester) GetTotalChunksMatched() int64

func (*Ingester) GetTotalLinesSent

func (m *Ingester) GetTotalLinesSent() int64

func (*Ingester) GetTotalReached

func (m *Ingester) GetTotalReached() int32

func (*Ingester) GoString

func (this *Ingester) GoString() string

func (*Ingester) Marshal

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

func (*Ingester) MarshalTo

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

func (*Ingester) MarshalToSizedBuffer

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

func (*Ingester) Merge

func (i *Ingester) Merge(m Ingester)

func (*Ingester) ProtoMessage

func (*Ingester) ProtoMessage()

func (*Ingester) Reset

func (m *Ingester) Reset()

func (*Ingester) Size

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

func (*Ingester) String

func (this *Ingester) String() string

func (*Ingester) Unmarshal

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

func (*Ingester) XXX_DiscardUnknown

func (m *Ingester) XXX_DiscardUnknown()

func (*Ingester) XXX_Marshal

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

func (*Ingester) XXX_Merge

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

func (*Ingester) XXX_Size

func (m *Ingester) XXX_Size() int

func (*Ingester) XXX_Unmarshal

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

type Querier

type Querier struct {
	Store Store `protobuf:"bytes,1,opt,name=store,proto3" json:"store"`
}

func (*Querier) Descriptor

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

func (*Querier) Equal

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

func (*Querier) GetStore

func (m *Querier) GetStore() Store

func (*Querier) GoString

func (this *Querier) GoString() string

func (*Querier) Marshal

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

func (*Querier) MarshalTo

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

func (*Querier) MarshalToSizedBuffer

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

func (*Querier) Merge

func (q *Querier) Merge(m Querier)

func (*Querier) ProtoMessage

func (*Querier) ProtoMessage()

func (*Querier) Reset

func (m *Querier) Reset()

func (*Querier) Size

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

func (*Querier) String

func (this *Querier) String() string

func (*Querier) Unmarshal

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

func (*Querier) XXX_DiscardUnknown

func (m *Querier) XXX_DiscardUnknown()

func (*Querier) XXX_Marshal

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

func (*Querier) XXX_Merge

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

func (*Querier) XXX_Size

func (m *Querier) XXX_Size() int

func (*Querier) XXX_Unmarshal

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

type Result

type Result struct {
	Summary  Summary  `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary"`
	Querier  Querier  `protobuf:"bytes,2,opt,name=querier,proto3" json:"querier"`
	Ingester Ingester `protobuf:"bytes,3,opt,name=ingester,proto3" json:"ingester"`
	Caches   Caches   `protobuf:"bytes,4,opt,name=caches,proto3" json:"cache"`
	Index    Index    `protobuf:"bytes,5,opt,name=index,proto3" json:"index"`
}

Result contains LogQL query statistics.

func (Result) ChunkRefsFetchTime

func (r Result) ChunkRefsFetchTime() time.Duration

func (Result) ChunksDownloadTime

func (r Result) ChunksDownloadTime() time.Duration

func (*Result) ComputeSummary

func (r *Result) ComputeSummary(execTime time.Duration, queueTime time.Duration, totalEntriesReturned int)

ComputeSummary compute the summary of the statistics.

func (Result) CongestionControlLatency

func (r Result) CongestionControlLatency() time.Duration

func (*Result) Descriptor

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

func (*Result) Equal

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

func (*Result) GetCaches

func (m *Result) GetCaches() Caches

func (*Result) GetIndex

func (m *Result) GetIndex() Index

func (*Result) GetIngester

func (m *Result) GetIngester() Ingester

func (*Result) GetQuerier

func (m *Result) GetQuerier() Querier

func (*Result) GetSummary

func (m *Result) GetSummary() Summary

func (*Result) GoString

func (this *Result) GoString() string

func (Result) Log

func (r Result) Log(log log.Logger)

Log logs a query statistics result.

func (*Result) Marshal

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

func (*Result) MarshalTo

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

func (*Result) MarshalToSizedBuffer

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

func (*Result) Merge

func (r *Result) Merge(m Result)

Merge merges two results of statistics.

func (*Result) MergeSplit

func (r *Result) MergeSplit(m Result)

func (Result) PipelineWrapperFilteredLines

func (r Result) PipelineWrapperFilteredLines() int64

func (*Result) ProtoMessage

func (*Result) ProtoMessage()

func (Result) QueryReferencedStructuredMetadata

func (r Result) QueryReferencedStructuredMetadata() bool

func (*Result) Reset

func (m *Result) Reset()

func (*Result) Size

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

func (*Result) String

func (this *Result) String() string

func (Result) TotalChunksDownloaded

func (r Result) TotalChunksDownloaded() int64

func (Result) TotalChunksRef

func (r Result) TotalChunksRef() int64

func (Result) TotalDecompressedBytes

func (r Result) TotalDecompressedBytes() int64

func (Result) TotalDecompressedLines

func (r Result) TotalDecompressedLines() int64

func (Result) TotalDuplicates

func (r Result) TotalDuplicates() int64

func (*Result) Unmarshal

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

func (*Result) XXX_DiscardUnknown

func (m *Result) XXX_DiscardUnknown()

func (*Result) XXX_Marshal

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

func (*Result) XXX_Merge

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

func (*Result) XXX_Size

func (m *Result) XXX_Size() int

func (*Result) XXX_Unmarshal

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

type Store

type Store struct {
	// The total of chunk reference fetched from index.
	TotalChunksRef int64 `protobuf:"varint,1,opt,name=totalChunksRef,proto3" json:"totalChunksRef"`
	// Total number of chunks fetched.
	TotalChunksDownloaded int64 `protobuf:"varint,2,opt,name=totalChunksDownloaded,proto3" json:"totalChunksDownloaded"`
	// Time spent fetching chunks in nanoseconds.
	ChunksDownloadTime int64 `protobuf:"varint,3,opt,name=chunksDownloadTime,proto3" json:"chunksDownloadTime"`
	// Whether the query referenced structured metadata
	QueryReferencedStructured bool  `protobuf:"varint,13,opt,name=queryReferencedStructured,proto3" json:"queryReferencedStructuredMetadata"`
	Chunk                     Chunk `protobuf:"bytes,4,opt,name=chunk,proto3" json:"chunk"`
	// Time spent fetching chunk refs from index.
	ChunkRefsFetchTime int64 `protobuf:"varint,5,opt,name=chunkRefsFetchTime,proto3" json:"chunkRefsFetchTime"`
	// Time spent being blocked on congestion control.
	CongestionControlLatency int64 `protobuf:"varint,6,opt,name=congestionControlLatency,proto3" json:"congestionControlLatency"`
	// Total number of lines filtered by pipeline wrapper.
	PipelineWrapperFilteredLines int64 `protobuf:"varint,7,opt,name=pipelineWrapperFilteredLines,proto3" json:"pipelineWrapperFilteredLines"`
}

func (*Store) ChunksDownloadDuration

func (s *Store) ChunksDownloadDuration() time.Duration

func (*Store) Descriptor

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

func (*Store) Equal

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

func (*Store) GetChunk

func (m *Store) GetChunk() Chunk

func (*Store) GetChunkRefsFetchTime

func (m *Store) GetChunkRefsFetchTime() int64

func (*Store) GetChunksDownloadTime

func (m *Store) GetChunksDownloadTime() int64

func (*Store) GetCongestionControlLatency

func (m *Store) GetCongestionControlLatency() int64

func (*Store) GetPipelineWrapperFilteredLines

func (m *Store) GetPipelineWrapperFilteredLines() int64

func (*Store) GetQueryReferencedStructured

func (m *Store) GetQueryReferencedStructured() bool

func (*Store) GetTotalChunksDownloaded

func (m *Store) GetTotalChunksDownloaded() int64

func (*Store) GetTotalChunksRef

func (m *Store) GetTotalChunksRef() int64

func (*Store) GoString

func (this *Store) GoString() string

func (*Store) Marshal

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

func (*Store) MarshalTo

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

func (*Store) MarshalToSizedBuffer

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

func (*Store) Merge

func (s *Store) Merge(m Store)

func (*Store) ProtoMessage

func (*Store) ProtoMessage()

func (*Store) Reset

func (m *Store) Reset()

func (*Store) Size

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

func (*Store) String

func (this *Store) String() string

func (*Store) Unmarshal

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

func (*Store) XXX_DiscardUnknown

func (m *Store) XXX_DiscardUnknown()

func (*Store) XXX_Marshal

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

func (*Store) XXX_Merge

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

func (*Store) XXX_Size

func (m *Store) XXX_Size() int

func (*Store) XXX_Unmarshal

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

type Summary

type Summary struct {
	// Total bytes processed per second.
	BytesProcessedPerSecond int64 `protobuf:"varint,1,opt,name=bytesProcessedPerSecond,proto3" json:"bytesProcessedPerSecond"`
	// Total lines processed per second.
	LinesProcessedPerSecond int64 `protobuf:"varint,2,opt,name=linesProcessedPerSecond,proto3" json:"linesProcessedPerSecond"`
	// Total bytes processed. Includes structured metadata bytes.
	TotalBytesProcessed int64 `protobuf:"varint,3,opt,name=totalBytesProcessed,proto3" json:"totalBytesProcessed"`
	// Total lines processed.
	TotalLinesProcessed int64 `protobuf:"varint,4,opt,name=totalLinesProcessed,proto3" json:"totalLinesProcessed"`
	// Execution time in seconds.
	// In addition to internal calculations this is also returned by the HTTP API.
	// Grafana expects time values to be returned in seconds as float.
	ExecTime float64 `protobuf:"fixed64,5,opt,name=execTime,proto3" json:"execTime"`
	// Queue time in seconds.
	// In addition to internal calculations this is also returned by the HTTP API.
	// Grafana expects time values to be returned in seconds as float.
	QueueTime float64 `protobuf:"fixed64,6,opt,name=queueTime,proto3" json:"queueTime"`
	// Subqueries exists for backwards compatibility reasons and is deprecated. Do not use.
	// Instead use splits and shards
	Subqueries int64 `protobuf:"varint,7,opt,name=subqueries,proto3" json:"subqueries"`
	// Total number of result entries returned
	TotalEntriesReturned int64 `protobuf:"varint,8,opt,name=totalEntriesReturned,proto3" json:"totalEntriesReturned"`
	// Total number of splits by time
	Splits int64 `protobuf:"varint,9,opt,name=splits,proto3" json:"splits"`
	// Total number of shards
	Shards int64 `protobuf:"varint,10,opt,name=shards,proto3" json:"shards"`
	// Total lines post query filtering
	TotalPostFilterLines int64 `protobuf:"varint,11,opt,name=totalPostFilterLines,proto3" json:"totalPostFilterLines"`
	// Total bytes processed of metadata.
	TotalStructuredMetadataBytesProcessed int64 `protobuf:"varint,12,opt,name=totalStructuredMetadataBytesProcessed,proto3" json:"totalStructuredMetadataBytesProcessed"`
}

Summary is the summary of a query statistics.

func (*Summary) Descriptor

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

func (*Summary) Equal

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

func (*Summary) GetBytesProcessedPerSecond

func (m *Summary) GetBytesProcessedPerSecond() int64

func (*Summary) GetExecTime

func (m *Summary) GetExecTime() float64

func (*Summary) GetLinesProcessedPerSecond

func (m *Summary) GetLinesProcessedPerSecond() int64

func (*Summary) GetQueueTime

func (m *Summary) GetQueueTime() float64

func (*Summary) GetShards

func (m *Summary) GetShards() int64

func (*Summary) GetSplits

func (m *Summary) GetSplits() int64

func (*Summary) GetSubqueries

func (m *Summary) GetSubqueries() int64

func (*Summary) GetTotalBytesProcessed

func (m *Summary) GetTotalBytesProcessed() int64

func (*Summary) GetTotalEntriesReturned

func (m *Summary) GetTotalEntriesReturned() int64

func (*Summary) GetTotalLinesProcessed

func (m *Summary) GetTotalLinesProcessed() int64

func (*Summary) GetTotalPostFilterLines

func (m *Summary) GetTotalPostFilterLines() int64

func (*Summary) GetTotalStructuredMetadataBytesProcessed

func (m *Summary) GetTotalStructuredMetadataBytesProcessed() int64

func (*Summary) GoString

func (this *Summary) GoString() string

func (Summary) Log

func (s Summary) Log(log log.Logger)

func (*Summary) Marshal

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

func (*Summary) MarshalTo

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

func (*Summary) MarshalToSizedBuffer

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

func (*Summary) Merge

func (s *Summary) Merge(m Summary)

func (*Summary) ProtoMessage

func (*Summary) ProtoMessage()

func (*Summary) Reset

func (m *Summary) Reset()

func (*Summary) Size

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

func (*Summary) String

func (this *Summary) String() string

func (*Summary) Unmarshal

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

func (*Summary) XXX_DiscardUnknown

func (m *Summary) XXX_DiscardUnknown()

func (*Summary) XXX_Marshal

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

func (*Summary) XXX_Merge

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

func (*Summary) XXX_Size

func (m *Summary) XXX_Size() int

func (*Summary) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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