@benchsdk/client 0.3.0 → 0.5.2

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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @benchsdk/client
2
2
 
3
+ > **Backwards-compatibility shim.** `@benchsdk/client` re-exports the full `@benchsdk/runner` surface and preserves the legacy `createBenchmarkClient().runWorker(options)` spelling. New projects should import from `@benchsdk/runner` for authoring/operator helpers or `@benchsdk/api` for raw REST types.
4
+
3
5
  Client and worker helpers for the ComputeSDK benchmark orchestrator.
4
6
 
5
7
  This package talks to the platform-owned benchmark/run/participant/worker API. It does not mint canonical run, worker, attempt, event, or task IDs. Workers claim platform-assigned work, execute task indexes in their assigned range, and send `task_results` batches back to the platform.
@@ -15,6 +17,12 @@ npm install @benchsdk/client
15
17
  > [`@benchsdk/runner`](../benchsdk-runner). This package is REST transport plus
16
18
  > the worker engine only.
17
19
 
20
+ ## Authentication
21
+
22
+ `createBenchmarkClient` requires a platform API key or OAuth token. Provide
23
+ `apiKey`/`token` directly, or set `BENCHMARKS_PLATFORM_API_KEY` or
24
+ `BENCHMARKS_PLATFORM_TOKEN` in the environment.
25
+
18
26
  ## Run A Worker
19
27
 
20
28
  ```ts
@@ -22,7 +30,7 @@ import { createBenchmarkClient } from '@benchsdk/client';
22
30
  import { compute } from 'computesdk';
23
31
 
24
32
  const client = createBenchmarkClient({
25
- apiKey: process.env.COMPUTESDK_ADMIN_API_KEY,
33
+ apiKey: process.env.BENCHMARKS_PLATFORM_API_KEY,
26
34
  });
27
35
 
28
36
  // `task` is a raw function; declare named steps imperatively via `step(...)`,
@@ -62,7 +70,7 @@ Task results are flushed to the platform in batches of 1,000 records by default.
62
70
  import { createBenchmarkClient } from '@benchsdk/client';
63
71
 
64
72
  const client = createBenchmarkClient({
65
- apiKey: process.env.COMPUTESDK_ADMIN_API_KEY,
73
+ apiKey: process.env.BENCHMARKS_PLATFORM_API_KEY,
66
74
  });
67
75
 
68
76
  await client.upsertBenchmark('scale', {
@@ -196,7 +204,7 @@ For coordinator health artifacts, sample system metrics:
196
204
 
197
205
  ```ts
198
206
  const metrics = createSystemMetricsCollector();
199
- const samples = [metrics.sample()];
207
+ const samples = [await metrics.sample()];
200
208
  metrics.stop();
201
209
  ```
202
210