Skip to content

Commit f9ba117

Browse files
committed
ui: consolidate log-commit and command-commit latency graphs
Previously the storage dashboard had two separate graphs for log-commit latencies (p99 and p50) and two separate graphs for command-commit latencies (p99 and p50). This commit consolidates these four graphs into two: one for log-commit latencies and one for command-commit latencies. Epic: none Release note: none
1 parent 6c5e164 commit f9ba117

File tree

2 files changed

+49
-59
lines changed

2 files changed

+49
-59
lines changed

pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx

Lines changed: 38 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
nodeDisplayName,
2020
storeIDsForNode,
2121
} from "./dashboardUtils";
22-
import { storeMetrics } from "./storeUtils";
22+
import { multipleStoreMetrics, storeMetrics } from "./storeUtils";
2323

2424
export default function (props: GraphDashboardProps) {
2525
const {
@@ -103,85 +103,64 @@ export default function (props: GraphDashboardProps) {
103103
</LineGraph>,
104104

105105
<LineGraph
106-
title="Log Commit Latency: 99th Percentile"
106+
title="Log Commit Latency"
107107
sources={storeSources}
108108
isKvGraph={true}
109109
tenantSource={tenantSource}
110-
tooltip={`The 99th %ile latency for commits to the Raft Log. This measures
111-
essentially an fdatasync to the storage engine's write-ahead log.`}
110+
tooltip={`The latency for commits to the Raft Log. This is typically
111+
dominated by the latency of an fdatasync to the storage engine's
112+
write-ahead log.`}
112113
showMetricsInTooltip={true}
113114
>
114115
<Axis units={AxisUnits.Duration} label="latency">
115-
{storeMetrics(
116-
{
117-
name: "cr.store.raft.process.logcommit.latency-p99",
118-
aggregateMax: true,
119-
},
120-
nodeIDs,
121-
storeIDsByNodeID,
122-
)}
123-
</Axis>
124-
</LineGraph>,
125-
126-
<LineGraph
127-
title="Log Commit Latency: 50th Percentile"
128-
sources={storeSources}
129-
isKvGraph={true}
130-
tenantSource={tenantSource}
131-
tooltip={`The 50th %ile latency for commits to the Raft Log. This measures
132-
essentially an fdatasync to the storage engine's write-ahead log.`}
133-
showMetricsInTooltip={true}
134-
>
135-
<Axis units={AxisUnits.Duration} label="latency">
136-
{storeMetrics(
137-
{
138-
name: "cr.store.raft.process.logcommit.latency-p50",
139-
aggregateMax: true,
140-
},
141-
nodeIDs,
142-
storeIDsByNodeID,
143-
)}
144-
</Axis>
145-
</LineGraph>,
146-
147-
<LineGraph
148-
title="Command Commit Latency: 99th Percentile"
149-
sources={storeSources}
150-
isKvGraph={true}
151-
tenantSource={tenantSource}
152-
tooltip={`The 99th %ile latency for commits of Raft commands. This measures
153-
applying a batch to the storage engine (including writes to the
154-
write-ahead log), but no fsync.`}
155-
showMetricsInTooltip={true}
156-
>
157-
<Axis units={AxisUnits.Duration} label="latency">
158-
{storeMetrics(
159-
{
160-
name: "cr.store.raft.process.commandcommit.latency-p99",
161-
aggregateMax: true,
162-
},
116+
{multipleStoreMetrics(
117+
[
118+
{
119+
prefix: "p99.9",
120+
name: "cr.store.raft.process.logcommit.latency-p99.9",
121+
aggregateMax: true,
122+
},
123+
{
124+
prefix: "p99",
125+
name: "cr.store.raft.process.logcommit.latency-p99",
126+
aggregateMax: true,
127+
},
128+
{
129+
prefix: "p50",
130+
name: "cr.store.raft.process.logcommit.latency-p50",
131+
aggregateMax: true,
132+
},
133+
],
163134
nodeIDs,
164135
storeIDsByNodeID,
165136
)}
166137
</Axis>
167138
</LineGraph>,
168139

169140
<LineGraph
170-
title="Command Commit Latency: 50th Percentile"
141+
title="Command Commit Latency"
171142
sources={storeSources}
172143
isKvGraph={true}
173144
tenantSource={tenantSource}
174-
tooltip={`The 50th %ile latency for commits of Raft commands. This measures
145+
tooltip={`The latency for commits of Raft commands. This measures
175146
applying a batch to the storage engine (including writes to the
176147
write-ahead log), but no fsync.`}
177148
showMetricsInTooltip={true}
178149
>
179150
<Axis units={AxisUnits.Duration} label="latency">
180-
{storeMetrics(
181-
{
182-
name: "cr.store.raft.process.commandcommit.latency-p50",
183-
aggregateMax: true,
184-
},
151+
{multipleStoreMetrics(
152+
[
153+
{
154+
prefix: "p99",
155+
name: "cr.store.raft.process.commandcommit.latency-p99",
156+
aggregateMax: true,
157+
},
158+
{
159+
prefix: "p50",
160+
name: "cr.store.raft.process.commandcommit.latency-p50",
161+
aggregateMax: true,
162+
},
163+
],
185164
nodeIDs,
186165
storeIDsByNodeID,
187166
)}

pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards/storeUtils.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ import React from "react";
88
import { storeIDsForNode } from "src/views/cluster/containers/nodeGraphs/dashboards/dashboardUtils";
99
import { Metric, MetricProps } from "src/views/shared/components/metricQuery";
1010

11+
type PerStoreMetricProps = MetricProps & {
12+
prefix: string;
13+
};
14+
15+
export const multipleStoreMetrics = (
16+
props: PerStoreMetricProps[],
17+
nodeIDs: string[],
18+
storeIDsByNodeID: { [key: string]: string[] },
19+
) =>
20+
props.flatMap(prop => storeMetrics(prop, nodeIDs, storeIDsByNodeID, prop.prefix));
21+
1122
/**
1223
* Dynamically shows either the aggregated node-level metric when viewing the
1324
* cluster-level dashboard, or store-level metrics when viewing a single node.

0 commit comments

Comments
 (0)