From 50ea3828794380cb607a4a24017dee32756b689f Mon Sep 17 00:00:00 2001 From: Yongkoo Kang Date: Tue, 16 Apr 2024 10:19:32 -0700 Subject: [PATCH 1/2] Add scopes to PropertiesInstrumentationData --- .../PropertiesInstrumentationData.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/archaius2-core/src/main/java/com/netflix/archaius/instrumentation/PropertiesInstrumentationData.java b/archaius2-core/src/main/java/com/netflix/archaius/instrumentation/PropertiesInstrumentationData.java index 3717120a..d4242300 100644 --- a/archaius2-core/src/main/java/com/netflix/archaius/instrumentation/PropertiesInstrumentationData.java +++ b/archaius2-core/src/main/java/com/netflix/archaius/instrumentation/PropertiesInstrumentationData.java @@ -1,16 +1,28 @@ package com.netflix.archaius.instrumentation; +import java.util.HashMap; import java.util.Map; /** Instrumentation data snapshot for usages captured since the last flush. */ public class PropertiesInstrumentationData { private final Map idToUsageDataMap; + private final Map scopes; public PropertiesInstrumentationData(Map idToUsageDataMap) { this.idToUsageDataMap = idToUsageDataMap; + scopes = new HashMap<>(); + } + + public PropertiesInstrumentationData(Map idToUsageDataMap, Map scopes) { + this.idToUsageDataMap = idToUsageDataMap; + this.scopes = scopes; } public Map getIdToUsageDataMap() { return idToUsageDataMap; } + + public Map getScopes() { + return scopes; + } } From 25cb4e5b503790754bd873c8f65f9b1ec5ce7b90 Mon Sep 17 00:00:00 2001 From: Yongkoo Kang Date: Tue, 16 Apr 2024 10:24:12 -0700 Subject: [PATCH 2/2] Call constructor --- .../instrumentation/PropertiesInstrumentationData.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/archaius2-core/src/main/java/com/netflix/archaius/instrumentation/PropertiesInstrumentationData.java b/archaius2-core/src/main/java/com/netflix/archaius/instrumentation/PropertiesInstrumentationData.java index d4242300..c15098fa 100644 --- a/archaius2-core/src/main/java/com/netflix/archaius/instrumentation/PropertiesInstrumentationData.java +++ b/archaius2-core/src/main/java/com/netflix/archaius/instrumentation/PropertiesInstrumentationData.java @@ -9,8 +9,7 @@ public class PropertiesInstrumentationData { private final Map scopes; public PropertiesInstrumentationData(Map idToUsageDataMap) { - this.idToUsageDataMap = idToUsageDataMap; - scopes = new HashMap<>(); + this(idToUsageDataMap, new HashMap<>()); } public PropertiesInstrumentationData(Map idToUsageDataMap, Map scopes) {