From b288cd81cc6c42256b692467f385617dcabcf2f4 Mon Sep 17 00:00:00 2001 From: Ilya Kreymer Date: Wed, 24 Jul 2024 09:14:15 -0700 Subject: [PATCH] fix execution minutes meter using wrong metric (#1967) The monthly execution minutes meter was using the wrong metric, `crawlExecSeconds` instead of `monthlyExecSeconds`. Since the meter is showing minutes used out of the monthly quota, it should be using `monthlyExecSeconds`. This is a quick fix, however, this system may need another pass at some point. --------- Co-authored-by: sua yoo --- frontend/src/pages/org/dashboard.ts | 4 ++-- frontend/src/types/org.ts | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/org/dashboard.ts b/frontend/src/pages/org/dashboard.ts index 81806ec4..6688dcb4 100644 --- a/frontend/src/pages/org/dashboard.ts +++ b/frontend/src/pages/org/dashboard.ts @@ -395,8 +395,8 @@ export class Dashboard extends LiteElement { } let usageSecondsAllTypes = 0; - if (this.org.crawlExecSeconds) { - const actualUsage = this.org.crawlExecSeconds[currentPeriod]; + if (this.org.monthlyExecSeconds) { + const actualUsage = this.org.monthlyExecSeconds[currentPeriod]; if (actualUsage) { usageSecondsAllTypes = actualUsage; } diff --git a/frontend/src/types/org.ts b/frontend/src/types/org.ts index 6defe7f2..1a7d3b48 100644 --- a/frontend/src/types/org.ts +++ b/frontend/src/types/org.ts @@ -39,7 +39,9 @@ export type OrgData = { bytesStoredUploads: number; bytesStoredProfiles: number; usage: { [key: YearMonth]: number } | null; + /* Actual total time used, including time to stop the crawl, gifted, and extra time */ crawlExecSeconds?: { [key: YearMonth]: number }; + /* Total time within the monthly time quota */ monthlyExecSeconds?: { [key: YearMonth]: number }; extraExecSeconds?: { [key: YearMonth]: number }; giftedExecSeconds?: { [key: YearMonth]: number };