You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/08/09 16:57:43 UTC

[GitHub] [incubator-eventmesh] RSTdefg opened a new pull request, #1135: [Issue #700]Dashboard: Display Eventmesh Metrics

RSTdefg opened a new pull request, #1135:
URL: https://github.com/apache/incubator-eventmesh/pull/1135

   ### Motivation
   
   Display Eventmesh HTTP and TCP metrics inside dashboard
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] codecov[bot] commented on pull request #1135: [Issue #700]Dashboard: Display Eventmesh Metrics

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #1135:
URL: https://github.com/apache/incubator-eventmesh/pull/1135#issuecomment-1209659395

   # [Codecov](https://codecov.io/gh/apache/incubator-eventmesh/pull/1135?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1135](https://codecov.io/gh/apache/incubator-eventmesh/pull/1135?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9df335e) into [dashboard](https://codecov.io/gh/apache/incubator-eventmesh/commit/9f7283f0c606c4242051c322eb76cb1459bf49b8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9f7283f) will **decrease** coverage by `0.12%`.
   > The diff coverage is `0.00%`.
   
   ```diff
   @@              Coverage Diff               @@
   ##             dashboard   #1135      +/-   ##
   ==============================================
   - Coverage         9.26%   9.14%   -0.13%     
   + Complexity         583     580       -3     
   ==============================================
     Files              361     363       +2     
     Lines            22944   23062     +118     
     Branches          2516    2516              
   ==============================================
   - Hits              2125    2108      -17     
   - Misses           20627   20759     +132     
   - Partials           192     195       +3     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-eventmesh/pull/1135?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...ime/admin/controller/EventMeshAdminController.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/1135/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2NvbnRyb2xsZXIvRXZlbnRNZXNoQWRtaW5Db250cm9sbGVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...ventmesh/runtime/admin/handler/MetricsHandler.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/1135/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL2hhbmRsZXIvTWV0cmljc0hhbmRsZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
   | [...esh/runtime/admin/response/GetMetricsResponse.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/1135/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2FkbWluL3Jlc3BvbnNlL0dldE1ldHJpY3NSZXNwb25zZS5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...ava/org/apache/eventmesh/common/utils/IPUtils.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/1135/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLWNvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZXZlbnRtZXNoL2NvbW1vbi91dGlscy9JUFV0aWxzLmphdmE=) | `33.33% <0.00%> (-6.49%)` | :arrow_down: |
   | [...g/apache/eventmesh/runtime/util/EventMeshUtil.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/1135/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL3V0aWwvRXZlbnRNZXNoVXRpbC5qYXZh) | `58.08% <0.00%> (-5.89%)` | :arrow_down: |
   | [...sh/client/grpc/consumer/EventMeshGrpcConsumer.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/1135/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXNkay1qYXZhL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ldmVudG1lc2gvY2xpZW50L2dycGMvY29uc3VtZXIvRXZlbnRNZXNoR3JwY0NvbnN1bWVyLmphdmE=) | `75.80% <0.00%> (-1.62%)` | :arrow_down: |
   | [...che/eventmesh/runtime/boot/AbstractHTTPServer.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/1135/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXJ1bnRpbWUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2V2ZW50bWVzaC9ydW50aW1lL2Jvb3QvQWJzdHJhY3RIVFRQU2VydmVyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   | [...sh/client/http/producer/EventMeshHttpProducer.java](https://codecov.io/gh/apache/incubator-eventmesh/pull/1135/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZXZlbnRtZXNoLXNkay1qYXZhL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9ldmVudG1lc2gvY2xpZW50L2h0dHAvcHJvZHVjZXIvRXZlbnRNZXNoSHR0cFByb2R1Y2VyLmphdmE=) | `0.00% <0.00%> (ø)` | |
   
   :mega: Codecov can now indicate which changes are the most critical in Pull Requests. [Learn more](https://about.codecov.io/product/feature/runtime-insights/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] xiaoyang-sde commented on a diff in pull request #1135: [Issue #700] Dashboard: Display Eventmesh Metrics

Posted by GitBox <gi...@apache.org>.
xiaoyang-sde commented on code in PR #1135:
URL: https://github.com/apache/incubator-eventmesh/pull/1135#discussion_r941941852


##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/response/GetMetricsResponse.java:
##########
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.runtime.admin.response;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+
+public class GetMetricsResponse {
+    //HTTP Metrics
+    public float maxHTTPTPS;
+    public float avgHTTPTPS;
+    public long maxHTTPCost;
+    public float avgHTTPCost;
+    public float avgHTTPBodyDecodeCost;
+    public long httpDiscard;
+    public float maxBatchSendMsgTPS;
+    public float avgBatchSendMsgTPS;
+    public long sendBatchMsgNumSum;
+    public long sendBatchMsgFailNumSum;
+    public float sendBatchMsgFailRate;
+    public long sendBatchMsgDiscardNumSum;
+    public float maxSendMsgTPS;
+    public float avgSendMsgTPS;
+    public long sendMsgNumSum;
+    public long sendMsgFailNumSum;
+    public float sendMsgFailRate;
+    public long replyMsgNumSum;
+    public long replyMsgFailNumSum;
+    public float maxPushMsgTPS;
+    public float avgPushMsgTPS;
+    public long pushHTTPMsgNumSum;
+    public long pushHTTPMsgFailNumSum;
+    public float pushHTTPMsgFailRate;
+    public float maxHTTPPushLatency;
+    public float avgHTTPPushLatency;
+    public int batchMsgQueueSize;
+    public int sendMsgQueueSize;
+    public int pushMsgQueueSize;
+    public int retryHTTPQueueSize;
+    public float avgBatchSendMsgCost;
+    public float avgSendMsgCost;
+    public float avgReplyMsgCost;
+
+    //TCP Metrics

Review Comment:
   ```suggestion
       // TCP Metrics
   ```



##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/response/GetMetricsResponse.java:
##########
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.runtime.admin.response;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+
+public class GetMetricsResponse {
+    //HTTP Metrics
+    public float maxHTTPTPS;
+    public float avgHTTPTPS;
+    public long maxHTTPCost;
+    public float avgHTTPCost;
+    public float avgHTTPBodyDecodeCost;
+    public long httpDiscard;
+    public float maxBatchSendMsgTPS;
+    public float avgBatchSendMsgTPS;
+    public long sendBatchMsgNumSum;
+    public long sendBatchMsgFailNumSum;
+    public float sendBatchMsgFailRate;
+    public long sendBatchMsgDiscardNumSum;
+    public float maxSendMsgTPS;
+    public float avgSendMsgTPS;
+    public long sendMsgNumSum;
+    public long sendMsgFailNumSum;
+    public float sendMsgFailRate;
+    public long replyMsgNumSum;
+    public long replyMsgFailNumSum;
+    public float maxPushMsgTPS;
+    public float avgPushMsgTPS;
+    public long pushHTTPMsgNumSum;
+    public long pushHTTPMsgFailNumSum;
+    public float pushHTTPMsgFailRate;
+    public float maxHTTPPushLatency;
+    public float avgHTTPPushLatency;
+    public int batchMsgQueueSize;
+    public int sendMsgQueueSize;
+    public int pushMsgQueueSize;
+    public int retryHTTPQueueSize;
+    public float avgBatchSendMsgCost;
+    public float avgSendMsgCost;
+    public float avgReplyMsgCost;
+
+    //TCP Metrics
+    public int retryTCPQueueSize;
+    public int client2eventMeshTCPTPS;
+    public int eventMesh2mqTCPTPS;
+    public int mq2eventMeshTCPTPS;
+    public int eventMesh2clientTCPTPS;
+    public int allTCPTPS;
+    public int allTCPConnections;
+    public int subTopicTCPNum;
+
+
+    @JsonCreator
+    public GetMetricsResponse(
+            //HTTP Metrics

Review Comment:
   ```suggestion
               // HTTP Metrics
   ```



##########
eventmesh-dashboard/pages/index.tsx:
##########
@@ -29,7 +30,8 @@ const Index: NextPage = () => (
     </Head>
     <Endpoint />
     <Configuration />
+    <Metrics />
   </>
 );
 
-export default Index;
+export default Index;

Review Comment:
   Please add a new line at the end of the file



##########
eventmesh-dashboard/components/index/Metrics.tsx:
##########
@@ -0,0 +1,298 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import {
+  Text,
+  Table,
+  TableContainer,
+  Tbody,
+  Th,
+  Thead,
+  Tr,
+  Td,
+  Box,
+} from '@chakra-ui/react';
+import axios from 'axios';
+import React, { useContext, useEffect, useState } from 'react';
+import { AppContext } from '../../context/context';
+
+interface EventMeshMetrics {
+    maxHTTPTPS: number,
+    avgHTTPTPS: number,
+    maxHTTPCost: number,
+    avgHTTPCost: number,
+    avgHTTPBodyDecodeCost: number,
+    httpDiscard: number,
+    maxBatchSendMsgTPS: number,
+    avgBatchSendMsgTPS: number,
+    sendBatchMsgNumSum: number,
+    sendBatchMsgFailNumSum: number,
+    sendBatchMsgFailRate: number,
+    sendBatchMsgDiscardNumSum: number,
+    maxSendMsgTPS: number,
+    avgSendMsgTPS: number,
+    sendMsgNumSum: number,
+    sendMsgFailNumSum: number,
+    sendMsgFailRate: number,
+    replyMsgNumSum: number,
+    replyMsgFailNumSum: number,
+    maxPushMsgTPS: number,
+    avgPushMsgTPS: number,
+    pushHTTPMsgNumSum: number,
+    pushHTTPMsgFailNumSum: number,
+    pushHTTPMsgFailRate: number,
+    maxHTTPPushLatency : number,
+    avgHTTPPushLatency : number,
+    batchMsgQueueSize : number,
+    sendMsgQueueSize  : number,
+    pushMsgQueueSize : number,
+    retryHTTPQueueSize : number,
+    avgBatchSendMsgCost : number,
+    avgSendMsgCost : number,
+    avgReplyMsgCost : number,
+
+  //TCP Metrics
+    retryTCPQueueSize: number,
+    client2eventMeshTCPTPS : number,
+    eventMesh2mqTCPTPS : number,
+    mq2eventMeshTCPTPS : number,
+    eventMesh2clientTCPTPS : number,
+    allTCPTPS : number,
+    allTCPConnections : number,
+    subTopicTCPNum : number
+}
+
+const Metrics = () => {
+  const { state } = useContext(AppContext);
+  const [configuration, setConfiguration] = useState<Partial<EventMeshMetrics>>({});
+
+  useEffect(() => {
+    const fetch = async () => {
+      try {
+        const { data } = await axios.get<EventMeshMetrics>(`${state.endpoint}/metrics`);
+        setConfiguration(data);
+      } catch (error) {
+        setConfiguration({});
+      }
+    };
+
+    fetch();
+  }, []);
+
+  type MetricRecord = Record<string, string | number | boolean | undefined>;

Review Comment:
   I think `string` and `boolean` are never used in this `Record` type?



##########
eventmesh-dashboard/components/index/Metrics.tsx:
##########
@@ -0,0 +1,298 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import {
+  Text,
+  Table,
+  TableContainer,
+  Tbody,
+  Th,
+  Thead,
+  Tr,
+  Td,
+  Box,
+} from '@chakra-ui/react';
+import axios from 'axios';
+import React, { useContext, useEffect, useState } from 'react';
+import { AppContext } from '../../context/context';
+
+interface EventMeshMetrics {
+    maxHTTPTPS: number,
+    avgHTTPTPS: number,
+    maxHTTPCost: number,
+    avgHTTPCost: number,
+    avgHTTPBodyDecodeCost: number,
+    httpDiscard: number,
+    maxBatchSendMsgTPS: number,
+    avgBatchSendMsgTPS: number,
+    sendBatchMsgNumSum: number,
+    sendBatchMsgFailNumSum: number,
+    sendBatchMsgFailRate: number,
+    sendBatchMsgDiscardNumSum: number,
+    maxSendMsgTPS: number,
+    avgSendMsgTPS: number,
+    sendMsgNumSum: number,
+    sendMsgFailNumSum: number,
+    sendMsgFailRate: number,
+    replyMsgNumSum: number,
+    replyMsgFailNumSum: number,
+    maxPushMsgTPS: number,
+    avgPushMsgTPS: number,
+    pushHTTPMsgNumSum: number,
+    pushHTTPMsgFailNumSum: number,
+    pushHTTPMsgFailRate: number,
+    maxHTTPPushLatency : number,
+    avgHTTPPushLatency : number,
+    batchMsgQueueSize : number,
+    sendMsgQueueSize  : number,
+    pushMsgQueueSize : number,
+    retryHTTPQueueSize : number,
+    avgBatchSendMsgCost : number,
+    avgSendMsgCost : number,
+    avgReplyMsgCost : number,
+
+  //TCP Metrics
+    retryTCPQueueSize: number,
+    client2eventMeshTCPTPS : number,
+    eventMesh2mqTCPTPS : number,
+    mq2eventMeshTCPTPS : number,
+    eventMesh2clientTCPTPS : number,
+    allTCPTPS : number,
+    allTCPConnections : number,
+    subTopicTCPNum : number
+}
+
+const Metrics = () => {
+  const { state } = useContext(AppContext);
+  const [configuration, setConfiguration] = useState<Partial<EventMeshMetrics>>({});

Review Comment:
   I think `metrics` and `setMetrics` might be a better name?



##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/response/GetMetricsResponse.java:
##########
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.runtime.admin.response;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+
+public class GetMetricsResponse {
+    //HTTP Metrics
+    public float maxHTTPTPS;
+    public float avgHTTPTPS;
+    public long maxHTTPCost;
+    public float avgHTTPCost;
+    public float avgHTTPBodyDecodeCost;
+    public long httpDiscard;
+    public float maxBatchSendMsgTPS;
+    public float avgBatchSendMsgTPS;
+    public long sendBatchMsgNumSum;
+    public long sendBatchMsgFailNumSum;
+    public float sendBatchMsgFailRate;
+    public long sendBatchMsgDiscardNumSum;
+    public float maxSendMsgTPS;
+    public float avgSendMsgTPS;
+    public long sendMsgNumSum;
+    public long sendMsgFailNumSum;
+    public float sendMsgFailRate;
+    public long replyMsgNumSum;
+    public long replyMsgFailNumSum;
+    public float maxPushMsgTPS;
+    public float avgPushMsgTPS;
+    public long pushHTTPMsgNumSum;
+    public long pushHTTPMsgFailNumSum;
+    public float pushHTTPMsgFailRate;
+    public float maxHTTPPushLatency;
+    public float avgHTTPPushLatency;
+    public int batchMsgQueueSize;
+    public int sendMsgQueueSize;
+    public int pushMsgQueueSize;
+    public int retryHTTPQueueSize;
+    public float avgBatchSendMsgCost;
+    public float avgSendMsgCost;
+    public float avgReplyMsgCost;
+
+    //TCP Metrics
+    public int retryTCPQueueSize;
+    public int client2eventMeshTCPTPS;
+    public int eventMesh2mqTCPTPS;
+    public int mq2eventMeshTCPTPS;
+    public int eventMesh2clientTCPTPS;
+    public int allTCPTPS;
+    public int allTCPConnections;
+    public int subTopicTCPNum;
+
+
+    @JsonCreator
+    public GetMetricsResponse(
+            //HTTP Metrics
+            @JsonProperty("maxHTTPTPS") float maxHTTPTPS,
+            @JsonProperty("avgHTTPTPS") float avgHTTPTPS,
+            @JsonProperty("maxHTTPCost") long maxHTTPCost,
+            @JsonProperty("avgHTTPCost") float avgHTTPCost,
+            @JsonProperty("avgHTTPBodyDecodeCost") float avgHTTPBodyDecodeCost,
+            @JsonProperty("httpDiscard") long httpDiscard,
+            @JsonProperty("maxBatchSendMsgTPS") float maxBatchSendMsgTPS,
+            @JsonProperty("avgBatchSendMsgTPS") float avgBatchSendMsgTPS,
+            @JsonProperty("sendBatchMsgNumSum") long sendBatchMsgNumSum,
+            @JsonProperty("sendBatchMsgFailNumSum") long sendBatchMsgFailNumSum,
+            @JsonProperty("sendBatchMsgFailRate") float sendBatchMsgFailRate,
+            @JsonProperty("sendBatchMsgDiscardNumSum") long sendBatchMsgDiscardNumSum,
+            @JsonProperty("maxSendMsgTPS") float maxSendMsgTPS,
+            @JsonProperty("avgSendMsgTPS") float avgSendMsgTPS,
+            @JsonProperty("sendMsgNumSum") long sendMsgNumSum,
+            @JsonProperty("sendMsgFailNumSum") long sendMsgFailNumSum,
+            @JsonProperty("sendMsgFailRate") float sendMsgFailRate,
+            @JsonProperty("replyMsgNumSum") long replyMsgNumSum,
+            @JsonProperty("replyMsgFailNumSum") long replyMsgFailNumSum,
+            @JsonProperty("maxPushMsgTPS") float maxPushMsgTPS,
+            @JsonProperty("avgPushMsgTPS") float avgPushMsgTPS,
+            @JsonProperty("pushHTTPMsgNumSum") long pushHTTPMsgNumSum,
+            @JsonProperty("pushHTTPMsgFailNumSum") long pushHTTPMsgFailNumSum,
+            @JsonProperty("pushHTTPMsgFailRate") float pushHTTPMsgFailRate,
+            @JsonProperty("maxHTTPPushLatency") float maxHTTPPushLatency,
+            @JsonProperty("avgHTTPPushLatency") float avgHTTPPushLatency,
+            @JsonProperty("batchMsgQueueSize") int batchMsgQueueSize,
+            @JsonProperty("sendMsgQueueSize") int sendMsgQueueSize,
+            @JsonProperty("pushMsgQueueSize") int pushMsgQueueSize,
+            @JsonProperty("retryHTTPQueueSize") int retryHTTPQueueSize,
+            @JsonProperty("avgBatchSendMsgCost") float avgBatchSendMsgCost,
+            @JsonProperty("avgSendMsgCost") float avgSendMsgCost,
+            @JsonProperty("avgReplyMsgCost") float avgReplyMsgCost,
+            //TCP Metrics

Review Comment:
   ```suggestion
               // TCP Metrics
   ```



##########
eventmesh-dashboard/components/index/Metrics.tsx:
##########
@@ -0,0 +1,298 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import {
+  Text,
+  Table,
+  TableContainer,
+  Tbody,
+  Th,
+  Thead,
+  Tr,
+  Td,
+  Box,
+} from '@chakra-ui/react';
+import axios from 'axios';
+import React, { useContext, useEffect, useState } from 'react';
+import { AppContext } from '../../context/context';
+
+interface EventMeshMetrics {
+    maxHTTPTPS: number,
+    avgHTTPTPS: number,
+    maxHTTPCost: number,
+    avgHTTPCost: number,
+    avgHTTPBodyDecodeCost: number,
+    httpDiscard: number,
+    maxBatchSendMsgTPS: number,
+    avgBatchSendMsgTPS: number,
+    sendBatchMsgNumSum: number,
+    sendBatchMsgFailNumSum: number,
+    sendBatchMsgFailRate: number,
+    sendBatchMsgDiscardNumSum: number,
+    maxSendMsgTPS: number,
+    avgSendMsgTPS: number,
+    sendMsgNumSum: number,
+    sendMsgFailNumSum: number,
+    sendMsgFailRate: number,
+    replyMsgNumSum: number,
+    replyMsgFailNumSum: number,
+    maxPushMsgTPS: number,
+    avgPushMsgTPS: number,
+    pushHTTPMsgNumSum: number,
+    pushHTTPMsgFailNumSum: number,
+    pushHTTPMsgFailRate: number,
+    maxHTTPPushLatency : number,
+    avgHTTPPushLatency : number,
+    batchMsgQueueSize : number,
+    sendMsgQueueSize  : number,
+    pushMsgQueueSize : number,
+    retryHTTPQueueSize : number,
+    avgBatchSendMsgCost : number,
+    avgSendMsgCost : number,
+    avgReplyMsgCost : number,
+
+  //TCP Metrics
+    retryTCPQueueSize: number,
+    client2eventMeshTCPTPS : number,
+    eventMesh2mqTCPTPS : number,
+    mq2eventMeshTCPTPS : number,
+    eventMesh2clientTCPTPS : number,
+    allTCPTPS : number,
+    allTCPConnections : number,
+    subTopicTCPNum : number
+}
+
+const Metrics = () => {
+  const { state } = useContext(AppContext);
+  const [configuration, setConfiguration] = useState<Partial<EventMeshMetrics>>({});
+
+  useEffect(() => {
+    const fetch = async () => {
+      try {
+        const { data } = await axios.get<EventMeshMetrics>(`${state.endpoint}/metrics`);
+        setConfiguration(data);
+      } catch (error) {
+        setConfiguration({});
+      }
+    };
+
+    fetch();
+  }, []);
+
+  type MetricRecord = Record<string, string | number | boolean | undefined>;
+  const httpMetrics: MetricRecord = {
+    'Max HTTP TPS': configuration.maxHTTPTPS,
+    'Avg HTTP TPS': configuration.avgHTTPTPS,
+    'Max HTTP Cost': configuration.maxHTTPCost,
+    'Avg HTTP Cost': configuration.avgHTTPCost,
+    'Avg HTTP Body Decode Cost': configuration.avgHTTPBodyDecodeCost,
+    'HTTP Discard': configuration.httpDiscard,
+  };
+  const batchMetrics: MetricRecord = {
+    'Max Batch Send Msg TPS': configuration.maxBatchSendMsgTPS,
+    'Avg Batch Send Msg TPS': configuration.avgBatchSendMsgTPS,
+    'Send Batch Msg Num Sum': configuration.sendBatchMsgNumSum,
+    'Send Batch Msg Fail Num Sum': configuration.sendBatchMsgFailNumSum,
+    'Send Batch Msg Fail Rate': configuration.sendBatchMsgFailRate,
+    'Send Batch Msg Discard Num Sum': configuration.sendBatchMsgDiscardNumSum,
+  };
+  const sendMetrics: MetricRecord = {
+    'Max Send Msg TPS': configuration.maxSendMsgTPS,
+    'Avg Send Msg TPS': configuration.avgSendMsgTPS,
+    'Send Msg Num Sum': configuration.sendMsgNumSum,
+    'Send Msg Fail Num Sum': configuration.sendMsgFailNumSum,
+    'Send Msg Fail Rate': configuration.sendMsgFailRate,
+    'Reply Msg Num Sum': configuration.replyMsgNumSum,
+    'Reply Msg Fail Num Sum': configuration.replyMsgFailNumSum,
+  };
+  const pushMetrics: MetricRecord = {
+    'Max Push Msg TPS': configuration.maxPushMsgTPS,
+    'Avg Push Msg TPS': configuration.avgPushMsgTPS,
+    'Push HTTP Msg Num Sum': configuration.pushHTTPMsgNumSum,
+    'Push HTTP Msg Fail Num Sum': configuration.pushHTTPMsgFailNumSum,
+    'Push HTTP Msg Fail Rate': configuration.pushHTTPMsgFailRate,
+    'Max HTTP Push Latency': configuration.maxHTTPPushLatency,
+    'Avg HTTP Push Latency': configuration.avgHTTPPushLatency,
+  };
+  const tcpMetrics: MetricRecord = {
+    'Retry TCP Queue Size': configuration.retryTCPQueueSize,
+    'Client2eventMesh TCP TPS': configuration.client2eventMeshTCPTPS,
+    'EventMesh2mq TCP TPS': configuration.eventMesh2mqTCPTPS,
+    'MQ2eventMesh TCP TPS': configuration.mq2eventMeshTCPTPS,
+    'EventMesh2client TCP TPS': configuration.eventMesh2clientTCPTPS,
+    'All TCP TPS': configuration.allTCPTPS,
+    'All TCP Connections': configuration.allTCPConnections,
+    'Sub Topic TCP Num': configuration.subTopicTCPNum,
+  };
+
+  const convertConfigurationToTable = (
+    metricRecord: Record<string, string | number | boolean | undefined>,
+  ) => Object.entries(metricRecord).map(([key, value]) => {
+    if (value === undefined) {
+      return (
+        <Tr>
+          <Td>{key}</Td>
+          <Td>Undefined</Td>
+        </Tr>
+      );
+    }
+
+    return (
+      <Tr>
+        <Td>{key}</Td>
+        <Td>{value.toString()}</Td>
+      </Tr>
+    );
+  });
+
+  if (Object.keys(configuration).length === 0) {
+    return false;
+  }
+
+  return (
+    <>
+      <Box
+        maxW="full"
+        bg="white"
+        borderWidth="1px"
+        borderRadius="md"
+        overflow="hidden"
+        p="4"
+        mt="4"
+      >
+        <Text
+          w="full"
+        >
+          EventMesh HTTP Metrics
+        </Text>
+
+        <TableContainer mt="4">
+          <Table variant="simple">
+            <Thead>
+              <Tr>
+                <Th>Metric</Th>
+                <Th>Value</Th>
+              </Tr>
+            </Thead>
+            <Tbody>
+              {convertConfigurationToTable(httpMetrics)}
+            </Tbody>
+          </Table>
+        </TableContainer>
+
+        <Text
+          w="full"
+          mt="4"
+        >
+          HTTP Batch Metrics
+        </Text>
+
+        <TableContainer mt="4">
+          <Table variant="simple">
+            <Thead>
+              <Tr>
+                <Th>Metric</Th>
+                <Th>Value</Th>
+              </Tr>
+            </Thead>
+            <Tbody>
+              {convertConfigurationToTable(batchMetrics)}
+            </Tbody>
+          </Table>
+        </TableContainer>
+
+        <Text
+          w="full"
+          mt="4"
+        >
+          HTTP Send Metrics
+        </Text>
+
+        <TableContainer mt="4">
+          <Table variant="simple">
+            <Thead>
+              <Tr>
+                <Th>Configuration Field</Th>

Review Comment:
   Metric Field?



##########
eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/response/GetMetricsResponse.java:
##########
@@ -0,0 +1,160 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.eventmesh.runtime.admin.response;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+
+public class GetMetricsResponse {
+    //HTTP Metrics

Review Comment:
   ```suggestion
       // HTTP Metrics
   ```



##########
eventmesh-dashboard/components/index/Metrics.tsx:
##########
@@ -0,0 +1,298 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import {
+  Text,
+  Table,
+  TableContainer,
+  Tbody,
+  Th,
+  Thead,
+  Tr,
+  Td,
+  Box,
+} from '@chakra-ui/react';
+import axios from 'axios';
+import React, { useContext, useEffect, useState } from 'react';
+import { AppContext } from '../../context/context';
+
+interface EventMeshMetrics {
+    maxHTTPTPS: number,
+    avgHTTPTPS: number,
+    maxHTTPCost: number,
+    avgHTTPCost: number,
+    avgHTTPBodyDecodeCost: number,
+    httpDiscard: number,
+    maxBatchSendMsgTPS: number,
+    avgBatchSendMsgTPS: number,
+    sendBatchMsgNumSum: number,
+    sendBatchMsgFailNumSum: number,
+    sendBatchMsgFailRate: number,
+    sendBatchMsgDiscardNumSum: number,
+    maxSendMsgTPS: number,
+    avgSendMsgTPS: number,
+    sendMsgNumSum: number,
+    sendMsgFailNumSum: number,
+    sendMsgFailRate: number,
+    replyMsgNumSum: number,
+    replyMsgFailNumSum: number,
+    maxPushMsgTPS: number,
+    avgPushMsgTPS: number,
+    pushHTTPMsgNumSum: number,
+    pushHTTPMsgFailNumSum: number,
+    pushHTTPMsgFailRate: number,
+    maxHTTPPushLatency : number,
+    avgHTTPPushLatency : number,
+    batchMsgQueueSize : number,
+    sendMsgQueueSize  : number,
+    pushMsgQueueSize : number,
+    retryHTTPQueueSize : number,
+    avgBatchSendMsgCost : number,
+    avgSendMsgCost : number,
+    avgReplyMsgCost : number,
+
+  //TCP Metrics

Review Comment:
   ```suggestion
      // TCP Metrics
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org


[GitHub] [incubator-eventmesh] xiaoyang-sde merged pull request #1135: [Issue #700] Dashboard: Display Eventmesh Metrics

Posted by GitBox <gi...@apache.org>.
xiaoyang-sde merged PR #1135:
URL: https://github.com/apache/incubator-eventmesh/pull/1135


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org