Skip to content

Commit

Permalink
feat: coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ekremney committed Aug 26, 2024
1 parent e438136 commit a800628
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cwv/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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,
};
}
Expand Down

0 comments on commit a800628

Please sign in to comment.