Skip to content

Commit ade6ef0

Browse files
committed
ui: include blob file count on storage dashboard
Adapt the storage dashboard graph that displays the count of sstables in a store to also show the number of blob files. Epic: none Release note: none
1 parent 13741ff commit ade6ef0

File tree

2 files changed

+54
-40
lines changed

2 files changed

+54
-40
lines changed

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

Lines changed: 49 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,27 @@ export default function (props: GraphDashboardProps) {
189189
</LineGraph>,
190190

191191
<LineGraph
192-
title="SSTables"
192+
title="File Counts"
193193
sources={storeSources}
194194
isKvGraph={true}
195195
tenantSource={tenantSource}
196-
tooltip={`The number of SSTables in use ${tooltipSelection}.`}
196+
tooltip={`The number of files in use by type ${tooltipSelection}.`}
197197
showMetricsInTooltip={true}
198198
>
199-
<Axis label="sstables">
200-
{storeMetrics(
201-
{ name: "cr.store.rocksdb.num-sstables" },
199+
<Axis label="files">
200+
{multipleStoreMetrics(
201+
[
202+
{
203+
prefix: "sstables",
204+
name: "cr.store.rocksdb.num-sstables",
205+
aggregateMax: true,
206+
},
207+
{
208+
prefix: "blob files",
209+
name: "cr.store.storage.value_separation.blob_files.count",
210+
aggregateMax: true,
211+
},
212+
],
202213
nodeIDs,
203214
storeIDsByNodeID,
204215
)}
@@ -412,40 +423,44 @@ export default function (props: GraphDashboardProps) {
412423
tenantSource={tenantSource}
413424
tooltip={
414425
<div>
415-
The number of bytes of blocks loaded by iterators categorized according
416-
to the source {tooltipSelection}. These sums include blocks loaded
417-
from the block cache, blocks loaded from OS page cache and blocks loaded
418-
from disk.
426+
The number of bytes of blocks loaded by iterators categorized
427+
according to the source {tooltipSelection}. These sums include blocks
428+
loaded from the block cache, blocks loaded from OS page cache and
429+
blocks loaded from disk.
419430
<br />
420431
See the "Hardware" dashboard to view an aggregate of all disk reads.
421432
</div>
422433
}
423434
showMetricsInTooltip={true}
424435
>
425436
<Axis units={AxisUnits.Bytes} label="bytes">
426-
{multipleStoreMetrics([
427-
"abort-span",
428-
"backup",
429-
"batch-eval",
430-
"crdb-unknown",
431-
"intent-resolution",
432-
"mvcc-gc",
433-
"pebble-compaction",
434-
"pebble-get",
435-
"pebble-ingest",
436-
"range-snap",
437-
"rangefeed",
438-
"replication",
439-
"scan-background",
440-
"scan-regular",
441-
"unknown",
442-
].map(category => ({
443-
prefix: category,
444-
name: `cr.store.storage.iterator.category-`+category+`.block-load.bytes`,
445-
nonNegativeRate: true,
446-
})),
447-
nodeIDs,
448-
storeIDsByNodeID,
437+
{multipleStoreMetrics(
438+
[
439+
"abort-span",
440+
"backup",
441+
"batch-eval",
442+
"crdb-unknown",
443+
"intent-resolution",
444+
"mvcc-gc",
445+
"pebble-compaction",
446+
"pebble-get",
447+
"pebble-ingest",
448+
"range-snap",
449+
"rangefeed",
450+
"replication",
451+
"scan-background",
452+
"scan-regular",
453+
"unknown",
454+
].map(category => ({
455+
prefix: category,
456+
name:
457+
`cr.store.storage.iterator.category-` +
458+
category +
459+
`.block-load.bytes`,
460+
nonNegativeRate: true,
461+
})),
462+
nodeIDs,
463+
storeIDsByNodeID,
449464
)}
450465
</Axis>
451466
</LineGraph>,
@@ -482,7 +497,8 @@ export default function (props: GraphDashboardProps) {
482497
tenantSource={tenantSource}
483498
tooltip={
484499
<div>
485-
The volume of bytes stored separated from keys, externally in blob files.
500+
The volume of bytes stored separated from keys, externally in blob
501+
files.
486502
</div>
487503
}
488504
showMetricsInTooltip={true}
@@ -597,6 +613,5 @@ export default function (props: GraphDashboardProps) {
597613
/>
598614
</Axis>
599615
</LineGraph>,
600-
601616
];
602617
}

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ export const multipleStoreMetrics = (
1717
nodeIDs: string[],
1818
storeIDsByNodeID: { [key: string]: string[] },
1919
) =>
20-
props.flatMap(prop => storeMetrics(prop, nodeIDs, storeIDsByNodeID, prop.prefix));
20+
props.flatMap(prop =>
21+
storeMetrics(prop, nodeIDs, storeIDsByNodeID, prop.prefix),
22+
);
2123

2224
/**
2325
* Dynamically shows either the aggregated node-level metric when viewing the
@@ -71,13 +73,10 @@ export const storeMetrics = (
7173

7274
// If there's only one store for the node, don't show both the aggregated
7375
// metric and the per-store breakdown which will always be equal.
74-
if (storeIDs.length == 1) {
76+
if (storeIDs.length === 1) {
7577
return perStoreMetrics;
7678
}
7779

7880
// Otherwise, show the aggregated metric and a per-store breakdown.
79-
return [
80-
nodeMetric,
81-
...perStoreMetrics,
82-
];
81+
return [nodeMetric, ...perStoreMetrics];
8382
});

0 commit comments

Comments
 (0)