File tree Expand file tree Collapse file tree 3 files changed +17
-37
lines changed
amazonqFeatureDev/controllers/chat
test/amazonqFeatureDev/controllers/chat Expand file tree Collapse file tree 3 files changed +17
-37
lines changed Original file line number Diff line number Diff line change @@ -788,24 +788,22 @@ export class FeatureDevController {
788
788
}
789
789
790
790
private async stopResponse ( message : any ) {
791
- await telemetry . amazonq_stopCodeGeneration . run ( async ( span ) => {
792
- span . record ( { tabID : message . tabID } )
793
- this . messenger . sendAnswer ( {
794
- message : i18n ( 'AWS.amazonq.featureDev.pillText.stoppingCodeGeneration' ) ,
795
- type : 'answer-part' ,
796
- tabID : message . tabID ,
797
- } )
798
- this . messenger . sendUpdatePlaceholder (
799
- message . tabID ,
800
- i18n ( 'AWS.amazonq.featureDev.pillText.stoppingCodeGeneration' )
801
- )
802
- this . messenger . sendChatInputEnabled ( message . tabID , false )
803
-
804
- const session = await this . sessionStorage . getSession ( message . tabID )
805
- if ( session . state ?. tokenSource ) {
806
- session . state ?. tokenSource ?. cancel ( )
807
- }
791
+ telemetry . ui_click . emit ( { elementId : 'amazonq_stopCodeGeneration' } )
792
+ this . messenger . sendAnswer ( {
793
+ message : i18n ( 'AWS.amazonq.featureDev.pillText.stoppingCodeGeneration' ) ,
794
+ type : 'answer-part' ,
795
+ tabID : message . tabID ,
808
796
} )
797
+ this . messenger . sendUpdatePlaceholder (
798
+ message . tabID ,
799
+ i18n ( 'AWS.amazonq.featureDev.pillText.stoppingCodeGeneration' )
800
+ )
801
+ this . messenger . sendChatInputEnabled ( message . tabID , false )
802
+
803
+ const session = await this . sessionStorage . getSession ( message . tabID )
804
+ if ( session . state ?. tokenSource ) {
805
+ session . state ?. tokenSource ?. cancel ( )
806
+ }
809
807
}
810
808
811
809
private async tabOpened ( message : any ) {
Original file line number Diff line number Diff line change 335
335
"name" : " amazonqMessageDisplayedMs" ,
336
336
"type" : " int" ,
337
337
"description" : " Duration between the partner teams code receiving the message and when the message was finally displayed in ms"
338
- },
339
- {
340
- "name" : " tabID" ,
341
- "type" : " string" ,
342
- "description" : " The unique identifier of a tab"
343
338
}
344
339
],
345
340
"metrics" : [
1191
1186
"required" : false
1192
1187
}
1193
1188
]
1194
- },
1195
- {
1196
- "name" : " amazonq_stopCodeGeneration" ,
1197
- "description" : " User stopped the code generation" ,
1198
- "metadata" : [
1199
- {
1200
- "type" : " tabID" ,
1201
- "required" : true
1202
- }
1203
- ]
1204
1189
}
1205
1190
]
1206
1191
}
Original file line number Diff line number Diff line change @@ -510,16 +510,13 @@ describe('Controller', () => {
510
510
} )
511
511
512
512
describe ( 'stopResponse' , ( ) => {
513
- it ( 'should emit amazonq_stopCodeGeneration telemetry' , async ( ) => {
513
+ it ( 'should emit ui_click telemetry with elementId amazonq_stopCodeGeneration ' , async ( ) => {
514
514
const getSessionStub = sinon . stub ( controllerSetup . sessionStorage , 'getSession' ) . resolves ( session )
515
515
controllerSetup . emitters . stopResponse . fire ( { tabID, conversationID } )
516
516
await waitUntil ( ( ) => {
517
517
return Promise . resolve ( getSessionStub . callCount > 0 )
518
518
} , { } )
519
- assertTelemetry ( 'amazonq_stopCodeGeneration' , {
520
- tabID : tabID ,
521
- result : 'Succeeded' ,
522
- } )
519
+ assertTelemetry ( 'ui_click' , { elementId : 'amazonq_stopCodeGeneration' } )
523
520
} )
524
521
} )
525
522
} )
You can’t perform that action at this time.
0 commit comments