-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathMetrics.js
37 lines (34 loc) · 1.07 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
import React from "react";
import { ESPrefix } from "@/services/common";
import Metrics from "@/components/Overview/Detail/Metrics";
import MetricNodes from "@/components/Overview/Detail/Metrics/MetricNodes";
export default (props) => {
const indexName = props.data?._source?.metadata?.index_name;
const clusterID = props.data?._source?.metadata?.cluster_id;
const clusterName = props.data?._source?.metadata?.cluster_name;
if (!indexName || !clusterID) {
return null;
}
const overviews = [
{
key: 'nodes',
title: 'Nodes',
action: `${ESPrefix}/${clusterID}/index/${indexName}/nodes`,
component: MetricNodes
}
]
return (
<Metrics
metricAction={`${ESPrefix}/${clusterID}/index/${indexName}/metrics`}
params={{ clusterID, clusterName }}
linkMore={`/cluster/monitor/${clusterID}/indices/${indexName}?_g={"cluster_name":"${clusterName}"}`}
overviews={overviews}
metrics={[
"index_throughput",
"search_throughput",
"index_latency",
"search_latency",
]}
/>
)
};