diff --git a/pkg/logqlmodel/stats/context_test.go b/pkg/logqlmodel/stats/context_test.go index e40a5372a8968..b7e37e311718c 100644 --- a/pkg/logqlmodel/stats/context_test.go +++ b/pkg/logqlmodel/stats/context_test.go @@ -26,6 +26,7 @@ func TestResult(t *testing.T) { stats.AddCacheRequest(IndexCache, 4) stats.AddCacheRequest(ResultCache, 1) stats.SetQueryReferencedStructuredMetadata() + stats.AddPipelineWrapperFilterdLines(1) fakeIngesterQuery(ctx) fakeIngesterQuery(ctx) @@ -39,6 +40,7 @@ func TestResult(t *testing.T) { TotalLinesSent: 60, TotalReached: 2, Store: Store{ + PipelineWrapperFilteredLines: 2, Chunk: Chunk{ HeadChunkBytes: 10, HeadChunkLines: 20, @@ -51,10 +53,11 @@ func TestResult(t *testing.T) { }, Querier: Querier{ Store: Store{ - TotalChunksRef: 50, - TotalChunksDownloaded: 60, - ChunksDownloadTime: time.Second.Nanoseconds(), - QueryReferencedStructured: true, + TotalChunksRef: 50, + TotalChunksDownloaded: 60, + ChunksDownloadTime: time.Second.Nanoseconds(), + QueryReferencedStructured: true, + PipelineWrapperFilteredLines: 1, Chunk: Chunk{ HeadChunkBytes: 10, HeadChunkLines: 20, @@ -148,6 +151,7 @@ func fakeIngesterQuery(ctx context.Context) { TotalBatches: 25, TotalLinesSent: 30, Store: Store{ + PipelineWrapperFilteredLines: 1, Chunk: Chunk{ HeadChunkBytes: 5, HeadChunkLines: 10, @@ -173,6 +177,7 @@ func TestResult_Merge(t *testing.T) { TotalLinesSent: 60, TotalReached: 2, Store: Store{ + PipelineWrapperFilteredLines: 4, Chunk: Chunk{ HeadChunkBytes: 10, HeadChunkLines: 20, @@ -185,10 +190,11 @@ func TestResult_Merge(t *testing.T) { }, Querier: Querier{ Store: Store{ - TotalChunksRef: 50, - TotalChunksDownloaded: 60, - ChunksDownloadTime: time.Second.Nanoseconds(), - QueryReferencedStructured: true, + TotalChunksRef: 50, + TotalChunksDownloaded: 60, + ChunksDownloadTime: time.Second.Nanoseconds(), + QueryReferencedStructured: true, + PipelineWrapperFilteredLines: 2, Chunk: Chunk{ HeadChunkBytes: 10, HeadChunkLines: 20, @@ -235,6 +241,7 @@ func TestResult_Merge(t *testing.T) { TotalBatches: 2 * 50, TotalLinesSent: 2 * 60, Store: Store{ + PipelineWrapperFilteredLines: 8, Chunk: Chunk{ HeadChunkBytes: 2 * 10, HeadChunkLines: 2 * 20, @@ -248,10 +255,11 @@ func TestResult_Merge(t *testing.T) { }, Querier: Querier{ Store: Store{ - TotalChunksRef: 2 * 50, - TotalChunksDownloaded: 2 * 60, - ChunksDownloadTime: 2 * time.Second.Nanoseconds(), - QueryReferencedStructured: true, + TotalChunksRef: 2 * 50, + TotalChunksDownloaded: 2 * 60, + ChunksDownloadTime: 2 * time.Second.Nanoseconds(), + QueryReferencedStructured: true, + PipelineWrapperFilteredLines: 4, Chunk: Chunk{ HeadChunkBytes: 2 * 10, HeadChunkLines: 2 * 20, @@ -306,13 +314,15 @@ func TestIngester(t *testing.T) { statsCtx.AddDuplicates(10) statsCtx.AddHeadChunkBytes(200) statsCtx.SetQueryReferencedStructuredMetadata() + statsCtx.AddPipelineWrapperFilterdLines(1) require.Equal(t, Ingester{ TotalReached: 1, TotalChunksMatched: 100, TotalBatches: 25, TotalLinesSent: 30, Store: Store{ - QueryReferencedStructured: true, + QueryReferencedStructured: true, + PipelineWrapperFilteredLines: 1, Chunk: Chunk{ HeadChunkBytes: 200, CompressedBytes: 100, diff --git a/pkg/querier/queryrange/codec_test.go b/pkg/querier/queryrange/codec_test.go index b615d73b09c01..6a692c9180c94 100644 --- a/pkg/querier/queryrange/codec_test.go +++ b/pkg/querier/queryrange/codec_test.go @@ -1565,7 +1565,8 @@ var ( "totalChunksRef": 0, "totalChunksDownloaded": 0, "chunkRefsFetchTime": 0, - "queryReferencedStructuredMetadata": false + "queryReferencedStructuredMetadata": false, + "pipelineWrapperFilteredLines": 2 }, "totalBatches": 6, "totalChunksMatched": 7, @@ -1590,7 +1591,8 @@ var ( "totalChunksRef": 17, "totalChunksDownloaded": 18, "chunkRefsFetchTime": 19, - "queryReferencedStructuredMetadata": true + "queryReferencedStructuredMetadata": true, + "pipelineWrapperFilteredLines": 4 } }, "index": { @@ -2023,17 +2025,19 @@ var ( PostFilterLines: 0, TotalDuplicates: 19, }, - ChunksDownloadTime: 16, - CongestionControlLatency: 0, - TotalChunksRef: 17, - TotalChunksDownloaded: 18, - ChunkRefsFetchTime: 19, - QueryReferencedStructured: true, + ChunksDownloadTime: 16, + CongestionControlLatency: 0, + TotalChunksRef: 17, + TotalChunksDownloaded: 18, + ChunkRefsFetchTime: 19, + QueryReferencedStructured: true, + PipelineWrapperFilteredLines: 4, }, }, Ingester: stats.Ingester{ Store: stats.Store{ + PipelineWrapperFilteredLines: 2, Chunk: stats.Chunk{ CompressedBytes: 1, DecompressedBytes: 2, diff --git a/pkg/querier/queryrange/prometheus_test.go b/pkg/querier/queryrange/prometheus_test.go index 624c8b5194eec..a5bea28684251 100644 --- a/pkg/querier/queryrange/prometheus_test.go +++ b/pkg/querier/queryrange/prometheus_test.go @@ -25,6 +25,7 @@ var emptyStats = `"stats": { "totalChunksDownloaded": 0, "chunkRefsFetchTime": 0, "queryReferencedStructuredMetadata": false, + "pipelineWrapperFilteredLines": 0, "chunk" :{ "compressedBytes": 0, "decompressedBytes": 0, @@ -50,6 +51,7 @@ var emptyStats = `"stats": { "totalChunksDownloaded": 0, "chunkRefsFetchTime": 0, "queryReferencedStructuredMetadata": false, + "pipelineWrapperFilteredLines": 0, "chunk" :{ "compressedBytes": 0, "decompressedBytes": 0, diff --git a/pkg/util/marshal/legacy/marshal_test.go b/pkg/util/marshal/legacy/marshal_test.go index de308abb2b276..e146e9a99a5fa 100644 --- a/pkg/util/marshal/legacy/marshal_test.go +++ b/pkg/util/marshal/legacy/marshal_test.go @@ -68,6 +68,7 @@ var queryTests = []struct { "totalChunksDownloaded": 0, "chunkRefsFetchTime": 0, "queryReferencedStructuredMetadata": false, + "pipelineWrapperFilteredLines": 0, "chunk" :{ "compressedBytes": 0, "decompressedBytes": 0, @@ -93,6 +94,7 @@ var queryTests = []struct { "totalChunksDownloaded": 0, "chunkRefsFetchTime": 0, "queryReferencedStructuredMetadata": false, + "pipelineWrapperFilteredLines": 0, "chunk" :{ "compressedBytes": 0, "decompressedBytes": 0,