Skip to content

chore: Track pipeline count and node distribution at session start#2163

Merged
morgan-wowk merged 1 commit intomasterfrom
pipeline-analytics
Apr 30, 2026
Merged

chore: Track pipeline count and node distribution at session start#2163
morgan-wowk merged 1 commit intomasterfrom
pipeline-analytics

Conversation

@morgan-wowk
Copy link
Copy Markdown

@morgan-wowk morgan-wowk commented Apr 24, 2026

Impact on existing application

This tracking runs asynchronously, only once per session without interrupting the render.

Screenshots (if applicable)

image.png

Description

Adds a useSessionPipelineStats hook that fires a session.pipeline_stats.start analytics event once per browser-tab session. The event includes the total number of pipelines and a bucketed distribution of node counts (0, 1_to_5, 6_to_20, 21_plus) across all pipelines found in both the current Dexie-based storage and the legacy localForage storage.

Node counting recursively flattens inline subgraphs, replacing each subgraph task with its own constituent nodes. A sessionStorage guard prevents duplicate fires within the same tab session.

The hook is mounted via a SessionPipelineStatsTracker component placed inside PipelineStorageProvider in RootLayout.

Related Issue and Pull requests

Type of Change

  • Bug fix
  • New feature
  • Improvement
  • Cleanup/Refactor
  • Breaking change
  • Documentation update

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Test Instructions

  1. Open the app in a new browser tab.
  2. Check the analytics events being fired and confirm a session.pipeline_stats.start event is present with total_pipelines and pipeline_node_buckets properties.
  3. Refresh the tab and confirm the event is not fired again within the same session.
  4. Open a new tab and confirm the event fires again.
  5. Verify pipelines stored in both Dexie-based and legacy localForage storage are counted without duplication.

Additional Comments

Folders that require permission are skipped during enumeration. Pipelines that fail to parse are still counted toward total_pipelines to avoid undercounting. If the legacy store is unavailable, the Dexie-based count is still reported.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

🎩 Preview

A preview build has been created at: pipeline-analytics/19685dd

Copy link
Copy Markdown
Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@morgan-wowk morgan-wowk force-pushed the pipeline-analytics branch 3 times, most recently from 6477b92 to 143e989 Compare April 24, 2026 22:33
@morgan-wowk morgan-wowk marked this pull request as ready for review April 24, 2026 22:37
@morgan-wowk morgan-wowk requested a review from a team as a code owner April 24, 2026 22:37
Comment thread src/hooks/useSessionPipelineStats.ts Outdated
Comment thread src/hooks/useSessionPipelineStats.ts Outdated
Comment on lines +82 to +87
"11_to_20": 0,
"21_to_49": 0,
"50_plus": 0,
};

try {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change buckets instead of +10 increment, use fibonacci or progressive/exp scale, so we can have visibility into 200+ nodes

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC: @camielvs Sound good to you? These buckets were your suggestion

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure. I just pulled these off the top of my head. Happy to go with something more granular, e.g. fibonacci. Though highly irregular bucket width could make comparisons tricky

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We moved to use fibonacci buckets.

Copy link
Copy Markdown
Author

morgan-wowk commented Apr 30, 2026

Merge activity

  • Apr 30, 12:47 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 30, 12:48 AM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 30, 12:50 AM UTC: @morgan-wowk merged this pull request with Graphite.

@morgan-wowk morgan-wowk merged commit 382238c into master Apr 30, 2026
17 checks passed
@morgan-wowk morgan-wowk deleted the pipeline-analytics branch April 30, 2026 00:50
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.

3 participants