Skip to content

Commit 8e3b82e

Browse files
committed
add query and batch objects to ObservedQuery and ObservedBatch
1 parent 4ad60b6 commit 8e3b82e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

query_executor.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ func (q *internalQuery) attempt(keyspace string, end, start time.Time, iter *Ite
386386
Metrics: metricsForHost,
387387
Err: iter.err,
388388
Attempt: attempt,
389+
Query: q.originalQuery,
389390
})
390391
}
391392
}
@@ -597,6 +598,7 @@ func (b *internalBatch) attempt(keyspace string, end, start time.Time, iter *Ite
597598
Metrics: metricsForHost,
598599
Err: iter.err,
599600
Attempt: attempt,
601+
Batch: b.originalBatch,
600602
})
601603
}
602604

session.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2160,6 +2160,9 @@ type ObservedQuery struct {
21602160
// Attempt is the index of attempt at executing this query.
21612161
// The first attempt is number zero and any retries have non-zero attempt number.
21622162
Attempt int
2163+
2164+
// Query object associated with this request. Should be used as read only.
2165+
Query *Query
21632166
}
21642167

21652168
// QueryObserver is the interface implemented by query observers / stat collectors.
@@ -2197,6 +2200,9 @@ type ObservedBatch struct {
21972200
// Attempt is the index of attempt at executing this query.
21982201
// The first attempt is number zero and any retries have non-zero attempt number.
21992202
Attempt int
2203+
2204+
// Batch object associated with this request. Should be used as read only.
2205+
Batch *Batch
22002206
}
22012207

22022208
// BatchObserver is the interface implemented by batch observers / stat collectors.

0 commit comments

Comments
 (0)