global: snapshot

This commit is contained in:
nym21
2026-01-13 01:18:27 +01:00
parent 5ffb66c0dc
commit 670aa95494
35 changed files with 10804 additions and 6166 deletions

View File

@@ -40,6 +40,12 @@ function getAllMetrics(obj, path = "") {
return metrics;
}
// Endpoints with sparse data (holes at the end) - skip these
const SKIP_ENDPOINTS = new Set([
"distribution.addressesData.empty.by.emptyaddressindex",
"distribution.addressesData.loaded.by.loadedaddressindex",
]);
async function testAllEndpoints() {
const client = new BrkClient({ baseUrl: "http://localhost:3110", timeout: 15000 });
@@ -47,24 +53,31 @@ async function testAllEndpoints() {
console.log(`\nFound ${metrics.length} metrics`);
let success = 0;
let skipped = 0;
for (const { path, metric, indexes } of metrics) {
for (const idxName of indexes) {
const fullPath = `${path}.by.${idxName}`;
if (SKIP_ENDPOINTS.has(fullPath)) {
skipped++;
console.log(`SKIP: ${fullPath} -> sparse data`);
continue;
}
try {
const endpoint = metric.by[idxName];
const res = await endpoint.last(1);
const count = res.data.length;
if (count !== 1) {
console.log(
`FAIL: ${path}.by.${idxName} -> expected 1, got ${count}`,
`FAIL: ${fullPath} -> expected 1, got ${count}`,
);
return;
}
success++;
console.log(`OK: ${path}.by.${idxName} -> ${count} items`);
console.log(`OK: ${fullPath} -> ${count} items`);
} catch (e) {
console.log(
`FAIL: ${path}.by.${idxName} -> ${e instanceof Error ? e.message : e}`,
`FAIL: ${fullPath} -> ${e instanceof Error ? e.message : e}`,
);
return;
}
@@ -73,6 +86,7 @@ async function testAllEndpoints() {
console.log(`\n=== Results ===`);
console.log(`Success: ${success}`);
console.log(`Skipped: ${skipped}`);
}
testAllEndpoints();