@tangle-network/charts 0.21.1 → 0.21.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.
@@ -2629,13 +2629,16 @@ function slowestRow(rows, clockMs) {
2629
2629
  }
2630
2630
  /** The agents a reader should look at first: the longest one by the clock, and the costliest when two or more are priced. */
2631
2631
  function agentCallouts(agents, clockMs) {
2632
- let slowest, slowestMs = -1, costliest, top = -1, priced = 0;
2632
+ let slowest, slowestMs = -1, costliest, top = -1, priced = 0, timed = 0;
2633
2633
  for (const row of agents) {
2634
2634
  if (row.durationLabel === "—" || row.span.startMs > clockMs) continue;
2635
- const ms = (spanRunning(row.span) ? Math.max(row.span.endMs, clockMs) : Math.min(row.span.endMs, clockMs)) - row.span.startMs;
2636
- if (ms > slowestMs) {
2637
- slowest = row;
2638
- slowestMs = ms;
2635
+ if (row.kind === "pipeline" && row.parentId !== void 0) {
2636
+ const ms = (spanRunning(row.span) ? Math.max(row.span.endMs, clockMs) : Math.min(row.span.endMs, clockMs)) - row.span.startMs;
2637
+ timed += 1;
2638
+ if (ms > slowestMs) {
2639
+ slowest = row;
2640
+ slowestMs = ms;
2641
+ }
2639
2642
  }
2640
2643
  const cost = row.span.costUsd ?? row.rollupCostUsd;
2641
2644
  if (cost === void 0) continue;
@@ -2646,7 +2649,7 @@ function agentCallouts(agents, clockMs) {
2646
2649
  }
2647
2650
  }
2648
2651
  return {
2649
- slowestId: agents.length > 1 ? slowest?.id : void 0,
2652
+ slowestId: timed > 1 ? slowest?.id : void 0,
2650
2653
  costliestId: priced > 1 && top > 0 ? costliest?.id : void 0
2651
2654
  };
2652
2655
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/charts",
3
- "version": "0.21.1",
3
+ "version": "0.21.2",
4
4
  "description": "Static SVG and HTML figures for benchmarks and operational timing. Draws from producer data and refuses what it cannot draw honestly.",
5
5
  "type": "module",
6
6
  "license": "MIT",