Team Analytics
Team Analytics provides real-time insights into your team’s code review activity and AI usage.
Available Metrics
Core Metrics
Team Members
Total number of active team members. Updated automatically when members join or leave.
Repositories
Number of connected repositories your team has access to.
Pull Requests Reviewed
Total PRs that have been analyzed by Mesrai’s AI reviewer.
Comments Generated
Total AI-generated review comments across all PRs.
Tokens Consumed
Total AI tokens used for code analysis. Helps track usage against plan quotas.
Efficiency Metrics
The analytics dashboard calculates efficiency indicators:
// Average Comments per PR
avgCommentsPerPR = commentsGenerated / pullRequestsReviewed
// Average Tokens per PR
avgTokensPerPR = tokensConsumed / pullRequestsReviewed
// PRs per Member
prsPerMember = pullRequestsReviewed / memberCountViewing Analytics
- Go to Teams in your dashboard
- Hover over a team card
- Click the Analytics icon
- View real-time metrics
Recalculating Analytics
If you notice discrepancies, you can manually recalculate:
- Click the “Recalculate” button in the analytics page
- Wait for the recalculation to complete
- Refresh the page to see updated metrics
Understanding the Dashboard
Metrics Grid
The analytics page displays metrics in an organized grid:
| Metric | Description | Purpose |
|---|---|---|
| Member Count | Active team members | Team size tracking |
| Repository Count | Connected repos | Scope of coverage |
| PRs Reviewed | Total analyzed PRs | Activity volume |
| Comments Generated | AI review comments | Feedback quantity |
| Tokens Consumed | AI token usage | Cost tracking |
Activity Timeline
View team activity over time:
- Daily PR review counts
- Token consumption trends
- Peak usage periods
- Member contribution patterns
Performance Indicators
Key performance indicators (KPIs) help assess team efficiency:
- Review Velocity: PRs reviewed per day
- Comment Density: Average comments per PR
- Token Efficiency: Tokens used per PR
- Member Productivity: PRs per member
Exporting Analytics
Export team analytics for reporting:
- Click “Export” button
- Select date range
- Choose format (CSV, JSON, or PDF)
- Download report
Export Formats
CSV Export
Comma-separated values for spreadsheet analysis:
Date,PRs Reviewed,Comments,Tokens,Members
2025-01-01,45,234,12500,8
2025-01-02,52,287,15200,8JSON Export
Structured data for programmatic access:
{
"team": "Engineering",
"period": "2025-01",
"metrics": {
"prsReviewed": 450,
"comments": 2340,
"tokens": 125000
}
}Setting Up Alerts
Configure alerts for metric thresholds:
- Go to Team Settings → Alerts
- Set threshold values
- Choose notification channels (email, Slack)
- Save alert configuration
Alert Examples
High Token Usage
alert:
name: Token Quota Warning
condition: tokens > 80% of quota
action: email + slack notificationLow Activity
alert:
name: Inactive Team
condition: prsReviewed < 10 in 7 days
action: email to team ownerAnalytics Best Practices
1. Regular Monitoring
Check analytics weekly to track:
- Team productivity trends
- Resource utilization
- Potential bottlenecks
2. Set Baselines
Establish baseline metrics for:
- Expected PRs per week
- Average tokens per PR
- Target comment density
3. Review Anomalies
Investigate unusual patterns:
- Sudden token spikes
- Drop in PR reviews
- Member inactivity
4. Share with Team
Use analytics to:
- Celebrate milestones
- Identify improvement areas
- Justify resource allocation
Troubleshooting
Metrics Not Updating
Problem: Analytics showing stale data
Solutions:
- Refresh the page
- Click “Recalculate Analytics”
- Check webhook status
- Verify repository connections
Incorrect Token Counts
Problem: Token usage doesn’t match expectations
Solutions:
- Recalculate analytics
- Check for failed reviews
- Verify PR scope settings
- Contact support if persists
Missing PR Data
Problem: Some PRs not showing in analytics
Solutions:
- Verify PR was reviewed by Mesrai
- Check date range filters
- Ensure repository is connected
- Refresh analytics data
API Access
Access analytics programmatically via API:
# Get team analytics
curl -H "Authorization: Bearer $TOKEN" \
https://api.mesrai.com/v1/teams/{teamId}/analytics
# Response
{
"teamId": "team_123",
"memberCount": 8,
"repositoryCount": 12,
"pullRequestsReviewed": 450,
"commentsGenerated": 2340,
"tokensConsumed": 125000,
"lastActivity": "2025-01-15T10:30:00Z"
}