@synapticon/motion-master-client 6.0.0-alpha.35 → 6.0.0-alpha.36

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.
@@ -1,4 +1,4 @@
1
- import { AlStatusCode, DcSyncStatus, DeviceDiagnostics, DeviceParameter, EscRegister, FoeErrorCode, Monitoring, ObjectDataTypeInfo, OutputStageResult, ParameterCacheEntry, PdoMapping, PdoMappingRequest, ProcessDataWatchdog, ProcessImageObject, SlaveConfig, SlaveInformationInterface } from "./data-contracts.js";
1
+ import { AlStatusCode, DcSyncStatus, DeviceDiagnostics, DeviceParameter, EscRegister, FoeErrorCode, GameLoopHealth, Monitoring, ObjectDataTypeInfo, OutputStageResult, ParameterCacheEntry, PdoMapping, PdoMappingRequest, ProcessDataWatchdog, ProcessImageObject, SlaveConfig, SlaveInformationInterface } from "./data-contracts.js";
2
2
  import { HttpClient, RequestParams } from "./http-client.js";
3
3
  export declare class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
4
4
  /**
@@ -32,7 +32,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
32
32
  version: string;
33
33
  }, any>>;
34
34
  /**
35
- * @description The effective configuration after merging the JSONC config file (if any) over the built-in defaults — the same `Config` the server booted with. Read-only; changing it requires editing the config file and restarting. The shape mirrors the config file (server, fieldbus, logLevel, tls, gameLoop, recorder).
35
+ * @description The effective configuration after merging the JSONC config file (if any) over the built-in defaults — the same `Config` the server booted with. Read-only; changing it requires editing the config file and restarting. The shape mirrors the config file (server, fieldbus, logLevel, tls, gameLoop, recorder, parameterCache, parameters).
36
36
  *
37
37
  * @name GetStartedConfig
38
38
  * @summary Get the configuration Motion Master was started with
@@ -923,6 +923,14 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
923
923
  /** Input-mapped objects (TxPDO), in image order */
924
924
  inputs: ProcessImageObject[];
925
925
  }, any>>;
926
+ /**
927
+ * @description Returns a point-in-time snapshot of the RT cyclic loop: the configured period and target rate, the cumulative achieved rate since start, the executed- and skipped-cycle counters, per-cycle task-execution timing (last / worst / mean), and whether real-time scheduling was acquired. Skipped cycles accumulate whenever the loop cannot meet its period (common on non-RT hosts such as Windows userspace) — a steadily rising `skippedCycles`, or an `achievedHz` well below `targetHz`, means the configured period is too aggressive for the hardware. Poll this endpoint and diff `executedCycles`/`skippedCycles` against `timestampUs` to chart the instantaneous rate over time.
928
+ *
929
+ * @name GetGameLoop
930
+ * @summary Inspect real-time game-loop health
931
+ * @request GET:/api/game-loop
932
+ */
933
+ getGameLoop: (params?: RequestParams) => Promise<import("./http-client.js").HttpResponse<GameLoopHealth, any>>;
926
934
  /**
927
935
  * @description Streams the same `.mmpd` serialisation as the POST variant (the recorder's current span, with the process image embedded as a header) directly in the response body instead of writing a file — for the client SDK / browser, which parses the bytes offline. Request with `Accept: application/octet-stream`. Same span semantics as the POST; works in any state.
928
936
  *
@@ -991,7 +999,7 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
991
999
  */
