Skip to content

Commit 9f20d40

Browse files
committed
ui: extend storage dashboard
Add a new graph for the aggregate duration of compactions. Add a new graph for the compaction scores of each level. Epic: none Release note: none
1 parent ff23cba commit 9f20d40

File tree

1 file changed

+80
-0
lines changed
  • pkg/ui/workspaces/db-console/src/views/cluster/containers/nodeGraphs/dashboards

1 file changed

+80
-0
lines changed

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

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { AxisUnits } from "@cockroachlabs/cluster-ui";
77
import map from "lodash/map";
88
import React from "react";
99

10+
import { cockroach } from "src/js/protos";
1011
import LineGraph from "src/views/cluster/components/linegraph";
1112
import {
1213
CapacityGraphTooltip,
@@ -21,6 +22,8 @@ import {
2122
} from "./dashboardUtils";
2223
import { multipleStoreMetrics, storeMetrics } from "./storeUtils";
2324

25+
import TimeSeriesQueryAggregator = cockroach.ts.tspb.TimeSeriesQueryAggregator;
26+
2427
export default function (props: GraphDashboardProps) {
2528
const {
2629
nodeIDs,
@@ -167,6 +170,83 @@ export default function (props: GraphDashboardProps) {
167170
</Axis>
168171
</LineGraph>,
169172

173+
<LineGraph
174+
title="Compaction Duration"
175+
sources={storeSources}
176+
isKvGraph={true}
177+
tenantSource={tenantSource}
178+
tooltip={`The cumulative time spent performing compactions.`}
179+
showMetricsInTooltip={true}
180+
>
181+
<Axis units={AxisUnits.Duration} label="duration">
182+
{storeMetrics(
183+
{
184+
name: "cr.store.storage.compactions.duration",
185+
nonNegativeRate: true,
186+
downsampler: TimeSeriesQueryAggregator.MAX,
187+
aggregator: TimeSeriesQueryAggregator.SUM,
188+
},
189+
nodeIDs,
190+
storeIDsByNodeID,
191+
)}
192+
</Axis>
193+
</LineGraph>,
194+
195+
<LineGraph
196+
title="Level Compaction Scores"
197+
sources={storeSources}
198+
isKvGraph={true}
199+
tenantSource={tenantSource}
200+
tooltip={`The compaction score for each level of the LSM tree.
201+
The storage engine prioritizes compactions out of levels with higher
202+
scores.`}
203+
showMetricsInTooltip={true}
204+
>
205+
<Axis label="score">
206+
{multipleStoreMetrics(
207+
[
208+
{
209+
prefix: "L0",
210+
name: "cr.store.storage.l0-level-score",
211+
aggregateMax: true,
212+
},
213+
{
214+
prefix: "L1",
215+
name: "cr.store.storage.l1-level-score",
216+
aggregateMax: true,
217+
},
218+
{
219+
prefix: "L2",
220+
name: "cr.store.storage.l2-level-score",
221+
aggregateMax: true,
222+
},
223+
{
224+
prefix: "L3",
225+
name: "cr.store.storage.l3-level-score",
226+
aggregateMax: true,
227+
},
228+
{
229+
prefix: "L4",
230+
name: "cr.store.storage.l4-level-score",
231+
aggregateMax: true,
232+
},
233+
{
234+
prefix: "L5",
235+
name: "cr.store.storage.l5-level-score",
236+
aggregateMax: true,
237+
},
238+
{
239+
prefix: "L6",
240+
name: "cr.store.storage.l6-level-score",
241+
aggregateMax: true,
242+
},
243+
],
244+
nodeIDs,
245+
storeIDsByNodeID,
246+
)}
247+
</Axis>
248+
</LineGraph>,
249+
170250
<LineGraph
171251
title="Read Amplification"
172252
sources={storeSources}

0 commit comments

Comments
 (0)