@@ -122,10 +122,9 @@ func GetDebugCache(t controller.PrometheusCacheType) []byte {
122122 temp := map [string ]interface {}{
123123 "name_to_id" : make (map [string ]interface {}),
124124 }
125- tempCache .MetricName .nameToID .Range (func (key , value any ) bool {
126- temp ["name_to_id" ].(map [string ]interface {})[key .(string )] = value
127- return true
128- })
125+ for k , v := range tempCache .MetricName .GetNameToID () {
126+ temp ["name_to_id" ].(map [string ]interface {})[k ] = v
127+ }
129128 if len (temp ["name_to_id" ].(map [string ]interface {})) > 0 {
130129 content ["metric_name" ] = temp
131130 }
@@ -134,10 +133,9 @@ func GetDebugCache(t controller.PrometheusCacheType) []byte {
134133 temp := map [string ]interface {}{
135134 "name_to_id" : make (map [string ]interface {}),
136135 }
137- tempCache .LabelName .nameToID .Range (func (key , value any ) bool {
138- temp ["name_to_id" ].(map [string ]interface {})[key .(string )] = value
139- return true
140- })
136+ for k , v := range tempCache .LabelName .GetNameToID () {
137+ temp ["name_to_id" ].(map [string ]interface {})[k ] = v
138+ }
141139 if len (temp ["name_to_id" ].(map [string ]interface {})) > 0 {
142140 content ["label_name" ] = temp
143141 }
@@ -146,11 +144,9 @@ func GetDebugCache(t controller.PrometheusCacheType) []byte {
146144 temp := map [string ]interface {}{
147145 "value_to_id" : make (map [string ]interface {}),
148146 }
149- tempCache .LabelValue .GetValueToID ().Range (func (key string , value int ) bool {
150- temp ["value_to_id" ].(map [string ]interface {})[key ] = value
151- return true
152- })
153-
147+ for k , v := range tempCache .LabelValue .GetValueToID () {
148+ temp ["value_to_id" ].(map [string ]interface {})[k ] = v
149+ }
154150 if len (temp ["value_to_id" ].(map [string ]interface {})) > 0 {
155151 content ["label_value" ] = temp
156152 }
@@ -159,10 +155,9 @@ func GetDebugCache(t controller.PrometheusCacheType) []byte {
159155 temp := map [string ]interface {}{
160156 "layout_key_to_index" : make (map [string ]interface {}),
161157 }
162- tempCache .MetricAndAPPLabelLayout .layoutKeyToIndex .Range (func (key , value any ) bool {
163- temp ["layout_key_to_index" ].(map [string ]interface {})[marshal (key )] = value
164- return true
165- })
158+ for k , v := range tempCache .MetricAndAPPLabelLayout .GetLayoutKeyToIndex () {
159+ temp ["layout_key_to_index" ].(map [string ]interface {})[marshal (k )] = v
160+ }
166161 if len (temp ["layout_key_to_index" ].(map [string ]interface {})) > 0 {
167162 content ["metric_and_app_label_layout" ] = temp
168163 }
@@ -171,10 +166,9 @@ func GetDebugCache(t controller.PrometheusCacheType) []byte {
171166 temp := map [string ]interface {}{
172167 "key_to_id" : make (map [string ]interface {}),
173168 }
174- for iter := range tempCache .Label .keyToID . Iter () {
175- temp ["key_to_id" ].(map [string ]interface {})[iter . Key . String ()] = iter . Val
169+ for k , v := range tempCache .Label .GetKeyToID () {
170+ temp ["key_to_id" ].(map [string ]interface {})[k . String ()] = v
176171 }
177-
178172 if len (temp ["key_to_id" ].(map [string ]interface {})) > 0 {
179173 content ["label" ] = temp
180174 }
0 commit comments