-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMetrics.js
40 lines (37 loc) · 1.17 KB
/
Metrics.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React from "react";
import { ESPrefix } from "@/services/common";
import Metrics from "@/components/Overview/Detail/Metrics";
import MetricIndices from "@/components/Overview/Detail/Metrics/MetricIndices";
export default (props) => {
const nodeID = props.data?._source?.metadata?.node_id;
const clusterID = props.data?._source?.metadata?.cluster_id;
const clusterName = props.data?._source?.metadata?.cluster_name;
const nodeName = props.data?._source?.metadata?.node_name;
if (!nodeID || !clusterID) {
return null;
}
const overviews = [
{
key: "indices",
title: "Indices",
action: `${ESPrefix}/${clusterID}/node/${nodeID}/indices`,
component: MetricIndices,
},
];
return (
<Metrics
metricAction={`${ESPrefix}/${clusterID}/node/${nodeID}/metrics`}
params={{ clusterID, clusterName }}
linkMore={`/cluster/monitor/${clusterID}/nodes/${nodeID}?_g={"cluster_name":"${clusterName}","node_name":"${nodeName}"}`}
overviews={overviews}
metrics={[
"cpu",
"jvm",
"index_throughput",
"search_throughput",
"index_latency",
"search_latency",
]}
/>
);
};