@@ -1180,16 +1180,13 @@ describe('Meter', () => {
1180
1180
) ;
1181
1181
1182
1182
await meter . collect ( ) ;
1183
+ const records = meter . getBatcher ( ) . checkPointSet ( ) ;
1184
+ assert . strictEqual ( records . length , 8 ) ;
1183
1185
1184
- const tempMetricRecords : MetricRecord [ ] = await tempMetric . getMetricRecord ( ) ;
1185
- const cpuUsageMetricRecords : MetricRecord [ ] = await cpuUsageMetric . getMetricRecord ( ) ;
1186
- assert . strictEqual ( tempMetricRecords . length , 4 ) ;
1187
- assert . strictEqual ( cpuUsageMetricRecords . length , 4 ) ;
1188
-
1189
- const metric1 = tempMetricRecords [ 0 ] ;
1190
- const metric2 = tempMetricRecords [ 1 ] ;
1191
- const metric3 = tempMetricRecords [ 2 ] ;
1192
- const metric4 = tempMetricRecords [ 3 ] ;
1186
+ const metric1 = records [ 0 ] ;
1187
+ const metric2 = records [ 1 ] ;
1188
+ const metric3 = records [ 2 ] ;
1189
+ const metric4 = records [ 3 ] ;
1193
1190
assert . strictEqual ( hashLabels ( metric1 . labels ) , '|#app:app1,core:1' ) ;
1194
1191
assert . strictEqual ( hashLabels ( metric2 . labels ) , '|#app:app1,core:2' ) ;
1195
1192
assert . strictEqual ( hashLabels ( metric3 . labels ) , '|#app:app2,core:1' ) ;
@@ -1224,14 +1221,14 @@ describe('Meter', () => {
1224
1221
sum : 69 ,
1225
1222
} ) ;
1226
1223
1227
- const metric5 = cpuUsageMetricRecords [ 0 ] ;
1228
- const metric6 = cpuUsageMetricRecords [ 1 ] ;
1229
- const metric7 = cpuUsageMetricRecords [ 2 ] ;
1230
- const metric8 = cpuUsageMetricRecords [ 3 ] ;
1231
- assert . strictEqual ( hashLabels ( metric1 . labels ) , '|#app:app1,core:1' ) ;
1232
- assert . strictEqual ( hashLabels ( metric2 . labels ) , '|#app:app1,core:2' ) ;
1233
- assert . strictEqual ( hashLabels ( metric3 . labels ) , '|#app:app2,core:1' ) ;
1234
- assert . strictEqual ( hashLabels ( metric4 . labels ) , '|#app:app2,core:2' ) ;
1224
+ const metric5 = records [ 4 ] ;
1225
+ const metric6 = records [ 5 ] ;
1226
+ const metric7 = records [ 6 ] ;
1227
+ const metric8 = records [ 7 ] ;
1228
+ assert . strictEqual ( hashLabels ( metric5 . labels ) , '|#app:app1,core:1' ) ;
1229
+ assert . strictEqual ( hashLabels ( metric6 . labels ) , '|#app:app1,core:2' ) ;
1230
+ assert . strictEqual ( hashLabels ( metric7 . labels ) , '|#app:app2,core:1' ) ;
1231
+ assert . strictEqual ( hashLabels ( metric8 . labels ) , '|#app:app2,core:2' ) ;
1235
1232
1236
1233
ensureMetric ( metric5 , 'cpu_usage_per_app' , {
1237
1234
count : 1 ,
0 commit comments