From fc981f678b3c511a8e9e76b66cfb6cdf226ffb39 Mon Sep 17 00:00:00 2001 From: Qiuxia Fan Date: Sun, 13 Mar 2022 18:05:33 +0800 Subject: [PATCH] add service layout --- src/constants/templates.ts | 460 +++++++++++++++++++------------------ 1 file changed, 239 insertions(+), 221 deletions(-) diff --git a/src/constants/templates.ts b/src/constants/templates.ts index a7057af8..f2c5eee2 100644 --- a/src/constants/templates.ts +++ b/src/constants/templates.ts @@ -95,13 +95,11 @@ export const ServiceLayout = { h: 36, i: "0", type: "Tab", - widget: { - title: "Title", - }, + widget: {}, graph: {}, standard: {}, - metrics: [""], - metricTypes: [""], + metrics: [], + metricTypes: [], children: [ { name: "Overview", @@ -142,234 +140,254 @@ export const ServiceLayout = { }, graph: { type: "Card", + fontSize: 20, }, standard: { divide: "10000", }, }, + { + x: 16, + y: 0, + w: 8, + h: 12, + i: "2", + metrics: ["service_sla"], + metricTypes: ["readMetricsValue"], + type: "Widget", + widget: { + title: "Successful Rate", + tips: "Tooltip", + }, + graph: { + type: "Card", + fontSize: 20, + }, + standard: { + unit: "%", + divide: "100", + }, + }, + { + x: 0, + y: 12, + w: 8, + h: 12, + i: "3", + metrics: ["service_cpm"], + metricTypes: ["readMetricsValue"], + type: "Widget", + widget: { + title: "Service Load", + tips: "For HTTP 1/2, gRPC, RPC services, this means Calls Per Minute (CPM), for TCP services, this means Packets Per Minute (PPM)", + }, + graph: { + type: "Card", + fontSize: 20, + }, + standard: { + unit: "CPM / PPM", + divide: "100", + }, + }, + { + x: 8, + y: 12, + w: 8, + h: 12, + i: "4", + metrics: ["service_cpm"], + metricTypes: ["readMetricsValues"], + type: "Widget", + widget: { + title: "Service cpm", + tips: "For HTTP 1/2, gRPC, RPC services, this means Calls Per Minute (CPM), for TCP services, this means Packets Per Minute (PPM)", + }, + graph: { + type: "Line", + }, + standard: { + unit: "CPM / PPM", + divide: "100", + }, + }, + { + x: 16, + y: 12, + w: 8, + h: 12, + i: "5", + metrics: ["service_resp_time"], + metricTypes: ["readMetricsValues"], + type: "Widget", + widget: { + title: "Service Avg Response Time", + }, + graph: { + type: "Line", + }, + standard: { + unit: "ms", + }, + }, + { + x: 0, + y: 24, + w: 8, + h: 12, + i: "6", + metrics: ["service_apdex"], + metricTypes: ["readMetricsValues"], + type: "Widget", + widget: { + title: "Service Apdex", + }, + graph: { + type: "Line", + }, + standard: { + divide: "10000", + }, + }, + { + x: 8, + y: 24, + w: 8, + h: 12, + i: "7", + metrics: ["service_sla"], + metricTypes: ["readMetricsValues"], + type: "Widget", + widget: { + title: "Successful Rate", + }, + graph: { + type: "Line", + }, + standard: { + divide: "100", + }, + }, + { + x: 16, + y: 24, + w: 8, + h: 12, + i: "8", + metrics: [ + "service_throughput_received", + "service_throughput_sent", + ], + metricTypes: ["readMetricsValues", "readMetricsValues"], + type: "Widget", + widget: { + title: "Service Throughput", + }, + graph: { + type: "Line", + }, + standard: { + unit: "Bytes", + tips: "This metrics is only avaible for TCP services", + }, + }, + { + x: 0, + y: 36, + w: 8, + h: 12, + i: "9", + metrics: ["service_mq_consume_count"], + metricTypes: ["readMetricsValues"], + type: "Widget", + widget: { + title: "Message Queue Consuming Count", + }, + graph: { + type: "Line", + }, + standard: { + tips: "The number of consumed messages.", + }, + }, + { + x: 8, + y: 36, + w: 8, + h: 12, + i: "10", + metrics: ["service_mq_consume_latency"], + metricTypes: ["readMetricsValues"], + type: "Widget", + widget: { + title: "Message Queue Consuming Count", + }, + graph: { + type: "Line", + }, + standard: { + unit: "ms", + tips: "The avg latency of message consuming. Latency = timestamp(received) - timestamp(producing)", + }, + }, ], }, { name: "Trace", - children: [], + children: [ + { + x: 0, + y: 0, + w: 24, + h: 36, + i: "0", + metrics: [], + metricTypes: [], + type: "Trace", + widget: {}, + graph: {}, + standard: {}, + }, + ], + }, + { + name: "Profile", + children: [ + { + x: 0, + y: 0, + w: 24, + h: 36, + i: "0", + metrics: [], + metricTypes: [], + type: "Profile", + widget: {}, + graph: {}, + standard: {}, + }, + ], + }, + { + name: "Log", + children: [ + { + x: 0, + y: 0, + w: 24, + h: 36, + i: "0", + metrics: [], + metricTypes: [], + type: "Log", + widget: {}, + graph: {}, + standard: {}, + }, + ], }, ], }, ], }, }; - -// export const ServiceLayout = { -// id: "1", -// configuration: { -// name: "Service", -// isRoot: true, -// children: [ -// { -// w: 8, -// h: 12, -// i: "0", -// metrics: ["service_apdex"], -// metricTypes: ["readMetricsValue"], -// type: "Widget", -// widget: { -// title: "Service Apdex", -// tips: "Tooltip", -// }, -// graph: { -// type: "Card", -// }, -// standard: { -// aggregation: "/", -// aggregationNum: "10000", -// }, -// }, -// { -// w: 8, -// h: 12, -// i: "1", -// metrics: ["service_sla"], -// metricTypes: ["readMetricsValue"], -// type: "Widget", -// widget: { -// title: "Successful Rate", -// tips: "Tooltip", -// }, -// graph: { -// type: "Card", -// }, -// standard: { -// unit: "%", -// aggregation: "/", -// aggregationNum: "100", -// }, -// }, -// { -// w: 8, -// h: 12, -// i: "2", -// metrics: ["service_cpm"], -// metricTypes: ["readMetricsValue"], -// type: "Widget", -// widget: { -// title: "Service Load", -// tips: "For HTTP 1/2, gRPC, RPC services, this means Calls Per Minute (CPM), for TCP services, this means Packets Per Minute (PPM)", -// }, -// graph: { -// type: "Card", -// }, -// standard: { -// unit: "CPM / PPM", -// aggregation: "/", -// aggregationNum: "100", -// }, -// }, -// { -// w: 8, -// h: 12, -// i: "3", -// metrics: ["service_cpm"], -// metricTypes: ["readMetricsValues"], -// type: "Widget", -// widget: { -// title: "Service cpm", -// tips: "For HTTP 1/2, gRPC, RPC services, this means Calls Per Minute (CPM), for TCP services, this means Packets Per Minute (PPM)", -// }, -// graph: { -// type: "Card", -// }, -// standard: { -// unit: "CPM / PPM", -// aggregation: "/", -// aggregationNum: "100", -// }, -// }, -// { -// w: 8, -// h: 12, -// i: "4", -// metrics: ["service_resp_time"], -// metricTypes: ["readMetricsValues"], -// type: "Widget", -// widget: { -// title: "Service Avg Response Time", -// }, -// graph: { -// type: "Line", -// }, -// standard: { -// unit: "ms", -// }, -// }, -// { -// w: 8, -// h: 12, -// i: "5", -// metrics: ["service_apdex"], -// metricTypes: ["readMetricsValues"], -// type: "Widget", -// widget: { -// title: "Service Apdex", -// }, -// graph: { -// type: "Line", -// }, -// standard: { -// aggregation: "/", -// aggregationNum: "10000", -// }, -// }, -// { -// w: 8, -// h: 12, -// i: "6", -// metrics: ["service_percentile"], -// metricTypes: ["readLabeledMetricsValues"], -// type: "Widget", -// metricLabels: "P50, P75, P90, P95, P99", -// labelsIndex: "0, 1, 2, 3, 4", -// widget: { -// title: "Service Response Time Percentile", -// }, -// graph: { -// type: "Line", -// }, -// standard: { -// unit: "ms", -// }, -// }, -// { -// w: 8, -// h: 12, -// i: "7", -// metrics: ["service_sla"], -// metricTypes: ["readMetricsValues"], -// type: "Widget", -// widget: { -// title: "Successful Rate", -// }, -// graph: { -// type: "Line", -// }, -// standard: { -// unit: "%", -// aggregation: "/", -// aggregationNum: "100", -// }, -// }, -// { -// w: 8, -// h: 12, -// i: "8", -// metrics: ["service_throughput_received", "service_throughput_sent"], -// metricTypes: ["readMetricsValues", "readMetricsValues"], -// type: "Widget", -// widget: { -// title: "Service Throughput", -// }, -// graph: { -// type: "Line", -// }, -// standard: { -// unit: "Bytes", -// tips: "This metrics is only avaible for TCP services", -// }, -// }, -// { -// w: 8, -// h: 12, -// i: "9", -// metrics: ["service_mq_consume_count"], -// metricTypes: ["readMetricsValues"], -// type: "Widget", -// widget: { -// title: "Message Queue Consuming Count", -// }, -// graph: { -// type: "Line", -// }, -// standard: { -// tips: "The number of consumed messages.", -// }, -// }, -// { -// w: 8, -// h: 12, -// i: "10", -// metrics: ["service_mq_consume_latency"], -// metricTypes: ["readMetricsValues"], -// type: "Widget", -// widget: { -// title: "Message Queue Consuming Count", -// }, -// graph: { -// type: "Line", -// }, -// standard: { -// unit: "ms", -// tips: "The avg latency of message consuming. Latency = timestamp(received) - timestamp(producing)", -// }, -// }, -// ], -// }, -// };