@ornncompute/cli 1.0.305 → 1.0.306
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/vendor/capabilities/cli.js +23 -2
package/package.json
CHANGED
|
@@ -7703,11 +7703,32 @@ function getLatestTelemetry(request, body2, signal) {
|
|
|
7703
7703
|
signal
|
|
7704
7704
|
});
|
|
7705
7705
|
}
|
|
7706
|
-
function
|
|
7707
|
-
|
|
7706
|
+
async function queryTelemetry(request, path6, input, signal) {
|
|
7707
|
+
const read = (cursor2) => request(queryPath2(path6, { ...input, cursor: cursor2 }), {
|
|
7708
7708
|
method: "GET",
|
|
7709
7709
|
signal
|
|
7710
7710
|
});
|
|
7711
|
+
let cursor = 0;
|
|
7712
|
+
let page2 = await read(cursor);
|
|
7713
|
+
if (page2.next_cursor == null)
|
|
7714
|
+
return page2;
|
|
7715
|
+
const windows = [...page2.windows];
|
|
7716
|
+
let resolution = page2.windows.length ? page2.resolution_ms ?? 0 : 0;
|
|
7717
|
+
while (page2.next_cursor !== null) {
|
|
7718
|
+
const next = page2.next_cursor;
|
|
7719
|
+
if (next === void 0 || !Number.isInteger(next) || next <= cursor || next >= (input.max_points ?? 240)) {
|
|
7720
|
+
throw new Error("Invalid telemetry history cursor");
|
|
7721
|
+
}
|
|
7722
|
+
cursor = next;
|
|
7723
|
+
page2 = await read(cursor);
|
|
7724
|
+
windows.push(...page2.windows);
|
|
7725
|
+
if (page2.windows.length)
|
|
7726
|
+
resolution = Math.max(resolution, page2.resolution_ms ?? 0);
|
|
7727
|
+
}
|
|
7728
|
+
return { ...page2, resolution_ms: windows.length ? resolution : page2.resolution_ms, windows };
|
|
7729
|
+
}
|
|
7730
|
+
function queryNodeTelemetry(request, id, input, signal) {
|
|
7731
|
+
return queryTelemetry(request, `${nodePath(id)}/telemetry/query`, input, signal);
|
|
7711
7732
|
}
|
|
7712
7733
|
function queryNodeLogs(request, id, stream, input, signal) {
|
|
7713
7734
|
return request(queryPath2(`${nodePath(id)}/logs/${stream}/query`, input), {
|