Skip to content

feat(timeline): granular governor-limit tracking with stable tooltip#851

Merged
lcottercertinia merged 3 commits into
certinia:mainfrom
lukecotter:feat-827-granular-limits
Jul 10, 2026
Merged

feat(timeline): granular governor-limit tracking with stable tooltip#851
lcottercertinia merged 3 commits into
certinia:mainfrom
lukecotter:feat-827-granular-limits

Conversation

@lukecotter

Copy link
Copy Markdown
Collaborator

📝 PR Overview

Feeds the timeline metric strip with per-event governor-limit usage so each limit line rises as usage
actually happens (not only at code-unit boundaries), and makes the hover tooltip stable and easier to
scan. Gives a far more accurate, readable picture of where a transaction approaches its limits.

🛠️ Changes made

  • Fold detailed events (SOQL/DML/SOSL/callout/heap + LIMIT_USAGE/flow reports) into a dense per-metric
    series in governor-timeline.ts; cumulative LIMIT_USAGE_FOR_NS snapshots stay corrective via a max
    floor so monotonic counters never dip.
  • Fix the authoritative "out of" limit per metric (max snapshot, else default) so totals never flip
    mid-log (e.g. heap 6MB↔12MB); coalesce high-frequency deltas to bound point count on massive logs
    (~36k→55 on a 5.9MB log).
  • Sort tooltip rows by each metric's global peak instead of the value under the cursor, so rows hold a
    fixed slot rather than reshuffling as the pointer moves.
  • Always render the used / limit value — even at 0% before a metric's first observation — so the
    limit/headroom is always visible; the fixed per-series limit is carried on the classified metric.
  • Extract the ApexLog → HeatStripTimeSeries transform out of ApexLogTimeline into
    apex-limit-series.ts, keeping metric-strip/ Apex-agnostic; consolidate limit-line parsing into
    limits.ts.

🧩 Type of change (check all applicable)

  • 🐛 Bug fix - something not working as expected
  • ✨ New feature – adds new functionality
  • ♻️ Refactor - internal changes with no user impact
  • ⚡ Performance Improvement
  • 📝 Documentation - README or documentation site changes
  • 🔧 Chore - dev tooling, CI, config
  • 💥 Breaking change

📷 Screenshots / gifs / video [optional]

No new screenshots — behaviour change to the existing metric-strip lines and hover tooltip.

🔗 Related Issues

closes #827

✅ Tests added?

  • 👍 yes

governor-timeline.test.ts, MetricStripTooltipRenderer.test.ts,
apex-log-parser/__tests__/GranularLimits.test.ts.

📚 Docs updated?

  • 🔖 README.md
  • 🔖 CHANGELOG.md
  • 📖 help site
  • 🧪 Marked any pre-release-only features (README 🧪 badge — see
    RELEASING.md)
  • 🙅 not needed

Anything else we need to know? [optional]

Reviewer guidance: the core of the new behaviour is the fold in governor-timeline.ts (delta vs
absolute observations, max-floor correction, delta coalescing). apex-limit-series.ts is a straight
extraction from ApexLogTimeline — no logic change there. Tooltip ordering/value changes are isolated
to MetricStripTooltipRenderer.ts + a new limit field threaded through MetricTierClassifier.ts.

Feed the limit strip with per-event usage so the line rises as usage happens, not only at code-unit
boundaries; cumulative snapshots stay corrective.

- Fold detailed events (SOQL/DML/SOSL/callout/heap + LIMIT_USAGE/flow reports) into a dense per-metric
series in governor-timeline.ts; cumulative LIMIT_USAGE_FOR_NS snapshots correct the running total via a
max floor
- Walk the full event tree (not just top-level) and read pre-parsed .self counters + heap Bytes so
nested usage is captured
- Fix authoritative "out of" limit per metric (max cumulative snapshot, else default) so totals never
jump (e.g. heap 6MB↔12MB); show strip whenever any usage exists
- Coalesce high-frequency deltas to bound point count on massive logs (~36k→55 on a 5.9MB log); tooltip
  shows tracked count as ghost text only when it undercounts the snapshot
- Consolidate limit-line parsing into limits.ts shared by the cumulative and flow/LIMIT_USAGE paths
- Always resize on strip visibility change so hiding it reclaims space and keeps the root frame
  on-screen
- sort tooltip rows by each metric's global peak (not the value at the cursor) so rows hold a fixed slot
  instead of reshuffling as the pointer moves
- always render the (used / limit) value, even at 0% before a metric's first observation, so the
  limit/headroom is always visible; carry the fixed per-series limit on the classified metric
- extract the ApexLog → HeatStripTimeSeries transform out of ApexLogTimeline into apex-limit-series.ts,
  keeping metric-strip/ Apex-agnostic
@lcottercertinia
lcottercertinia merged commit 9508255 into certinia:main Jul 10, 2026
6 of 7 checks passed
@lukecotter
lukecotter deleted the feat-827-granular-limits branch July 10, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ feat: timeline limits strip granular limit usage

2 participants