@camstack/addon-benchmark 1.1.0 → 1.1.1

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/dist/index.mjs CHANGED
@@ -14595,7 +14595,12 @@ var DecoderPerfInputSchema = external_exports.object({
14595
14595
  warmupSec: external_exports.number().min(0).default(15),
14596
14596
  sampleIntervalMs: external_exports.number().min(500).default(2e3),
14597
14597
  hwaccel: DecoderPerfHwaccelSchema.default("none"),
14598
- thresholds: DecoderPerfThresholdsSchema.default({ warnMBMin: 5, failMBMin: 20 })
14598
+ thresholds: DecoderPerfThresholdsSchema.default({ warnMBMin: 5, failMBMin: 20 }),
14599
+ // Pin the decoder sessions to the selected node. createSession is the only
14600
+ // decoder call without a node selector (the rest route via the nodeId that
14601
+ // createSession returns), so without this the whole test runs on the
14602
+ // singleton's elected node (the hub) regardless of the UI selection.
14603
+ nodeId: external_exports.string().optional()
14599
14604
  });
14600
14605
  var DecoderPerfSampleSchema = external_exports.object({
14601
14606
  tSec: external_exports.number(),
@@ -14820,7 +14825,7 @@ import * as fs from "fs";
14820
14825
  import * as path from "path";
14821
14826
  import { performance } from "perf_hooks";
14822
14827
  import { cpuUsage, memoryUsage } from "process";
14823
- import { createEvent } from "@camstack/types";
14828
+ import { createEvent, nodePin } from "@camstack/types";
14824
14829
  var CHUNK_SIZE = 4096;
14825
14830
  function emitProgress(eventBus, payload) {
14826
14831
  if (!eventBus) return;
@@ -14870,13 +14875,17 @@ function readFixtureBytes(fixturesDir, filename) {
14870
14875
  }
14871
14876
  async function createSessions(api, input, codec2) {
14872
14877
  const handles = [];
14878
+ const pin = input.nodeId ? nodePin(input.nodeId) : void 0;
14873
14879
  for (let i = 0; i < input.cameras; i++) {
14874
- const created = await api.decoder.createSession.query({
14875
- codec: codec2,
14876
- maxFps: input.fps,
14877
- outputFormat: input.format === "gray" ? "gray" : "jpeg",
14878
- scale: 1
14879
- });
14880
+ const created = await api.decoder.createSession.query(
14881
+ {
14882
+ codec: codec2,
14883
+ maxFps: input.fps,
14884
+ outputFormat: input.format === "gray" ? "gray" : "jpeg",
14885
+ scale: 1
14886
+ },
14887
+ pin
14888
+ );
14880
14889
  handles.push({
14881
14890
  sessionId: created.sessionId,
14882
14891
  nodeId: created.nodeId,