@benchsdk/client 0.3.0 → 0.4.0
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 +9 -3
- package/dist/index.cjs +15 -945
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -756
- package/dist/index.d.ts +7 -756
- package/dist/index.js +15 -929
- package/dist/index.js.map +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -15,6 +15,12 @@ npm install @benchsdk/client
|
|
|
15
15
|
> [`@benchsdk/runner`](../benchsdk-runner). This package is REST transport plus
|
|
16
16
|
> the worker engine only.
|
|
17
17
|
|
|
18
|
+
## Authentication
|
|
19
|
+
|
|
20
|
+
`createBenchmarkClient` requires a platform API key or OAuth token. Provide
|
|
21
|
+
`apiKey`/`token` directly, or set `BENCHMARKS_PLATFORM_API_KEY` or
|
|
22
|
+
`BENCHMARKS_PLATFORM_TOKEN` in the environment.
|
|
23
|
+
|
|
18
24
|
## Run A Worker
|
|
19
25
|
|
|
20
26
|
```ts
|
|
@@ -22,7 +28,7 @@ import { createBenchmarkClient } from '@benchsdk/client';
|
|
|
22
28
|
import { compute } from 'computesdk';
|
|
23
29
|
|
|
24
30
|
const client = createBenchmarkClient({
|
|
25
|
-
apiKey: process.env.
|
|
31
|
+
apiKey: process.env.BENCHMARKS_PLATFORM_API_KEY,
|
|
26
32
|
});
|
|
27
33
|
|
|
28
34
|
// `task` is a raw function; declare named steps imperatively via `step(...)`,
|
|
@@ -62,7 +68,7 @@ Task results are flushed to the platform in batches of 1,000 records by default.
|
|
|
62
68
|
import { createBenchmarkClient } from '@benchsdk/client';
|
|
63
69
|
|
|
64
70
|
const client = createBenchmarkClient({
|
|
65
|
-
apiKey: process.env.
|
|
71
|
+
apiKey: process.env.BENCHMARKS_PLATFORM_API_KEY,
|
|
66
72
|
});
|
|
67
73
|
|
|
68
74
|
await client.upsertBenchmark('scale', {
|
|
@@ -196,7 +202,7 @@ For coordinator health artifacts, sample system metrics:
|
|
|
196
202
|
|
|
197
203
|
```ts
|
|
198
204
|
const metrics = createSystemMetricsCollector();
|
|
199
|
-
const samples = [metrics.sample()];
|
|
205
|
+
const samples = [await metrics.sample()];
|
|
200
206
|
metrics.stop();
|
|
201
207
|
```
|
|
202
208
|
|