File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
test/deploy/functions/release Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -59,8 +59,10 @@ export async function logAndTrackDeployStats(summary: Summary): Promise<void> {
59
59
let totalAborts = 0 ;
60
60
const reports : Array < Promise < void > > = [ ] ;
61
61
62
+ const regions = new Set < string > ( ) ;
62
63
for ( const result of summary . results ) {
63
64
const tag = triggerTag ( result . endpoint ) ;
65
+ regions . add ( result . endpoint . region ) ;
64
66
totalTime += result . durationMs ;
65
67
if ( ! result . error ) {
66
68
totalSuccesses ++ ;
@@ -74,6 +76,9 @@ export async function logAndTrackDeployStats(summary: Summary): Promise<void> {
74
76
}
75
77
}
76
78
79
+ const regionCountTag = regions . size < 5 ? regions . size . toString ( ) : ">=5" ;
80
+ reports . push ( track . track ( "functions_region_count" , regionCountTag , 1 ) ) ;
81
+
77
82
const gcfv1 = summary . results . find ( ( r ) => r . endpoint . platform === "gcfv1" ) ;
78
83
const gcfv2 = summary . results . find ( ( r ) => r . endpoint . platform === "gcfv2" ) ;
79
84
const tag = gcfv1 && gcfv2 ? "v1+v2" : gcfv1 ? "v1" : "v2" ;
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ describe("reporter", () => {
132
132
133
133
await reporter . logAndTrackDeployStats ( summary ) ;
134
134
135
+ expect ( trackStub ) . to . have . been . calledWith ( "functions_region_count" , "1" , 1 ) ;
135
136
expect ( trackStub ) . to . have . been . calledWith ( "function_deploy_success" , "v1.https" , 2_000 ) ;
136
137
expect ( trackStub ) . to . have . been . calledWith ( "function_deploy_failure" , "v1.https" , 1_000 ) ;
137
138
// Aborts aren't tracked because they would throw off timing metrics
You can’t perform that action at this time.
0 commit comments