@serve.zone/interfaces 7.22.0 → 7.23.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/changelog.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-06-12 - 7.23.0
4
+
5
+ ### Features
6
+
7
+ - add live node resource usage request contracts (node)
8
+ - getNodeResourceUsage lets the admin UI fetch live per-deployment CPU/memory for one node via Cloudly; coreflowGetNodeResourceUsage is the relayed coreflow request.
9
+ - INodeDeploymentResourceUsage is keyed by the swarm task id (= IDeployment.id) and reports CPU as percent of the whole node (0-100).
10
+
11
+ ## 2026-06-12 - 7.22.1
12
+
13
+ ### Fixes
14
+
15
+ - document the unit of deployment CPU usage (deployment)
16
+ - resourceUsage.cpuUsagePercent is percent of the whole node's CPU capacity (0-100), not the per-core docker stats convention; pins the scale that node-level metrics already use so producers and views stay consistent.
17
+
3
18
  ## 2026-06-11 - 7.22.0
4
19
 
5
20
  ### Features
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/interfaces',
6
- version: '7.22.0',
6
+ version: '7.23.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLHVGQUF1RjtDQUNyRyxDQUFBIn0=
@@ -58,6 +58,12 @@ export interface IDeployment {
58
58
  * Resource usage for this deployment
59
59
  */
60
60
  resourceUsage?: {
61
+ /**
62
+ * Percent of the whole node's CPU capacity (0-100), NOT per-core:
63
+ * a deployment saturating one core of an 8-core node reports 12.5.
64
+ * Matches the scale of node-level metrics (IClusterNodeMetrics,
65
+ * INodeMetricsSample), not the docker stats CLI convention.
66
+ */
61
67
  cpuUsagePercent: number;
62
68
  memoryUsedMB: number;
63
69
  lastUpdated: number;
@@ -144,6 +144,43 @@ export interface IReq_Any_Cloudly_GetNodeTrafficStats extends plugins.typedreque
144
144
  timestamp: number;
145
145
  };
146
146
  }
147
+ /**
148
+ * Live resource usage of one deployment on a node. deploymentId is the swarm
149
+ * task id, which is also IDeployment.id — the join key for UI rows.
150
+ * cpuUsagePercent is percent of the whole node's CPU capacity (0-100).
151
+ */
152
+ export interface INodeDeploymentResourceUsage {
153
+ deploymentId: string;
154
+ cpuUsagePercent: number;
155
+ memoryUsedMB: number;
156
+ }
157
+ /**
158
+ * Admin UI asks Cloudly for a node's live per-deployment resource usage;
159
+ * Cloudly relays to the node's coreflow which samples docker stats.
160
+ * Polled only while a node detail view is open; not persisted.
161
+ */
162
+ export interface IReq_Any_Cloudly_GetNodeResourceUsage extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_GetNodeResourceUsage> {
163
+ method: 'getNodeResourceUsage';
164
+ request: {
165
+ identity: IIdentity;
166
+ nodeId: string;
167
+ };
168
+ response: {
169
+ deployments: INodeDeploymentResourceUsage[];
170
+ timestamp: number;
171
+ };
172
+ }
173
+ /**
174
+ * Cloudly asks a node's coreflow for live per-deployment resource usage.
175
+ */
176
+ export interface IReq_Cloudly_Coreflow_GetNodeResourceUsage extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Cloudly_Coreflow_GetNodeResourceUsage> {
177
+ method: 'coreflowGetNodeResourceUsage';
178
+ request: {};
179
+ response: {
180
+ deployments: INodeDeploymentResourceUsage[];
181
+ timestamp: number;
182
+ };
183
+ }
147
184
  /**
148
185
  * Cloudly -> admin UIs: live node metrics relay (1s cadence, not persisted).
149
186
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serve.zone/interfaces",
3
- "version": "7.22.0",
3
+ "version": "7.23.0",
4
4
  "private": false,
5
5
  "description": "Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.",
6
6
  "exports": {
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/interfaces',
6
- version: '7.22.0',
6
+ version: '7.23.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.'
8
8
  }
@@ -77,6 +77,12 @@ export interface IDeployment {
77
77
  * Resource usage for this deployment
78
78
  */
79
79
  resourceUsage?: {
80
+ /**
81
+ * Percent of the whole node's CPU capacity (0-100), NOT per-core:
82
+ * a deployment saturating one core of an 8-core node reports 12.5.
83
+ * Matches the scale of node-level metrics (IClusterNodeMetrics,
84
+ * INodeMetricsSample), not the docker stats CLI convention.
85
+ */
80
86
  cpuUsagePercent: number;
81
87
  memoryUsedMB: number;
82
88
  lastUpdated: number;
@@ -184,6 +184,52 @@ export interface IReq_Any_Cloudly_GetNodeTrafficStats extends plugins.typedreque
184
184
  };
185
185
  }
186
186
 
187
+ /**
188
+ * Live resource usage of one deployment on a node. deploymentId is the swarm
189
+ * task id, which is also IDeployment.id — the join key for UI rows.
190
+ * cpuUsagePercent is percent of the whole node's CPU capacity (0-100).
191
+ */
192
+ export interface INodeDeploymentResourceUsage {
193
+ deploymentId: string;
194
+ cpuUsagePercent: number;
195
+ memoryUsedMB: number;
196
+ }
197
+
198
+ /**
199
+ * Admin UI asks Cloudly for a node's live per-deployment resource usage;
200
+ * Cloudly relays to the node's coreflow which samples docker stats.
201
+ * Polled only while a node detail view is open; not persisted.
202
+ */
203
+ export interface IReq_Any_Cloudly_GetNodeResourceUsage extends plugins.typedrequestInterfaces.implementsTR<
204
+ plugins.typedrequestInterfaces.ITypedRequest,
205
+ IReq_Any_Cloudly_GetNodeResourceUsage
206
+ > {
207
+ method: 'getNodeResourceUsage';
208
+ request: {
209
+ identity: IIdentity;
210
+ nodeId: string;
211
+ };
212
+ response: {
213
+ deployments: INodeDeploymentResourceUsage[];
214
+ timestamp: number;
215
+ };
216
+ }
217
+
218
+ /**
219
+ * Cloudly asks a node's coreflow for live per-deployment resource usage.
220
+ */
221
+ export interface IReq_Cloudly_Coreflow_GetNodeResourceUsage extends plugins.typedrequestInterfaces.implementsTR<
222
+ plugins.typedrequestInterfaces.ITypedRequest,
223
+ IReq_Cloudly_Coreflow_GetNodeResourceUsage
224
+ > {
225
+ method: 'coreflowGetNodeResourceUsage';
226
+ request: {};
227
+ response: {
228
+ deployments: INodeDeploymentResourceUsage[];
229
+ timestamp: number;
230
+ };
231
+ }
232
+
187
233
  /**
188
234
  * Cloudly -> admin UIs: live node metrics relay (1s cadence, not persisted).
189
235
  */