From 900859854cfedb4a788227946e136566bdd26217 Mon Sep 17 00:00:00 2001 From: George Gevoian Date: Wed, 12 Apr 2023 10:58:43 -0400 Subject: [PATCH] (core) Convert site metric strings to ints Summary: Counts were being sent as strings to the Elasticsearch instance because the SQL queries were returning strings for the aggregate columns instead of integers. Test Plan: N/A Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D3859 --- app/gen-server/lib/Housekeeper.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/gen-server/lib/Housekeeper.ts b/app/gen-server/lib/Housekeeper.ts index b3e28713..1deaa6e5 100644 --- a/app/gen-server/lib/Housekeeper.ts +++ b/app/gen-server/lib/Housekeeper.ts @@ -165,9 +165,9 @@ export class Housekeeper { siteType: summary.site_type, inGoodStanding: summary.in_good_standing, stripePlanId: summary.stripe_plan_id, - numDocs: summary.num_docs, - numWorkspaces: summary.num_workspaces, - numMembers: summary.num_members, + numDocs: Number(summary.num_docs), + numWorkspaces: Number(summary.num_workspaces), + numMembers: Number(summary.num_members), lastActivity: summary.last_activity, }); } @@ -177,9 +177,9 @@ export class Housekeeper { telemetryManager?.logEvent('siteMembership', { siteId: summary.site_id, siteType: summary.site_type, - numOwners: summary.num_owners, - numEditors: summary.num_editors, - numViewers: summary.num_viewers, + numOwners: Number(summary.num_owners), + numEditors: Number(summary.num_editors), + numViewers: Number(summary.num_viewers), }); } });