@@ -442,7 +442,7 @@ export async function activate(context: vscode.ExtensionContext) {
442442 case "print" :
443443 console . log (
444444 `Process print statement output = ${
445- messageToWebview . data
445+ messageToWebview . data
446446 } `
447447 ) ;
448448 utils . logToOutputChannel (
@@ -644,7 +644,10 @@ export async function activate(context: vscode.ExtensionContext) {
644644 "pacifica.selectSerialPort" ,
645645 ( ) => {
646646 if ( serialMonitor ) {
647- serialMonitor . selectSerialPort ( null , null ) ;
647+ telemetryAI . runWithLatencyMeasure (
648+ ( ) => { serialMonitor . selectSerialPort ( null , null ) ; } ,
649+ TelemetryEventName . COMMAND_SERIAL_MONITOR_CHOOSE_PORT
650+ ) ;
648651 } else {
649652 vscode . window . showErrorMessage ( CONSTANTS . ERROR . NO_FOLDER_OPENED ) ;
650653 console . info ( "Serial monitor is not defined." ) ;
@@ -656,7 +659,10 @@ export async function activate(context: vscode.ExtensionContext) {
656659 "pacifica.openSerialMonitor" ,
657660 ( ) => {
658661 if ( serialMonitor ) {
659- serialMonitor . openSerialMonitor ( ) ;
662+ telemetryAI . runWithLatencyMeasure (
663+ serialMonitor . openSerialMonitor . bind ( serialMonitor ) ,
664+ TelemetryEventName . COMMAND_SERIAL_MONITOR_OPEN
665+ ) ;
660666 } else {
661667 vscode . window . showErrorMessage ( CONSTANTS . ERROR . NO_FOLDER_OPENED ) ;
662668 console . info ( "Serial monitor is not defined." ) ;
@@ -668,7 +674,10 @@ export async function activate(context: vscode.ExtensionContext) {
668674 "pacifica.changeBaudRate" ,
669675 ( ) => {
670676 if ( serialMonitor ) {
671- serialMonitor . changeBaudRate ( ) ;
677+ telemetryAI . runWithLatencyMeasure (
678+ serialMonitor . changeBaudRate . bind ( serialMonitor ) ,
679+ TelemetryEventName . COMMAND_SERIAL_MONITOR_BAUD_RATE
680+ ) ;
672681 } else {
673682 vscode . window . showErrorMessage ( CONSTANTS . ERROR . NO_FOLDER_OPENED ) ;
674683 console . info ( "Serial monitor is not defined." ) ;
@@ -680,7 +689,10 @@ export async function activate(context: vscode.ExtensionContext) {
680689 "pacifica.closeSerialMonitor" ,
681690 ( port , showWarning = true ) => {
682691 if ( serialMonitor ) {
683- serialMonitor . closeSerialMonitor ( port , showWarning ) ;
692+ telemetryAI . runWithLatencyMeasure (
693+ ( ) => { serialMonitor . closeSerialMonitor ( port , showWarning ) ; } ,
694+ TelemetryEventName . COMMAND_SERIAL_MONITOR_CLOSE
695+ )
684696 } else {
685697 vscode . window . showErrorMessage ( CONSTANTS . ERROR . NO_FOLDER_OPENED ) ;
686698 console . info ( "Serial monitor is not defined." ) ;
0 commit comments