Skip to content

Commit

Permalink
Count the number of regions deployed to
Browse files Browse the repository at this point in the history
  • Loading branch information
inlined committed Dec 14, 2021
1 parent f953698 commit 98be07d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/deploy/functions/release/reporter.ts
Expand Up @@ -59,8 +59,10 @@ export async function logAndTrackDeployStats(summary: Summary): Promise<void> {
let totalAborts = 0;
const reports: Array<Promise<void>> = [];

const regions = new Set<string>();
for (const result of summary.results) {
const tag = triggerTag(result.endpoint);
regions.add(result.endpoint.region);
totalTime += result.durationMs;
if (!result.error) {
totalSuccesses++;
Expand All @@ -74,6 +76,9 @@ export async function logAndTrackDeployStats(summary: Summary): Promise<void> {
}
}

const regionCountTag = regions.size < 5 ? regions.size.toString() : ">=5";
reports.push(track.track("functions_region_count", regionCountTag, 1));

const gcfv1 = summary.results.find((r) => r.endpoint.platform === "gcfv1");
const gcfv2 = summary.results.find((r) => r.endpoint.platform === "gcfv2");
const tag = gcfv1 && gcfv2 ? "v1+v2" : gcfv1 ? "v1" : "v2";
Expand Down

0 comments on commit 98be07d

Please sign in to comment.