992
1000
  createMonitoring: (data: {
993
1001
  /**
994
- * URL-safe unique id; also the WebSocket topic. The name `pdos` is reserved.
1002
+ * URL-safe unique id; also the WebSocket topic.
995
1003
  * @pattern ^[A-Za-z0-9._-]{1,64}$
996
1004
  * @example "left-leg"
997
1005
  */
@@ -38,7 +38,7 @@ export class Api extends HttpClient {
38
38
  ...params,
39
39
  });
40
40
  /**
41
- * @description The effective configuration after merging the JSONC config file (if any) over the built-in defaults — the same `Config` the server booted with. Read-only; changing it requires editing the config file and restarting. The shape mirrors the config file (server, fieldbus, logLevel, tls, gameLoop, recorder).
41
+ * @description The effective configuration after merging the JSONC config file (if any) over the built-in defaults — the same `Config` the server booted with. Read-only; changing it requires editing the config file and restarting. The shape mirrors the config file (server, fieldbus, logLevel, tls, gameLoop, recorder, parameterCache, parameters).
42
42
  *
43
43
  * @name GetStartedConfig
44
44
  * @summary Get the configuration Motion Master was started with
@@ -539,6 +539,19 @@ export class Api extends HttpClient {
539
539
  format: "json",
540
540
  ...params,
541
541
  });
542
+ /**
543
+ * @description Returns a point-in-time snapshot of the RT cyclic loop: the configured period and target rate, the cumulative achieved rate since start, the executed- and skipped-cycle counters, per-cycle task-execution timing (last / worst / mean), and whether real-time scheduling was acquired. Skipped cycles accumulate whenever the loop cannot meet its period (common on non-RT hosts such as Windows userspace) — a steadily rising `skippedCycles`, or an `achievedHz` well below `targetHz`, means the configured period is too aggressive for the hardware. Poll this endpoint and diff `executedCycles`/`skippedCycles` against `timestampUs` to chart the instantaneous rate over time.
544
+ *
545
+ * @name GetGameLoop
546
+ * @summary Inspect real-time game-loop health
547
+ * @request GET:/api/game-loop
548
+ */
549
+ getGameLoop = (params = {}) => this.request({
550
+ path: `/api/game-loop`,
551
+ method: "GET",
552
+ format: "json",
553
+ ...params,
554
+ });
542
555
  /**
543
556
  * @description Streams the same `.mmpd` serialisation as the POST variant (the recorder's current span, with the process image embedded as a header) directly in the response body instead of writing a file — for the client SDK / browser, which parses the bytes offline. Request with `Accept: application/octet-stream`. Same span semantics as the POST; works in any state.
544
557
  *
@@ -1,3 +1,68 @@
1
+ /** Point-in-time health of the real-time game loop. Times are nanoseconds; rates are hertz. All fields are diagnostic (relaxed reads), not synchronised. */
2
+ export interface GameLoopHealth {
3
+ /**
4
+ * Configured target cycle period, in microseconds
5
+ * @format int64
6
+ * @example 1000
7
+ */
8
+ periodUs: number;
9
+ /**
10
+ * Target cycle rate (1e6 / periodUs), in hertz
11
+ * @example 1000
12
+ */
13
+ targetHz: number;
14
+ /**
15
+ * Cumulative average rate since the loop started (executedCycles / uptime), in hertz; 0 before the loop starts. Below targetHz means the host cannot sustain the configured period.
16
+ * @example 999.56
17
+ */
18
+ achievedHz: number;
19
+ /**
20
+ * Loop iterations actually executed since start
21
+ * @format int64
22
+ * @example 2023
23
+ */
24
+ executedCycles: number;
25
+ /**
26
+ * Cycles skipped to catch up after overruns/stalls since start. A rising value means the loop is not meeting its period.
27
+ * @format int64
28
+ * @example 0
29
+ */
30
+ skippedCycles: number;
31
+ /**
32
+ * Task-execution time of the most recent cycle, in nanoseconds
33
+ * @format int64
34
+ * @example 104
35
+ */
36
+ lastExecNs: number;
37
+ /**
38
+ * Worst task-execution time since start, in nanoseconds
39
+ * @format int64
40
+ * @example 4009
41
+ */
42
+ maxExecNs: number;
43
+ /**
44
+ * Mean task-execution time since start, in nanoseconds
45
+ * @format int64
46
+ * @example 338
47
+ */
48
+ avgExecNs: number;
49
+ /**
50
+ * Whether SCHED_FIFO real-time priority was acquired (false on Windows, which never attempts it, and on Linux/macOS when the privilege is missing).
51
+ * @example false
52
+ */
53
+ schedFifo: boolean;
54
+ /**
55
+ * Whether mlockall succeeded to pin memory (Linux only; false elsewhere or when the privilege is missing).
56
+ * @example false
57
+ */
58
+ memLocked: boolean;
59
+ /**
60
+ * Server wall-clock timestamp (epoch microseconds) when sampled
61
+ * @format int64
62
+ * @example 1783968687738680
63
+ */
64
+ timestampUs: number;
65
+ }
1
66
  /** Summary of one on-disk parameter-cache file (its identity, size, and count). */
2
67
  export interface ParameterCacheEntry {
3
68
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synapticon/motion-master-client",
3
- "version": "6.0.0-alpha.35",
3
+ "version": "6.0.0-alpha.36",
4
4
  "description": "Isomorphic TypeScript client for Motion Master: the generated HTTP API client, the WebSocket connection, and helpers.",
5
5
  "license": "MIT",
6
6
  "repository": {