ydb-embedded-ui 4.31.0 → 4.31.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -15,6 +15,8 @@ docker pull cr.yandex/yc/yandex-docker-local-ydb
15
15
  docker run -dp 8765:8765 cr.yandex/yc/yandex-docker-local-ydb
16
16
  ```
17
17
 
18
+ Open http://localhost:8765 to view it in the browser.
19
+
18
20
  ## Development
19
21
 
20
22
  1. Run on a machine with Docker installed:
@@ -8,12 +8,13 @@ export const convertResponse = (
8
8
  const preparedMetrics = data
9
9
  .map(({datapoints, target}) => {
10
10
  const metricDescription = metrics.find((metric) => metric.target === target);
11
- const chartData = datapoints.map((datapoint) => datapoint[0] || 0);
12
11
 
13
12
  if (!metricDescription) {
14
13
  return undefined;
15
14
  }
16
15
 
16
+ const chartData = datapoints.map((datapoint) => datapoint[0]);
17
+
17
18
  return {
18
19
  ...metricDescription,
19
20
  data: chartData,
@@ -1,4 +1,5 @@
1
1
  import {formatBytes} from '../../utils/bytesParsers';
2
+ import {EMPTY_DATA_PLACEHOLDER} from '../../utils/constants';
2
3
  import {roundToPrecision} from '../../utils/dataFormatters/dataFormatters';
3
4
  import {formatToMs} from '../../utils/timeParsers';
4
5
  import {isNumeric} from '../../utils/utils';
@@ -18,11 +19,19 @@ export const getDefaultDataFormatter = (dataType?: ChartDataType) => {
18
19
  }
19
20
  };
20
21
 
22
+ // Values in y axis won't be null and will always be present and properly formatted
23
+ // EMPTY_DATA_PLACEHOLDER is actually empty data format for values in a tooltip
21
24
  function formatChartValueToMs(value: ChartValue) {
25
+ if (value === null) {
26
+ return EMPTY_DATA_PLACEHOLDER;
27
+ }
22
28
  return formatToMs(roundToPrecision(convertToNumber(value), 2));
23
29
  }
24
30
 
25
31
  function formatChartValueToSize(value: ChartValue) {
32
+ if (value === null) {
33
+ return EMPTY_DATA_PLACEHOLDER;
34
+ }
26
35
  return formatBytes({value: convertToNumber(value), precision: 3});
27
36
  }
28
37
 
@@ -15,7 +15,7 @@ export interface MetricDescription {
15
15
  }
16
16
 
17
17
  export interface PreparedMetric extends MetricDescription {
18
- data: number[];
18
+ data: (number | null)[];
19
19
  }
20
20
 
21
21
  export interface PreparedMetricsData {
@@ -71,6 +71,8 @@ export const COLORS_PRIORITY = {
71
71
 
72
72
  export const TENANT_OVERVIEW_TABLES_LIMIT = 5;
73
73
 
74
+ export const EMPTY_DATA_PLACEHOLDER = '—';
75
+
74
76
  // ==== Titles ====
75
77
  export const DEVELOPER_UI_TITLE = 'Developer UI';
76
78
  export const CLUSTER_DEFAULT_TITLE = 'Cluster';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-embedded-ui",
3
- "version": "4.31.0",
3
+ "version": "4.31.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],