Skip to content

Commit

Permalink
storage: Add total bytes metric for admin UI replication graph
Browse files Browse the repository at this point in the history
  • Loading branch information
a-robinson committed Aug 21, 2017
1 parent ebab067 commit 4eba709
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions pkg/storage/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ var (
metaValBytes = metric.Metadata{
Name: "valbytes",
Help: "Number of bytes taken up by values"}
metaTotalBytes = metric.Metadata{
Name: "totalbytes",
Help: "Total number of bytes taken up by keys and values including non-live data"}
metaIntentBytes = metric.Metadata{
Name: "intentbytes",
Help: "Number of bytes in intent KV pairs"}
Expand Down Expand Up @@ -510,6 +513,7 @@ type StoreMetrics struct {
LiveBytes *metric.Gauge
KeyBytes *metric.Gauge
ValBytes *metric.Gauge
TotalBytes *metric.Gauge
IntentBytes *metric.Gauge
LiveCount *metric.Gauge
KeyCount *metric.Gauge
Expand Down Expand Up @@ -702,6 +706,7 @@ func newStoreMetrics(histogramWindow time.Duration) *StoreMetrics {
LiveBytes: metric.NewGauge(metaLiveBytes),
KeyBytes: metric.NewGauge(metaKeyBytes),
ValBytes: metric.NewGauge(metaValBytes),
TotalBytes: metric.NewGauge(metaTotalBytes),
IntentBytes: metric.NewGauge(metaIntentBytes),
LiveCount: metric.NewGauge(metaLiveCount),
KeyCount: metric.NewGauge(metaKeyCount),
Expand Down Expand Up @@ -868,6 +873,7 @@ func (sm *StoreMetrics) updateMVCCGaugesLocked() {
sm.LiveBytes.Update(sm.mu.stats.LiveBytes)
sm.KeyBytes.Update(sm.mu.stats.KeyBytes)
sm.ValBytes.Update(sm.mu.stats.ValBytes)
sm.TotalBytes.Update(sm.mu.stats.Total())
sm.IntentBytes.Update(sm.mu.stats.IntentBytes)
sm.LiveCount.Update(sm.mu.stats.LiveCount)
sm.KeyCount.Update(sm.mu.stats.KeyCount)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ui/embedded.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pkg/ui/src/util/proto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export namespace MetricConstants {
export const liveBytes: string = "livebytes";
export const keyBytes: string = "keybytes";
export const valBytes: string = "valbytes";
export const totalBytes: string = "totalbytes";
export const intentBytes: string = "intentbytes";
export const liveCount: string = "livecount";
export const keyCount: string = "keycount";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ export default function (props: GraphDashboardProps) {
</Axis>
</LineGraph>,

<LineGraph title="Live Bytes per Store" tooltip={`The number of live bytes of data on each store.`}>
<LineGraph title="Logical Bytes per Store" tooltip={`The number of logical bytes of data on each store.`}>
<Axis units={AxisUnits.Bytes}>
{
_.map(nodeIDs, (nid) => (
<Metric
key={nid}
name="cr.store.livebytes"
name="cr.store.totalbytes"
title={nodeAddress(nodesSummary, nid)}
sources={storeIDsForNode(nodesSummary, nid)}
/>
Expand Down

0 comments on commit 4eba709

Please sign in to comment.