File tree Expand file tree Collapse file tree
test/tests/unit/measurement Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,9 +80,11 @@ export class MetricsAgent {
8080 this . recordStats ( `gp.measurement.time.${ type } ` , time ) ;
8181 }
8282
83- recordMeasurement ( type : string ) : void {
83+ recordMeasurement ( type : string , probeCount : number ) : void {
8484 this . incrementCounter ( `gp.measurement.count.${ type } ` ) ;
8585 this . incrementCounter ( 'gp.measurement.count.total' ) ;
86+ this . incrementCounter ( `gp.test.count.${ type } ` , probeCount ) ;
87+ this . incrementCounter ( 'gp.test.count.total' , probeCount ) ;
8688 }
8789
8890 recordDisconnect ( type : string ) : void {
Original file line number Diff line number Diff line change @@ -37,12 +37,12 @@ export class MeasurementRunner {
3737
3838 if ( onlineProbesMap . size ) {
3939 this . sendToProbes ( measurementId , onlineProbesMap , request ) ;
40- // If all selected probes are offline, immediately mark measurement as finished
40+ // If all selected probes are offline, immediately mark the measurement as finished
4141 } else {
4242 await this . store . markFinished ( measurementId ) ;
4343 }
4444
45- this . metrics . recordMeasurement ( request . type ) ;
45+ this . metrics . recordMeasurement ( request . type , onlineProbesMap . size ) ;
4646
4747 return { measurementId, probesCount : allProbes . length } ;
4848 }
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ describe('MeasurementRunner', () => {
158158 } ] ) ;
159159
160160 expect ( metrics . recordMeasurement . callCount ) . to . equal ( 1 ) ;
161- expect ( metrics . recordMeasurement . args [ 0 ] ) . to . deep . equal ( [ 'ping' ] ) ;
161+ expect ( metrics . recordMeasurement . args [ 0 ] ) . to . deep . equal ( [ 'ping' , 4 ] ) ;
162162 } ) ;
163163
164164 it ( 'should send `inProgressUpdates: true` to the first N probes if requested' , async ( ) => {
@@ -258,7 +258,7 @@ describe('MeasurementRunner', () => {
258258 } ] ) ;
259259
260260 expect ( metrics . recordMeasurement . callCount ) . to . equal ( 1 ) ;
261- expect ( metrics . recordMeasurement . args [ 0 ] ) . to . deep . equal ( [ 'ping' ] ) ;
261+ expect ( metrics . recordMeasurement . args [ 0 ] ) . to . deep . equal ( [ 'ping' , 4 ] ) ;
262262 } ) ;
263263
264264 it ( 'should properly handle result events from probes' , async ( ) => {
You can’t perform that action at this time.
0 commit comments