Copilot commented on code in PR #3662:
URL: https://github.com/apache/hertzbeat/pull/3662#discussion_r2280741697
##########
hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/http/HttpCollectImpl.java:
##########
@@ -640,11 +640,13 @@ private void
parseResponseByPrometheusExporter(InputStream content, List<String>
.collect(Collectors.toMap(MetricFamily.Label::getName,
MetricFamily.Label::getValue));
CollectRep.ValueRow.Builder valueRowBuilder =
CollectRep.ValueRow.newBuilder();
for (String aliasField : aliasFields) {
- if ("value".equals(aliasField)) {
+ String columnValue = labelMap.get(aliasField);
Review Comment:
The `labelMap.get(aliasField)` call is performed for every field, even when
the field might be a value field. Consider checking if the field is a value
field first to avoid unnecessary map lookups.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]