Skip to content

Commit

Permalink
[type:fix] fix empty value not be handled by custom metrics (apache#2323
Browse files Browse the repository at this point in the history
)

Co-authored-by: tomsun28 <[email protected]>
  • Loading branch information
Aias00 and tomsun28 authored Jul 21, 2024
1 parent ee9bdf6 commit 43afb0b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ public void saveData(CollectRep.MetricsData metricsData) {
if (metricsData.getCode() != CollectRep.Code.SUCCESS) {
return;
}
if (metricsData.getValuesList().isEmpty()) {
log.debug("[warehouse memory] memory flush metrics data {} is null, ignore.", metricsData.getId());
return;
}
Map<String, CollectRep.MetricsData> metricsDataMap = monitorMetricsDataMap.computeIfAbsent(monitorId, key -> new ConcurrentHashMap<>(METRICS_SIZE));
metricsDataMap.put(metrics, metricsData);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ public void saveData(CollectRep.MetricsData metricsData) {
if (metricsData.getCode() != CollectRep.Code.SUCCESS || !isServerAvailable()) {
return;
}
if (metricsData.getValuesList().isEmpty()) {
log.info("[warehouse redis] redis flush metrics data {} - {} is null, ignore.", key, hashKey);
return;
}

RedisAsyncCommands<String, CollectRep.MetricsData> commands = connection.async();
commands.select(db);
commands.hset(key, hashKey, metricsData).thenAccept(response -> {
Expand Down

0 comments on commit 43afb0b

Please sign in to comment.