From a800628bca04c5f6467df8283d06eb8f69a36189 Mon Sep 17 00:00:00 2001 From: ekremney Date: Mon, 26 Aug 2024 14:23:30 +0200 Subject: [PATCH] feat: coverage --- src/cwv/handler.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cwv/handler.js b/src/cwv/handler.js index 4913fd37..b7a64c62 100644 --- a/src/cwv/handler.js +++ b/src/cwv/handler.js @@ -14,6 +14,7 @@ import RUMAPIClient from '@adobe/spacecat-shared-rum-api-client'; import { getRUMDomainkey } from '../support/utils.js'; import { AuditBuilder } from '../common/audit-builder.js'; +const DAILY_THRESHOLD = 1000; const INTERVAL = 7; // days export async function CWVRunner(auditUrl, context, site) { @@ -26,8 +27,10 @@ export async function CWVRunner(auditUrl, context, site) { granularity: 'hourly', }; const cwvData = await rumAPIClient.query('cwv', options); + const auditResult = cwvData.filter((data) => data.pageviews >= DAILY_THRESHOLD * INTERVAL); + return { - auditResult: cwvData, + auditResult, fullAuditRef: auditUrl, }; }