1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-07-25 06:14:50 +02:00

chore(gh): tweak workflow

This commit is contained in:
syuilo
2026-07-22 10:15:19 +09:00
parent 98ae62c432
commit 7725110e1c
6 changed files with 109 additions and 126 deletions

View File

@@ -70,6 +70,7 @@ function renderMainTableForPhase(base: MemoryReport, head: MemoryReport, phase:
formatValue: formatKiBAsMb,
absoluteThreshold: memoryColorThresholdKiB,
})),
{ onlySignificantChanges: true },
);
}
@@ -138,7 +139,6 @@ export function renderMemoryReportMarkdown(base: MemoryReport, head: MemoryRepor
lines.push('');
}
lines.push(`_Values are median ± MAD (${base.samples.length} base / ${head.samples.length} head samples). Delta is Head - Base. Deltas are highlighted when their absolute value reaches the metric threshold and exceeds 3 × MAD._`);
lines.push('');
const nonConvergedSamples = countNonConvergedMemorySamples(base, head);

View File

@@ -6,9 +6,9 @@
| **HeapUsed** | 152 MB <br> ± 1 MB | 168 MB <br> ± 1 MB | $\color{orange}{\text{+16 MB}}$<br>$\color{orange}{\text{+10.5\\%}}$ | 1.4 MB |
| **PSS** | 202 MB <br> ± 1 MB | 218 MB <br> ± 1 MB | $\color{orange}{\text{+16 MB}}$<br>$\color{orange}{\text{+7.9\\%}}$ | 1.4 MB |
| **USS** | 184 MB <br> ± 1 MB | 200 MB <br> ± 1 MB | $\color{orange}{\text{+16 MB}}$<br>$\color{orange}{\text{+8.7\\%}}$ | 1.4 MB |
| **External** | 8.2 MB <br> ± 0.1 MB | 8.2 MB <br> ± 0.1 MB | 0 MB<br>0% | 0.1 MB |
_Values are median ± MAD (3 base / 3 head samples). Delta is Head - Base. Deltas are highlighted when their absolute value reaches the metric threshold and exceeds 3 × MAD._
<small><i>Only metrics showing significant changes are displayed.</i></small>
### V8 Heap Snapshot Statistics

View File

