Skip to content

feat(metrics): add user_stats table that tracks more granular usage information per user#177

Merged
waleedlatif1 merged 5 commits into
mainfrom
feat/metrics
Mar 24, 2025
Merged

feat(metrics): add user_stats table that tracks more granular usage information per user#177
waleedlatif1 merged 5 commits into
mainfrom
feat/metrics

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Mar 24, 2025

Copy link
Copy Markdown
Collaborator
  • ran migrations for new table, fixed build issue. added a user/stats route to fetch all user stats for the dashboard we'll eventually create
  • added user_stats table to track total number of workflow runs
  • added metrics for different types of triggers and runs
  • add total_tokens_used and total_cost metrics

Description

In this PR, we added a user_stats table to postgres that includes information about totalWorkflowRuns, totalApiCalls, totalWebhookTriggers, totalScheduledExecutions, totalTokensUsed, totalCost, workflowsCreated, lastActive. This information will help inform us on how much each of the triggers is being used, as well as see the power users by tracking how many executions they've ran. Also, when we launch we'll need to limit the number of executions for free users, and this will be an easy way to do that.

Fixes #176

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

I ran the migrations and tested to ensure all fields of this table were getting updated.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

@vercel

vercel Bot commented Mar 24, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 24, 2025 9:49pm
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 24, 2025 9:49pm

…oute to fetch all user stats for the dashboard we'll eventually create
@waleedlatif1
waleedlatif1 marked this pull request as ready for review March 24, 2025 21:49
@waleedlatif1
waleedlatif1 merged commit 78e701d into main Mar 24, 2025
@waleedlatif1
waleedlatif1 deleted the feat/metrics branch March 24, 2025 21:53
RadoBoiii pushed a commit to RadoBoiii/sim-fork that referenced this pull request Apr 13, 2025
…nformation per user (simstudioai#177)

* added user_stats table to track total number of workflow runs

* added metrics for different types of triggers and runs

* add total_tokens_used and total_cost metrics

* ran migrations for new table, fixed build issue. added a user/stats route to fetch all user stats for the dashboard we'll eventually create

* fix bug with api deployment status not appearing
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.

[REQUEST] Track more granular user metrics

1 participant