@camunda/ccma-saas-frontend 0.35.9 → 0.35.11

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.
@@ -204,6 +204,15 @@ function persistDismissedFailoverUriNotices(ids) {
204
204
  // localStorage unavailable (private mode / SSR) — dismissal is best-effort.
205
205
  }
206
206
  }
207
+ // HDP adds an hour of cluster load about 30 minutes after the hour ends, and
208
+ // accounts-ng caches a read for up to an hour, so the newest point of a
209
+ // running cluster can start 3.5 hours before now. The lag below adds half an
210
+ // hour of margin to that. While the newest point is newer than the lag, the
211
+ // hours after it have not arrived yet, so the 24-hour chart pads nothing.
212
+ // When the newest point is older than the lag, the cluster stopped
213
+ // reporting, and the chart pads every hour from that point to now with zero.
214
+ // The per-day chart does the same with one day plus the lag.
215
+ const CLUSTER_LOAD_LAG_MS = 4 * 60 * 60 * 1000;
207
216
  export function ensureClusterLoadPerDay(perDay) {
208
217
  const DAY = 24 * 60 * 60 * 1000;
209
218
  const now = Date.now();
@@ -225,7 +234,7 @@ export function ensureClusterLoadPerDay(perDay) {
225
234
  return generated;
226
235
  }
227
236
  const max = Math.max(...updatedPerDay.map((item) => item.ts));
228
- if (max < now - DAY) {
237
+ if (max < now - DAY - CLUSTER_LOAD_LAG_MS) {
229
238
  const missingDays = Math.floor((now - max) / DAY);
230
239
  for (let i = 1; i < missingDays + 1; i += 1) {
231
240
  updatedPerDay.push({
@@ -267,9 +276,11 @@ export function ensureClusterLoad24h(last24h) {
267
276
  }
268
277
  // We have real data (e.g. a cluster younger than 24h only has a handful of
269
278
  // hourly buckets) — never discard it. Only backfill the gap between the
270
- // most recent real point and "now" when that point is stale, so a
271
- // still-fresh but incomplete window keeps its real values (including any
272
- // spikes) instead of being wiped and replaced with zeros.
279
+ // most recent real point and "now" when that point is older than
280
+ // `CLUSTER_LOAD_LAG_MS`, so a still-fresh but incomplete window keeps its
281
+ // real values (including any spikes) instead of being wiped and replaced
282
+ // with zeros. Such a window can have fewer than 24 points and end up to
283
+ // 4 hours before now.
273
284
  const max24h = Math.max(...updated24h.map((item) => item.ts));
274
285
  // The most recent real point is itself very stale (e.g. the cluster was
275
286
  // paused and its newest hourly bucket is many hours/days old). Padding
@@ -289,7 +300,7 @@ export function ensureClusterLoad24h(last24h) {
289
300
  }
290
301
  return sortAscendingByTs(updated24h);
291
302
  }
292
- if (max24h < now - HOUR) {
303
+ if (max24h < now - CLUSTER_LOAD_LAG_MS) {
293
304
  const missingHours = Math.floor((now - max24h) / HOUR);
294
305
  for (let i = 1; i < missingHours + 1; i += 1) {
295
306
  updated24h.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/ccma-saas-frontend",
3
- "version": "0.35.9",
3
+ "version": "0.35.11",
4
4
  "description": "Camunda Composite Components",
5
5
  "bugs": {
6
6
  "url": "https://github.com/camunda/camunda-cloud-management-apps/issues"
@@ -85,8 +85,8 @@
85
85
  "react-markdown": "^8.0.7 || ^10.0.0"
86
86
  },
87
87
  "dependencies": {
88
- "@camunda/ccma-api": "13.0.0",
89
- "@camunda/ccma-shared-types": "18.1.0",
88
+ "@camunda/ccma-api": "13.1.0",
89
+ "@camunda/ccma-shared-types": "18.3.0",
90
90
  "@pactsafe/pactsafe-react-sdk": "2.15.0",
91
91
  "cron-parser": "5.10.2",
92
92
  "mobx": "6.16.1",