mirror of
https://github.com/dromara/hertzbeat.git
synced 2026-09-17 09:40:58 +00:00
[bugfix](warehouse) add metrics data update logic in memory storage (#2973)
Co-authored-by: tomsun28 <tomsun28@outlook.com>
This commit is contained in:
+7
-1
@@ -72,7 +72,13 @@ public class MemoryDataStorage extends AbstractRealTimeDataStorage {
|
||||
if (metricsData.getCode() != CollectRep.Code.SUCCESS) {
|
||||
return;
|
||||
}
|
||||
Map<String, CollectRep.MetricsData> metricsDataMap = monitorMetricsDataMap.computeIfAbsent(monitorId, key -> new ConcurrentHashMap<>(METRICS_SIZE));
|
||||
Map<String, CollectRep.MetricsData> metricsDataMap =
|
||||
monitorMetricsDataMap.computeIfAbsent(monitorId, key -> new ConcurrentHashMap<>(METRICS_SIZE));
|
||||
|
||||
CollectRep.MetricsData oldMetricsData = metricsDataMap.get(metrics);
|
||||
if (oldMetricsData != null) {
|
||||
oldMetricsData.close();
|
||||
}
|
||||
metricsDataMap.put(metrics, metricsData);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user