Skip to content

Commit add9fe7

Browse files
committed
Add Close method to activity trackers
Followup to prometheus/prometheus#14064 Signed-off-by: György Krajcsovits <[email protected]>
1 parent f1e91b4 commit add9fe7

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

pkg/querier/engine/query_tracker.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,7 @@ func generateActivityDescription(ctx context.Context, query string) string {
6767
func (q queryTracker) Delete(insertIndex int) {
6868
q.tracker.Delete(insertIndex)
6969
}
70+
71+
func (q *queryTracker) Close() error {
72+
return q.tracker.Close()
73+
}

pkg/streamingpromql/engine_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,10 @@ func (qt *testQueryTracker) Delete(insertIndex int) {
13251325
qt.queries[insertIndex].deleted = true
13261326
}
13271327

1328+
func (qt *testQueryTracker) Close() error {
1329+
return nil
1330+
}
1331+
13281332
type activeQueryTrackerQueryable struct {
13291333
tracker *testQueryTracker
13301334

@@ -1403,6 +1407,10 @@ func (t *timeoutTestingQueryTracker) Delete(_ int) {
14031407
panic("should not be called")
14041408
}
14051409

1410+
func (t *timeoutTestingQueryTracker) Close() error {
1411+
return nil
1412+
}
1413+
14061414
func TestAnnotations(t *testing.T) {
14071415
startT := timestamp.Time(0).Add(time.Minute)
14081416
step := time.Minute

0 commit comments

Comments
 (0)