All files / apps/developer-portal/layers/telemetry/app/components TelemetryRunsPanel.vue

100% Statements 9/9
100% Branches 4/4
100% Functions 2/2
100% Lines 8/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28  2x         32x             2x             2x   2x 2x 2x 14x    
<template>
    <WidgetPanel
        :title="$t('telemetryRunsPanel.title')"
        :meta="$t('telemetryRunsPanel.meta', { age })"
        to="/telemetry"
    >
        <div class="px-4 pt-5 pb-4">
            <DailyChart
                :days
                :values="runs"
                :unit="$t('telemetryRunsPanel.unit')"
                :end-label="$t('telemetryRunsPanel.endLabel')"
            />
        </div>
    </WidgetPanel>
</template>
 
<script setup lang="ts">
import { dailyTotals, scriptRows, shownDays } from "#layers/telemetry/shared/usageView.ts";
 
const { t } = useI18n();
 
const usage = usageArtifact();
const age = relativeTime(usage?.generatedAt, t);
const days = usage ? shownDays(usage) : [];
const runs = usage ? dailyTotals(scriptRows(usage)).map((day) => day.runs) : [];
</script>