From d9273c0771fe9b17de17b0cb773141223b24af89 Mon Sep 17 00:00:00 2001 From: Yisheng Zhou Date: Tue, 10 Dec 2024 18:04:06 -0800 Subject: [PATCH] Address feedback comments --- .../sensor/kafka/BrokersetStateSensor.java | 6 ++++-- .../orion/core/kafka/BrokersetState.java | 10 ++++++++++ .../basic-components/Kafka/BrokersetEntry.js | 12 +++++++++++ .../src/basic-components/Kafka/Brokersets.js | 20 +++++++++---------- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/orion-server/src/main/java/com/pinterest/orion/core/automation/sensor/kafka/BrokersetStateSensor.java b/orion-server/src/main/java/com/pinterest/orion/core/automation/sensor/kafka/BrokersetStateSensor.java index 0684f046..91405941 100644 --- a/orion-server/src/main/java/com/pinterest/orion/core/automation/sensor/kafka/BrokersetStateSensor.java +++ b/orion-server/src/main/java/com/pinterest/orion/core/automation/sensor/kafka/BrokersetStateSensor.java @@ -83,9 +83,11 @@ public void sense(KafkaCluster cluster) throws Exception { updateBrokersetStateWithMetrics(cluster, brokersetState, brokerIds); } catch (Exception e) { logger.warning( - String.format("Failed to update brokerset state with metrics for brokerset %s in cluster %s.", + String.format( + "Failed to update brokerset state with metrics for brokerset %s in cluster %s. Error: %s", brokersetAlias, - cluster.getName())); + cluster.getName(), + e.getMessage())); } brokersetStateMap.put(brokersetAlias, brokersetState); if (invalidBrokerset) { diff --git a/orion-server/src/main/java/com/pinterest/orion/core/kafka/BrokersetState.java b/orion-server/src/main/java/com/pinterest/orion/core/kafka/BrokersetState.java index 7ca6b57b..99f8f36d 100644 --- a/orion-server/src/main/java/com/pinterest/orion/core/kafka/BrokersetState.java +++ b/orion-server/src/main/java/com/pinterest/orion/core/kafka/BrokersetState.java @@ -10,6 +10,10 @@ public class BrokersetState { * The brokersetAlias is the alias of the brokerset. */ private String brokersetAlias; + /** + * The instanceType is the type of the brokerset. + */ + private String instanceType; /** * The brokersetRanges are the ranges of brokerset that are in the brokerset. * The brokersetRanges are obtained from the brokerset configuration file. @@ -129,4 +133,10 @@ public void setBrokersetStatus(Map brokersetStatus) { public Map getBrokersetStatus() { return brokersetStatus; } + public void setInstanceType(String instanceType) { + this.instanceType = instanceType; + } + public String getInstanceType() { + return instanceType; + } } diff --git a/orion-server/src/main/resources/webapp/src/basic-components/Kafka/BrokersetEntry.js b/orion-server/src/main/resources/webapp/src/basic-components/Kafka/BrokersetEntry.js index 41f06b93..bffbd85a 100644 --- a/orion-server/src/main/resources/webapp/src/basic-components/Kafka/BrokersetEntry.js +++ b/orion-server/src/main/resources/webapp/src/basic-components/Kafka/BrokersetEntry.js @@ -117,6 +117,10 @@ function getBrokersetInfoHeader(rawData, clusterId) { let brokersetData = rawData.brokersetData; let brokersetAlias = brokersetData.brokersetAlias; let brokerCount = brokersetData.size; + let instanceType = "Unknown"; + if (brokersetData.instanceType !== undefined && brokersetData.instanceType !== null) { + instanceType = brokersetData.instanceType; + } return ( @@ -136,6 +140,14 @@ function getBrokersetInfoHeader(rawData, clusterId) { label={brokerCount + " brokers"} /> + + + ); diff --git a/orion-server/src/main/resources/webapp/src/basic-components/Kafka/Brokersets.js b/orion-server/src/main/resources/webapp/src/basic-components/Kafka/Brokersets.js index 72e26bec..3db6408e 100644 --- a/orion-server/src/main/resources/webapp/src/basic-components/Kafka/Brokersets.js +++ b/orion-server/src/main/resources/webapp/src/basic-components/Kafka/Brokersets.js @@ -43,23 +43,23 @@ export default function Brokersets(props) { let columns = [ { title: "Name", field: "brokersetAlias" }, { title: "Broker Count", field: "brokerCount" }, - { title: "Max CPU Usage", field: "maxCpuUsage" }, - { title: "Max Disk Usage", field: "maxDiskUsage" }, + { title: "Max CPU Usage 7D", field: "maxCpuUsage7Day" }, + { title: "Max Disk Usage 7D", field: "maxDiskUsage7Day" }, { title: "Updated Time", field: "timestamp" } ] let clusterId = props.cluster.clusterId; let brokersetToRowValuesMap = {}; for (let brokerset of brokersets) { let brokersetAlias = brokerset.brokersetAlias; - let maxCpuUsage = "N/A"; - let maxDiskUsage = "N/A"; + let maxCpuUsage7Day = "N/A"; + let maxDiskUsage7Day = "N/A"; let timestamp = "N/A" if (brokerset.brokersetStatus) { - if (brokerset.brokersetStatus["CPU_Usage_All_Brokers_Max"] !== undefined) { - maxCpuUsage = brokerset.brokersetStatus["CPU_Usage_All_Brokers_Max"]; + if (brokerset.brokersetStatus["CPU_Usage_Max_All_Brokers_7Days"] !== undefined) { + maxCpuUsage7Day = brokerset.brokersetStatus["CPU_Usage_Max_All_Brokers_7Days"]; } - if (brokerset.brokersetStatus["Disk_Usage_All_Brokers_Max"] !== undefined) { - maxDiskUsage = brokerset.brokersetStatus["Disk_Usage_All_Brokers_Max"]; + if (brokerset.brokersetStatus["Disk_Usage_Max_All_Brokers_7Days"] !== undefined) { + maxDiskUsage7Day = brokerset.brokersetStatus["Disk_Usage_Max_All_Brokers_7Days"]; } if (brokerset.brokersetStatus["Short_Timestamp"] !== undefined) { timestamp = brokerset.brokersetStatus["Short_Timestamp"]; @@ -70,8 +70,8 @@ export default function Brokersets(props) { "clusterId": clusterId, "brokerCount": brokerset.size, "brokersetData": brokerset, - "maxCpuUsage": maxCpuUsage, - "maxDiskUsage": maxDiskUsage, + "maxCpuUsage7Day": maxCpuUsage7Day, + "maxDiskUsage7Day": maxDiskUsage7Day, "timestamp": timestamp } }