This repository was archived by the owner on Mar 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
packages/sfpowerscripts-cli/src/commands/metrics Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 "packages" : [
33 " packages/*"
44 ],
5+ "useWorkspaces" : true ,
56 "version" : " independent" ,
67 "command" : {
78 "publish" : {
Original file line number Diff line number Diff line change @@ -72,15 +72,15 @@ export default class Report extends SfpowerscriptsCommand {
7272 switch ( this . flags . type ) {
7373 case 'gauge' :
7474 SFPLogger . log ( COLOR_KEY_MESSAGE ( `Publishing Gauge Metric ${ this . flags . metric } with value ${ this . flags . value } ` ) ) ;
75- SFPStatsSender . logGauge ( this . flags . metric , this . flags . value , JSON . parse ( this . flags . tags ) ) ;
75+ SFPStatsSender . logGauge ( this . flags . metric , this . flags . value , this . flags . tags ? JSON . parse ( this . flags . tags ) : undefined ) ;
7676 break ;
7777 case 'counter' :
7878 SFPLogger . log ( COLOR_KEY_MESSAGE ( `Publishing Count Metric ${ this . flags . metric } with value ${ this . flags . value } ` ) ) ;
79- SFPStatsSender . logCount ( this . flags . metric , JSON . parse ( this . flags . tags ) ) ;
79+ SFPStatsSender . logCount ( this . flags . metric , this . flags . tags ? JSON . parse ( this . flags . tags ) : undefined ) ;
8080 break ;
8181 case 'timer' :
8282 SFPLogger . log ( COLOR_KEY_MESSAGE ( `Publishing Elapsed Metric ${ this . flags . metric } with value ${ this . flags . value } ` ) ) ;
83- SFPStatsSender . logElapsedTime ( this . flags . metric , Number . parseInt ( this . flags . value ) , JSON . parse ( this . flags . tags ) ) ;
83+ SFPStatsSender . logElapsedTime ( this . flags . metric , Number . parseInt ( this . flags . value ) , this . flags . tags ? JSON . parse ( this . flags . tags ) : undefined ) ;
8484 break ;
8585 default :
8686 throw new Error ( 'Invalid Metric Type' ) ;
You can’t perform that action at this time.
0 commit comments