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 {
788788 }
789789
790790 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 ,
808796 } )
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+ }
809807 }
810808
811809 private async tabOpened ( message : any ) {
Original file line number Diff line number Diff line change 335335 "name" : " amazonqMessageDisplayedMs" ,
336336 "type" : " int" ,
337337 "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"
343338 }
344339 ],
345340 "metrics" : [
11911186 "required" : false
11921187 }
11931188 ]
1194- },
1195- {
1196- "name" : " amazonq_stopCodeGeneration" ,
1197- "description" : " User stopped the code generation" ,
1198- "metadata" : [
1199- {
1200- "type" : " tabID" ,
1201- "required" : true
1202- }
1203- ]
12041189 }
12051190 ]
12061191}
Original file line number Diff line number Diff line change @@ -510,16 +510,13 @@ describe('Controller', () => {
510510 } )
511511
512512 describe ( 'stopResponse' , ( ) => {
513- it ( 'should emit amazonq_stopCodeGeneration telemetry' , async ( ) => {
513+ it ( 'should emit ui_click telemetry with elementId amazonq_stopCodeGeneration ' , async ( ) => {
514514 const getSessionStub = sinon . stub ( controllerSetup . sessionStorage , 'getSession' ) . resolves ( session )
515515 controllerSetup . emitters . stopResponse . fire ( { tabID, conversationID } )
516516 await waitUntil ( ( ) => {
517517 return Promise . resolve ( getSessionStub . callCount > 0 )
518518 } , { } )
519- assertTelemetry ( 'amazonq_stopCodeGeneration' , {
520- tabID : tabID ,
521- result : 'Succeeded' ,
522- } )
519+ assertTelemetry ( 'ui_click' , { elementId : 'amazonq_stopCodeGeneration' } )
523520 } )
524521 } )
525522} )
You can’t perform that action at this time.
0 commit comments