@@ -716,13 +716,16 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
716716 // Individual project failures don't block others
717717 projectsCompleted . add ( project . projectUri . toString ( ) ) ; // Still mark as completed
718718 const cycle = ( project . resultResolver as Partial < PythonResultResolver > ) . discoveryTelemetry ?. complete ( ) ;
719- sendTelemetryEvent ( EventName . UNITTEST_DISCOVERY_DONE , undefined , {
719+ const measures : Record < string , number > = { } ;
720+ if ( cycle ?. stopWatch . elapsedTime !== undefined ) {
721+ measures . totalDurationMs = cycle . stopWatch . elapsedTime ;
722+ }
723+ sendTelemetryEvent ( EventName . UNITTEST_DISCOVERY_DONE , measures , {
720724 tool : project . testProvider ,
721725 failed : true ,
722726 mode : 'project' ,
723727 trigger : cycle ?. trigger ?? this . currentDiscoveryTrigger ,
724728 failureCategory : this . refreshCancellation . token . isCancellationRequested ? 'cancelled' : 'unknown' ,
725- totalDurationMs : cycle ?. stopWatch . elapsedTime ,
726729 } ) ;
727730 } finally {
728731 project . isDiscovering = false ;
@@ -1048,15 +1051,17 @@ export class PythonTestController implements ITestController, IExtensionSingleAc
10481051 failureCategory = token . isCancellationRequested ? 'cancelled' : 'unknown' ;
10491052 throw ex ;
10501053 } finally {
1051- sendTelemetryEvent ( EventName . UNITTEST_RUN_DONE , undefined , {
1052- tool : provider ,
1053- debugging,
1054- mode : 'legacy' ,
1055- failed,
1056- failureCategory,
1057- durationMs : stopWatch . elapsedTime ,
1058- requestedCount : testItems . length ,
1059- } ) ;
1054+ sendTelemetryEvent (
1055+ EventName . UNITTEST_RUN_DONE ,
1056+ { durationMs : stopWatch . elapsedTime , requestedCount : testItems . length } ,
1057+ {
1058+ tool : provider ,
1059+ debugging,
1060+ mode : 'legacy' ,
1061+ failed,
1062+ failureCategory,
1063+ } ,
1064+ ) ;
10601065 }
10611066 }
10621067
0 commit comments