Skip to content

Commit 39226c3

Browse files
authored
[datafusion-cli] Replace mutex with AtomicU64 for stream duration tracking in instrumentedObjectStore (apache#20802)
## Which issue does this PR close? Related to apache#18138 but does not close any issue. ## Rationale for this change TimeToFirstItemStream held an Arc<Mutex<Vec<RequestDetails>>> and a request_index to write back the duration into the shared request list. I saw @alamb and @BlakeOrth's reviews on the PR apache#19127 about the improvements and wanted to change. ## What changes are included in this PR? - Replace Arc<Mutex<Vec<RequestDetails>>> + index in TimeToFirstItemStream with a per-request Arc<AtomicU64> - Store duration as nanoseconds in AtomicU64 (0 = not yet set) with Release/Acquire ordering - Start the timer lazily on the first poll_next call instead of at stream creation, so only actual storage latency is measured ## Are these changes tested? Existing tests and I've also added time comparison ## Are there any user-facing changes? No
1 parent 75c7da5 commit 39226c3

1 file changed

Lines changed: 134 additions & 75 deletions

File tree

0 commit comments

Comments
 (0)