@@ -45,15 +45,15 @@ describe("DefaultTelemetryClient", () => {
4545 command_path : "/agentcore" ,
4646 } ) ;
4747
48- await metricEvent . end ( 123 ) ;
48+ await metricEvent . emit ( 123 ) ;
4949
5050 // Start a second event with failure
5151 const metricEvent2 = client . startMetricEvent ( "cli.command_run" , {
5252 exit_reason : "failure" ,
5353 command_path : "/agentcore" ,
5454 } ) ;
5555
56- await metricEvent2 . end ( 456 ) ;
56+ await metricEvent2 . emit ( 456 ) ;
5757 await client . shutdown ( ) ;
5858
5959 expect ( fileSystemSink . getName ( ) ) . toBe ( "FileSystemSink" ) ;
@@ -139,14 +139,14 @@ describe("DefaultTelemetryClient", () => {
139139 command_path : "/agentcore" ,
140140 is_tui : true ,
141141 } ) ;
142- await enabledEvent . end ( 123 ) ;
142+ await enabledEvent . emit ( 123 ) ;
143143
144144 const disabledEvent = disabledClient . startMetricEvent ( "cli.command_run" , {
145145 exit_reason : "failure" ,
146146 command_path : "/agentcore" ,
147147 is_tui : false ,
148148 } ) ;
149- await disabledEvent . end ( 123 ) ;
149+ await disabledEvent . emit ( 123 ) ;
150150
151151 await Promise . all ( [ enabledClient . shutdown ( ) , disabledClient . shutdown ( ) ] ) ;
152152
@@ -181,7 +181,7 @@ describe("DefaultTelemetryClient", () => {
181181
182182 const metricEvent = client . startMetricEvent ( "cli.command_run" ) ;
183183
184- await expect ( metricEvent . end ( 100 ) ) . rejects . toThrow ( ) ;
184+ await expect ( metricEvent . emit ( 100 ) ) . rejects . toThrow ( ) ;
185185 await client . shutdown ( ) ;
186186 } ) ;
187187
@@ -202,7 +202,7 @@ describe("DefaultTelemetryClient", () => {
202202 exit_reason : "success" ,
203203 command_path : "/agentcore" ,
204204 } ) ;
205- await metricEvent . end ( 1 ) ;
205+ await metricEvent . emit ( 1 ) ;
206206 await client . shutdown ( ) ;
207207
208208 await assertLogsMatch ( tempDir , [
@@ -248,7 +248,7 @@ describe("DefaultTelemetryClient", () => {
248248 } ) ;
249249
250250 // end should not throw even though the sink's send() throws
251- await metricEvent . end ( 100 ) ;
251+ await metricEvent . emit ( 100 ) ;
252252 // shutdown should not throw even though the sink's shutdown() rejects
253253 await client . shutdown ( ) ;
254254
0 commit comments