mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-14 00:42:54 +00:00
latency recorder sketches
This commit is contained in:
35
if we just want to draw a pie chart.rs
Normal file
35
if we just want to draw a pie chart.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
// If we just want to draw a pie chart of where latency goes,
|
||||
// then we can project the `if we want to draw a jaeger trace.rs` into these structures.
|
||||
// - fold `Vec<...>` into a sum
|
||||
// - fold `start_time` and `end_time` into deltas
|
||||
|
||||
struct SmgrLatencyRecorder {
|
||||
parse_request: u64,
|
||||
downstairs: Arc<Mutex<Downstairs>>,
|
||||
flush_response: u64,
|
||||
}
|
||||
|
||||
struct Downstairs {
|
||||
wait_for_execution: u64, // batching happens here
|
||||
execution: Arc<Mutex<Execution>>,
|
||||
}
|
||||
|
||||
struct Execution {
|
||||
traverse_and_submit: Plan,
|
||||
wait_for_io_completions_and_walredo: WaitForIoCompletionsAndWalredo,
|
||||
}
|
||||
|
||||
struct Plan {
|
||||
visit_layer: VisitLayer,
|
||||
// implict remainder: time in the fringe code and traversing timeline ancestor graph
|
||||
}
|
||||
|
||||
struct VisitLayer {
|
||||
index_lookup: u64,
|
||||
submit_io: u64,
|
||||
}
|
||||
|
||||
struct WaitForIoCompletionsAndWalredo {
|
||||
wait_for_io_completions: u64,
|
||||
walredo: u64,
|
||||
}
|
||||
69
if we want to draw a jaeger trace.rs
Normal file
69
if we want to draw a jaeger trace.rs
Normal file
@@ -0,0 +1,69 @@
|
||||
// If we want to draw a Jaeger trace
|
||||
|
||||
struct SmgrLatencyRecorder {
|
||||
start_time: Instant,
|
||||
parse_request: ParseRequest,
|
||||
downstairs: Arc<Mutex<Downstairs>>,
|
||||
flush_response: FlushResponse,
|
||||
end_time: Instant,
|
||||
}
|
||||
|
||||
struct ParseRequest {
|
||||
start_time: Instant,
|
||||
end_time: Instant,
|
||||
}
|
||||
|
||||
struct FlushResponse {
|
||||
start_time: Instant,
|
||||
end_time: Instant,
|
||||
}
|
||||
|
||||
struct Downstairs {
|
||||
start_time: Instant,
|
||||
wait_for_execution: WaitForExecution, // batching happens here
|
||||
execution: Arc<Mutex<Execution>>,
|
||||
end_time: Instant,
|
||||
}
|
||||
|
||||
enum WaitForExecution {
|
||||
start_time: Instant,
|
||||
end_time: Instant,
|
||||
}
|
||||
|
||||
struct Execution {
|
||||
start_time: Instant,
|
||||
traverse_and_submit: Plan,
|
||||
wait_for_io_completions_and_walredo: Vec<Arc<Mutex<WaitForIoCompletionsAndWalredo>>>,
|
||||
end_time: Instant,
|
||||
}
|
||||
|
||||
struct Plan {
|
||||
start_time: Instant,
|
||||
visit_layer: Vec<VisitLayer>,
|
||||
// implict remainder: time in the fringe code and traversing timeline ancestor graph
|
||||
end_time: Instant,
|
||||
}
|
||||
|
||||
struct VisitLayer {
|
||||
start_time: Instant,
|
||||
index_lookup: IndexLookup,
|
||||
submit_io: SubmitIo,
|
||||
end_time: Instant,
|
||||
}
|
||||
|
||||
struct IndexLookup {
|
||||
start_time: Instant,
|
||||
end_time: Instant,
|
||||
}
|
||||
|
||||
struct SubmitIo {
|
||||
start_time: Instant,
|
||||
end_time: Instant,
|
||||
}
|
||||
|
||||
struct WaitForIoCompletionsAndWalredo {
|
||||
start_time: Instant,
|
||||
wait_for_io_completions: u64,
|
||||
walredo: u64,
|
||||
end_time: Instant,
|
||||
}
|
||||
Reference in New Issue
Block a user