@@ -1090,12 +1090,12 @@ function loadOtlpRuntimeMetricsTestModule (overrides = {}) {
10901090 createObservableUpDownCounter : makeFactory ( 'updowncounter' ) ,
10911091 createObservableCounter : makeFactory ( 'observable-counter' ) ,
10921092 createHistogram : makeFactory ( 'histogram' ) ,
1093- addBatchObservableCallback ( cb , observables ) {
1094- batchCallbacks . push ( { cb , observables } )
1093+ addBatchObservableCallback ( observeBatch , observables ) {
1094+ batchCallbacks . push ( { observeBatch , observables } )
10951095 } ,
1096- removeBatchObservableCallback ( cb ) {
1097- const idx = batchCallbacks . findIndex ( r => r . cb === cb )
1098- if ( idx !== - 1 ) batchCallbacks . splice ( idx , 1 )
1096+ removeBatchObservableCallback ( observeBatch ) {
1097+ const index = batchCallbacks . findIndex ( registration => registration . observeBatch === observeBatch )
1098+ if ( index !== - 1 ) batchCallbacks . splice ( index , 1 )
10991099 } ,
11001100 }
11011101
@@ -1129,9 +1129,9 @@ function loadOtlpRuntimeMetricsTestModule (overrides = {}) {
11291129
11301130 function fireBatchCallbacks ( ) {
11311131 const observed = new Map ( )
1132- for ( const { cb , observables } of batchCallbacks ) {
1132+ for ( const { observeBatch , observables } of batchCallbacks ) {
11331133 const allowed = new Set ( observables )
1134- cb ( {
1134+ observeBatch ( {
11351135 observe : ( instrument , value , attrs = { } ) => {
11361136 if ( ! allowed . has ( instrument ) ) return
11371137 if ( ! observed . has ( instrument ) ) observed . set ( instrument , [ ] )
0 commit comments