- Notifications
You must be signed in to change notification settings - Fork715
feat: add metrics workgroup#9400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Failed to generate code suggestions for PR |
Greptile OverviewGreptile SummaryThis PR modularizes workgroup concurrency control and introduces a Key Changes
Issues Found
Confidence Score: 3/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram participant Client participant SearchAPI as Search API participant StopWatch participant WorkGroup as WorkGroup Module participant DistLock as Distributed Lock (OSS) participant WGQueue as WorkGroup Queue (Enterprise) participant Querier as Querier Nodes Client->>SearchAPI: Search Request (metrics/logs) SearchAPI->>StopWatch: new() - Start timing alt OSS Build SearchAPI->>WorkGroup: check_work_group(trace_id, org_id, timeout) WorkGroup->>DistLock: lock_with_trace_id() DistLock-->>WorkGroup: Lock acquired WorkGroup->>StopWatch: record_split("queue_wait") WorkGroup-->>SearchAPI: Return WorkGroupLock with _guard else Enterprise Build SearchAPI->>WorkGroup: check_work_group(trace_id, org_id, user_id, work_group) WorkGroup->>DistLock: lock_with_trace_id() [temporary] WorkGroup->>WGQueue: need_wait() [loop until slot available] WGQueue-->>WorkGroup: Slot available WorkGroup->>WGQueue: process(trace_id, user_id) WorkGroup->>DistLock: unlock_with_trace_id() WorkGroup->>StopWatch: record_split("queue_wait") WorkGroup-->>SearchAPI: Return WorkGroupLock with _guard end SearchAPI->>Querier: Execute search queries Querier-->>SearchAPI: Results SearchAPI->>StopWatch: record_split("result") SearchAPI->>StopWatch: get_summary() - Log timing breakdown Note over WorkGroup,WGQueue: WorkGroupLock._guard dropped alt OSS Build WorkGroup->>DistLock: unlock_with_trace_id() [via AsyncDefer] else Enterprise Build WorkGroup->>WGQueue: done(trace_id, user_id) [via AsyncDefer] end SearchAPI-->>Client: Search Results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
6 files reviewed, 1 comment
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
4ebb849 to2e5f581Compareeab410d to09d1c94Compare0829ee8 intomainUh oh!
There was an error while loading.Please reload this page.
This PR adds: