Skip to content

Commit

Permalink
Address feedback comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yisheng-zhou committed Dec 11, 2024
1 parent d6a0171 commit d9273c0
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -129,4 +133,10 @@ public void setBrokersetStatus(Map<String, String> brokersetStatus) {
public Map<String, String> getBrokersetStatus() {
return brokersetStatus;
}
public void setInstanceType(String instanceType) {
this.instanceType = instanceType;
}
public String getInstanceType() {
return instanceType;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Box my={2}>
<Grid container display="flex" alignItems="center" spacing={2}>
Expand All @@ -136,6 +140,14 @@ function getBrokersetInfoHeader(rawData, clusterId) {
label={brokerCount + " brokers"}
/>
</Grid>
<Grid item>
<Chip
variant="outlined"
color="primary"
size="small"
label={instanceType}
/>
</Grid>
</Grid>
</Box>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand All @@ -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
}
}
Expand Down

0 comments on commit d9273c0

Please sign in to comment.