@@ -37,122 +37,102 @@ function renderBrowserSummaryTable(base: BrowserMetricsReport, head: BrowserMetr
return renderMetricComparisonTable(
base.samples,
head.samples,
[
{
label: '**Requests**',
getValue: sample => sample.network.requestCount,
formatValue: formatNumber,
absoluteThreshold: 1,
},
{
label: '**Encoded network**',
getValue: sample => sample.network.totalEncodedBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
},
{
label: '**Decoded body**',
getValue: sample => sample.network.totalDecodedBodyBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
},
{
label: '**Same-origin encoded**',
getValue: sample => sample.network.sameOriginEncodedBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
},
{
label: '**Third-party encoded**',
getValue: sample => sample.network.thirdPartyEncodedBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
},
{
label: '**Script encoded**',
getValue: sample => resourceTypeSampleBytes(sample, ['Script']),
formatValue: formatBytes,
absoluteThreshold: 10_000,
},
{
label: '**Stylesheet encoded**',
getValue: sample => resourceTypeSampleBytes(sample, ['Stylesheet']),
formatValue: formatBytes,
absoluteThreshold: 10_000,
},
{
label: '**Fetch/XHR encoded**',
getValue: sample => resourceTypeSampleBytes(sample, ['Fetch', 'XHR']),
formatValue: formatBytes,
absoluteThreshold: 10_000,
},
{
label: '**Image encoded**',
getValue: sample => resourceTypeSampleBytes(sample, ['Image']),
formatValue: formatBytes,
absoluteThreshold: 10_000,
},
{
label: '**Font encoded**',
getValue: sample => resourceTypeSampleBytes(sample, ['Font']),
formatValue: formatBytes,
absoluteThreshold: 10_000,
},
{
label: '**WebSocket connections**',
getValue: sample => sample.network.webSocketConnectionCount,
formatValue: formatNumber,
absoluteThreshold: 1,
},
{
label: '**WebSocket sent**',
getValue: sample => sample.network.webSocketSentBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
},
{
label: '**WebSocket received**',
getValue: sample => sample.network.webSocketReceivedBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
},
{
label: '**Page errors**',
getValue: sample => sample.diagnostics.pageErrorCount,
formatValue: formatNumber,
absoluteThreshold: 1,
},
{
label: '**Console log**',
getValue: sample => sample.diagnostics.console.log,
formatValue: formatNumber,
absoluteThreshold: 1,
},
{
label: '**Console warnings**',
getValue: sample => sample.diagnostics.console.warning,
formatValue: formatNumber,
absoluteThreshold: 1,
},
{
label: '**Console errors**',
getValue: sample => sample.diagnostics.console.error,
formatValue: formatNumber,
absoluteThreshold: 1,
},
{
label: '**Console info**',
getValue: sample => sample.diagnostics.console.info,
formatValue: formatNumber,
absoluteThreshold: 1,
},
{
label: '**Page-attributed memory**',
getValue: sample => sample.performance.tabMemory.totalBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
},
],
[{
label: '**Requests**',
getValue: sample => sample.network.requestCount,
formatValue: formatNumber,
absoluteThreshold: 1,
}, {
label: '**Encoded network**',
getValue: sample => sample.network.totalEncodedBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
}, {
label: '**Decoded body**',
getValue: sample => sample.network.totalDecodedBodyBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
}, {
label: '**Same-origin encoded**',
getValue: sample => sample.network.sameOriginEncodedBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
}, {
label: '**Third-party encoded**',
getValue: sample => sample.network.thirdPartyEncodedBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
}, {
label: '**Script encoded**',
getValue: sample => resourceTypeSampleBytes(sample, ['Script']),
formatValue: formatBytes,
absoluteThreshold: 10_000,
}, {
label: '**Stylesheet encoded**',
getValue: sample => resourceTypeSampleBytes(sample, ['Stylesheet']),
formatValue: formatBytes,
absoluteThreshold: 10_000,
}, {
label: '**Fetch/XHR encoded**',
getValue: sample => resourceTypeSampleBytes(sample, ['Fetch', 'XHR']),
formatValue: formatBytes,
absoluteThreshold: 10_000,
}, {
label: '**Image encoded**',
getValue: sample => resourceTypeSampleBytes(sample, ['Image']),
formatValue: formatBytes,
absoluteThreshold: 10_000,
}, {
label: '**Font encoded**',
getValue: sample => resourceTypeSampleBytes(sample, ['Font']),
formatValue: formatBytes,
absoluteThreshold: 10_000,
}, {
label: '**WebSocket connections**',
getValue: sample => sample.network.webSocketConnectionCount,
formatValue: formatNumber,
absoluteThreshold: 1,
}, {
label: '**WebSocket sent**',
getValue: sample => sample.network.webSocketSentBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
}, {
label: '**WebSocket received**',
getValue: sample => sample.network.webSocketReceivedBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
}, {
label: '**Page errors**',
getValue: sample => sample.diagnostics.pageErrorCount,
formatValue: formatNumber,
absoluteThreshold: 1,
}, {
label: '**Console log**',
getValue: sample => sample.diagnostics.console.log,
formatValue: formatNumber,
absoluteThreshold: 1,
}, {
label: '**Console warnings**',
getValue: sample => sample.diagnostics.console.warning,
formatValue: formatNumber,
absoluteThreshold: 1,
}, {
label: '**Console errors**',
getValue: sample => sample.diagnostics.console.error,
formatValue: formatNumber,
absoluteThreshold: 1,
}, {
label: '**Console info**',
getValue: sample => sample.diagnostics.console.info,
formatValue: formatNumber,
absoluteThreshold: 1,
}, {
label: '**Page-attributed memory**',
getValue: sample => sample.performance.tabMemory.totalBytes,
formatValue: formatBytes,
absoluteThreshold: 10_000,
}],
{ onlySignificantChanges: true },
);
}
@@ -224,8 +204,6 @@ export function renderFrontendDiagnosticsMarkdown(input: FrontendDiagnosticsMark
'',
renderBrowserSummaryTable(browser.base, browser.head),
'',
'<i>Only metrics showing significant changes are displayed.</i>',
'',
detailedHtmlUrl == null || detailedHtmlUrl === '' ? null : `[View details](${detailedHtmlUrl})`,
detailedHtmlUrl == null || detailedHtmlUrl === '' ? null : '',
'<details>',

View File

@@ -8,7 +8,7 @@
| **Script encoded** | 918 KB <br> ± 9 KB | 991 KB <br> ± 9.7 KB | $\color{orange}{\text{+73 KB}}$<br>$\color{orange}{\text{+8\\%}}$ | 13 KB |
| **Page-attributed memory** | 92 MB <br> ± 900 KB | 99 MB <br> ± 972 KB | $\color{orange}{\text{+7.3 MB}}$<br>$\color{orange}{\text{+8\\%}}$ | 1.3 MB |
<i>Only metrics showing significant changes are displayed.</i>
<small><i>Only metrics showing significant changes are displayed.</i></small>
[View details](https://example.invalid/html)

View File

@@ -60,21 +60,26 @@ export function renderMetricComparisonTable<T>(
options: MetricComparisonTableOptions = {},
): string {
const lines: string[] = [];
let omitted = false;
for (const row of rows) {
const summary = independentDeltaSummary(baseSamples, headSamples, row.getValue);
const significant = isSignificant(summary, row.absoluteThreshold);
if (options.onlySignificantChanges === true && !significant) continue;
if (options.onlySignificantChanges === true && !significant) {
omitted = true;
continue;
}
lines.push(`| ${row.label} | ${formatMedian(summary.baseMedian, summary.baseMad, row)} | ${formatMedian(summary.headMedian, summary.headMad, row)} | ${formatDelta(summary, row, significant)} | ${row.formatValue(summary.combinedMad)} |`);
if (row.separatorAfter === true) lines.push('| | | | | |');
}
if (lines.length === 0) return '**(No data)**';
if (lines.length === 0) return '**(No significant changes)**';
return [
'| Metric | @ Base | @ Head | Δ | MAD |',
'| --- | ---: | ---: | ---: | ---: |',
...lines,
...(omitted ? ['', '<small><i>Only metrics showing significant changes are displayed.</i></small>'] : []),
].join('\n');
}

View File

@@ -66,7 +66,7 @@ describe('renderMetricComparisonTable', () => {
expect(table).not.toContain('\\color{');
expect(renderMetricComparisonTable(base, head, [defaultRow], {
onlySignificantChanges: true,
})).toBe('**(No data)**');
})).toBe('**(No significant changes)**');
});
test('renders a no-data marker when no rows are configured', () => {
@@ -74,7 +74,7 @@ describe('renderMetricComparisonTable', () => {
samples(100, 100, 100),
samples(120, 120, 120),
[],
)).toBe('**(No data)**');
)).toBe('**(No significant changes)**');
});
test('treats the absolute threshold itself as significant', () => {