Skip to content

Commit 12f994b

Browse files
authored
QA: Count QA execution minutes separately for now (#2011)
For now, keep QA exec time separate, as it may be scaled differently and currently still in beta.
1 parent 4ec7cf8 commit 12f994b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

backend/btrixcloud/orgs.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,15 +774,19 @@ async def inc_org_time_stats(
774774
If is_qa is true, also update seperate qa only counter
775775
"""
776776
# pylint: disable=too-many-return-statements, too-many-locals
777-
key = "crawlExecSeconds" if is_exec_time else "usage"
778777
yymm = dt_now().strftime("%Y-%m")
779-
inc_query = {f"{key}.{yymm}": duration}
780-
if is_qa:
778+
inc_query = {}
779+
780+
if not is_qa:
781+
key = "crawlExecSeconds" if is_exec_time else "usage"
782+
inc_query[f"{key}.{yymm}"] = duration
783+
else:
781784
qa_key = "qaCrawlExecSeconds" if is_exec_time else "qaUsage"
782785
inc_query[f"{qa_key}.{yymm}"] = duration
786+
783787
await self.orgs.find_one_and_update({"_id": oid}, {"$inc": inc_query})
784788

785-
if not is_exec_time:
789+
if not is_exec_time or is_qa:
786790
return
787791

788792
org = await self.get_org_by_id(oid)

0 commit comments

Comments
 (0)