github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/ui/src/views/cluster/containers/nodeGraphs/dashboards/storage.tsx (about)

     1  // Copyright 2018 The Cockroach Authors.
     2  //
     3  // Use of this software is governed by the Business Source License
     4  // included in the file licenses/BSL.txt.
     5  //
     6  // As of the Change Date specified in that file, in accordance with
     7  // the Business Source License, use of this software will be governed
     8  // by the Apache License, Version 2.0, included in the file
     9  // licenses/APL.txt.
    10  
    11  import React from "react";
    12  import _ from "lodash";
    13  
    14  import { LineGraph } from "src/views/cluster/components/linegraph";
    15  import { Metric, Axis, AxisUnits } from "src/views/shared/components/metricQuery";
    16  
    17  import { GraphDashboardProps, nodeDisplayName, storeIDsForNode } from "./dashboardUtils";
    18  import { CapacityGraphTooltip } from "src/views/cluster/containers/nodeGraphs/dashboards/graphTooltips";
    19  
    20  export default function (props: GraphDashboardProps) {
    21    const { nodeIDs, nodesSummary, nodeSources, storeSources, tooltipSelection } = props;
    22  
    23    return [
    24      <LineGraph
    25        title="Capacity"
    26        sources={storeSources}
    27        tooltip={<CapacityGraphTooltip tooltipSelection={tooltipSelection} />}
    28      >
    29        <Axis units={AxisUnits.Bytes} label="capacity">
    30          <Metric name="cr.store.capacity" title="Capacity" />
    31          <Metric name="cr.store.capacity.available" title="Available" />
    32          <Metric name="cr.store.capacity.used" title="Used" />
    33        </Axis>
    34      </LineGraph>,
    35  
    36      <LineGraph
    37        title="Live Bytes"
    38        sources={storeSources}
    39        tooltip={
    40          `Amount of data that can be read by applications and CockroachDB ${tooltipSelection}`
    41        }
    42      >
    43        <Axis units={AxisUnits.Bytes} label="live bytes">
    44          <Metric name="cr.store.livebytes" title="Live" />
    45          <Metric name="cr.store.sysbytes" title="System" />
    46        </Axis>
    47      </LineGraph>,
    48  
    49      <LineGraph
    50        title="Log Commit Latency: 99th Percentile"
    51        sources={storeSources}
    52        tooltip={`The 99th %ile latency for commits to the Raft Log.
    53          This measures essentially an fdatasync to the storage engine's write-ahead log.`}
    54      >
    55        <Axis units={AxisUnits.Duration} label="latency">
    56          {
    57            _.map(nodeIDs, (nid) => (
    58              <Metric
    59                key={nid}
    60                name="cr.store.raft.process.logcommit.latency-p99"
    61                title={nodeDisplayName(nodesSummary, nid)}
    62                sources={storeIDsForNode(nodesSummary, nid)}
    63              />
    64            ))
    65          }
    66        </Axis>
    67      </LineGraph>,
    68  
    69      <LineGraph
    70        title="Log Commit Latency: 50th Percentile"
    71        sources={storeSources}
    72        tooltip={`The 50th %ile latency for commits to the Raft Log.
    73          This measures essentially an fdatasync to the storage engine's write-ahead log.`}
    74      >
    75        <Axis units={AxisUnits.Duration} label="latency">
    76          {
    77            _.map(nodeIDs, (nid) => (
    78              <Metric
    79                key={nid}
    80                name="cr.store.raft.process.logcommit.latency-p50"
    81                title={nodeDisplayName(nodesSummary, nid)}
    82                sources={storeIDsForNode(nodesSummary, nid)}
    83              />
    84            ))
    85          }
    86        </Axis>
    87      </LineGraph>,
    88  
    89      <LineGraph
    90        title="Command Commit Latency: 99th Percentile"
    91        sources={storeSources}
    92        tooltip={`The 99th %ile latency for commits of Raft commands.
    93          This measures applying a batch to the storage engine
    94          (including writes to the write-ahead log), but no fsync.`}
    95      >
    96        <Axis units={AxisUnits.Duration} label="latency">
    97          {
    98            _.map(nodeIDs, (nid) => (
    99              <Metric
   100                key={nid}
   101                name="cr.store.raft.process.commandcommit.latency-p99"
   102                title={nodeDisplayName(nodesSummary, nid)}
   103                sources={storeIDsForNode(nodesSummary, nid)}
   104              />
   105            ))
   106          }
   107        </Axis>
   108      </LineGraph>,
   109  
   110      <LineGraph
   111        title="Command Commit Latency: 50th Percentile"
   112        sources={storeSources}
   113        tooltip={`The 50th %ile latency for commits of Raft commands.
   114          This measures applying a batch to the storage engine
   115          (including writes to the write-ahead log), but no fsync.`}
   116      >
   117        <Axis units={AxisUnits.Duration} label="latency">
   118          {
   119            _.map(nodeIDs, (nid) => (
   120              <Metric
   121                key={nid}
   122                name="cr.store.raft.process.commandcommit.latency-p50"
   123                title={nodeDisplayName(nodesSummary, nid)}
   124                sources={storeIDsForNode(nodesSummary, nid)}
   125              />
   126            ))
   127          }
   128        </Axis>
   129      </LineGraph>,
   130  
   131      <LineGraph
   132        title="Read Amplification"
   133        sources={storeSources}
   134        tooltip={
   135          `The average number of real read operations executed per logical read operation ${tooltipSelection}.`
   136        }
   137      >
   138        <Axis label="factor">
   139          <Metric name="cr.store.rocksdb.read-amplification" title="Read Amplification" aggregateAvg />
   140        </Axis>
   141      </LineGraph>,
   142  
   143      <LineGraph
   144        title="SSTables"
   145        sources={storeSources}
   146        tooltip={`The number of SSTables in use ${tooltipSelection}.`}
   147      >
   148        <Axis label="sstables">
   149          <Metric name="cr.store.rocksdb.num-sstables" title="SSTables" />
   150        </Axis>
   151      </LineGraph>,
   152  
   153      <LineGraph
   154        title="File Descriptors"
   155        sources={nodeSources}
   156        tooltip={
   157          `The number of open file descriptors ${tooltipSelection}, compared with the
   158            file descriptor limit.`
   159        }
   160      >
   161        <Axis label="descriptors">
   162          <Metric name="cr.node.sys.fd.open" title="Open" />
   163          <Metric name="cr.node.sys.fd.softlimit" title="Limit" />
   164        </Axis>
   165      </LineGraph>,
   166  
   167      <LineGraph
   168        title="Compactions/Flushes"
   169        sources={storeSources}
   170        tooltip={
   171          `The number of compactions and memtable flushes per second ${tooltipSelection}.`
   172        }
   173      >
   174        <Axis label="count">
   175          <Metric name="cr.store.rocksdb.compactions" title="Compactions" nonNegativeRate />
   176          <Metric name="cr.store.rocksdb.flushes" title="Flushes" nonNegativeRate />
   177        </Axis>
   178      </LineGraph>,
   179  
   180      <LineGraph
   181        title="Time Series Writes"
   182        sources={nodeSources}
   183        tooltip={
   184          `The number of successfully written time series samples, and number of errors attempting
   185          to write time series, per second ${tooltipSelection}.`
   186        }
   187      >
   188        <Axis label="count">
   189          <Metric name="cr.node.timeseries.write.samples" title="Samples Written" nonNegativeRate />
   190          <Metric name="cr.node.timeseries.write.errors" title="Errors" nonNegativeRate />
   191        </Axis>
   192      </LineGraph>,
   193  
   194      <LineGraph
   195        title="Time Series Bytes Written"
   196        sources={nodeSources}
   197        tooltip={
   198          <div>
   199            The number of bytes written by the time series system per second {tooltipSelection}.
   200            <br />
   201            Note that this does not reflect the rate at which disk space is consumed by time series;
   202            the data is highly compressed on disk. This rate is instead intended to indicate the
   203            amount of network traffic and disk activity generated by time series writes.
   204            <br />
   205            See the "databases" tab to find the current disk usage for time series data.
   206          </div>
   207        }
   208      >
   209        <Axis units={AxisUnits.Bytes}>
   210          <Metric name="cr.node.timeseries.write.bytes" title="Bytes Written" nonNegativeRate />
   211        </Axis>
   212      </LineGraph>,
   213    ];
   214  }