Health Scores
Monitor and improve mock API simulation quality using automated health scoring. Health scores evaluate route coverage, response freshness, error rates, latency performance, and overall reliability, providing actionable recommendations.
Prerequisites
- An existing mock simulation with at least one route and response
- Understanding of basic simulation metrics
- Some request traffic to the simulation (for trend analysis)
Understanding Health Scores
The health scoring system evaluates simulations across five dimensions:
Health Score Dimensions
| Dimension | Measures | Good Score |
|---|---|---|
| Route Coverage | Percentage of routes with mock responses | > 90% |
| Response Freshness | How recently responses were updated | < 30 days |
| Error Rate | Percentage of requests returning errors | < 5% |
| Latency Performance | Response time consistency and speed | P95 < 1000ms |
| Error Diversity | Coverage of different HTTP status codes | 3+ different codes |
Overall Health Score
Composite score from 0-100 based on weighted dimensions:
- 90-100: A - Excellent health
- 80-89: B - Good health with minor issues
- 70-79: C - Fair health with improvement needed
- 60-69: D - Poor health, addressing issues recommended
- 0-59: F - Critical issues requiring attention
Accessing Health Scores
Dashboard View
- Open simulation dashboard
- Look for Health Score card or widget
- See current score and grade at a glance
Simulation Health Details
- Open simulation
- Click Health or Health Score tab
- View comprehensive health report:
- Current overall score and grade
- Scores for each dimension
- Key findings and issues
- Recommendations
- Last computed timestamp
Company-Wide Health Summary
- Go to workspace dashboard
- Click Health Summary or All Simulations Health
- See health scores for all your simulations
- Sort and filter by score/grade
- Identify simulations needing attention
Health Score Components
Route Coverage
Shows percentage of routes with at least one mock response:
Route Coverage: 75%
- Total routes: 12
- Routes with responses: 9
- Uncovered routes: 3
Finding: Missing responses for POST /api/users, DELETE /api/users/:id, PATCH /api/profile
Recommendation: Add mock responses for these routes to improve coverage
Response Freshness
Measures how recently responses were updated:
Response Freshness: 85%
- Oldest response: 45 days (GET /api/health)
- Average age: 18 days
- Recently updated (< 7 days): 8 routes
Finding: Some responses haven't been updated in 45+ days
Recommendation: Review and refresh outdated responses quarterly
Error Rate
Tracks percentage of failed requests:
Error Rate: 3.2%
- Total requests (24h): 1,000
- Successful: 968
- Errors: 32
- Error types: 2 timeouts, 10 validation errors, 20 intentional mocks
Finding: Error rate is within normal bounds
Recommendation: Monitor for spikes in validation errors
Latency Performance
Evaluates response time metrics:
Latency Performance: 88%
- P50 (median): 45ms
- P95 (95th percentile): 250ms
- P99 (99th percentile): 450ms
- Slowest route: POST /api/complex (avg 350ms)
Finding: Good overall performance; one route slower than others
Recommendation: Consider reducing simulated delay on POST /api/complex
Error Diversity
Measures coverage of different HTTP status codes:
Error Diversity: 65%
- Success responses (2xx): 8 routes
- Client errors (4xx): 3 routes (insufficient coverage)
- Server errors (5xx): 1 route
- Redirects (3xx): 0 routes
Finding: Limited 4xx and 5xx error response definitions
Recommendation: Add 400, 401, 403, 404, 429, and 500 responses
Viewing Health Trends
Health History Timeline
View how health score has changed over time:
- Open simulation health details
- Click History or Trends tab
- See score snapshots over time (up to 100 recent records)
Each history entry shows:
- Computed timestamp
- Overall score
- Dimension scores
- Key metrics
Trend Chart
Visualize health score trends:
- Open health history
- View line chart of score over time
- See dimension trends in separate lines (if expanded)
- Identify improving or declining dimensions
Trend Analysis
Interpret trends:
- Upward trend - Simulation quality improving
- Flat trend - Stable quality
- Downward trend - Quality degrading; investigate cause
- Spikes - Sudden changes; check for recent changes
Refreshing Health Scores
Recompute health score after making simulation changes:
Manual Refresh
- Open simulation health details
- Click Refresh or Recompute Score
- Wait for computation to complete
- View updated score and findings
Recomputation takes 5-30 seconds depending on simulation size.
Auto-Refresh
Health scores automatically recompute:
- When routes are added/removed
- When responses are modified
- When response versions are promoted
- Periodically (every few hours)
When to Manually Refresh
- After adding many routes at once
- After promoting new response versions
- After fixing validation errors
- To verify score after making improvements
Finding and Acting on Issues
Review Findings
Findings are actionable issues identified by the health system:
- Open health score details
- Click Findings or Issues section
- See list of issues with:
- Issue title and description
- Affected routes/responses
- Severity or impact
- Recommended action
Generate Fix Suggestions
Get AI-powered recommendations:
- Select a finding
- Click Get Suggestion or How to Fix
- View suggested action steps
- Click on route/response if applicable
- Make the recommended change
Example findings:
1. Route Uncovered
Route: DELETE /api/users/:id
Impact: Cannot test deletion workflow
Suggestion: Add mock response for successful deletion (200) or error (404)
2. Outdated Response
Route: GET /api/config
Last updated: 62 days ago
Impact: Consumers may have outdated expectations
Suggestion: Review configuration format and update response if needed
3. Missing Error Variants
Route: POST /api/auth/login
Coverage: Only success (200) response defined
Suggestion: Add error responses for 401 (invalid credentials) and 429 (rate limited)
4. High Latency
Route: POST /api/complex-operation
P95 latency: 1200ms
Impact: Slow responses may cause timeouts in tests
Suggestion: Reduce latencyMs configuration or investigate complex logic
5. Validation Failures
Route: PUT /api/users/:id
Failure rate: 8% of requests
Impact: Consumers sending invalid data
Suggestion: Review validation schema and provide error details in mock response
Health Score Best Practices
Maintain Healthy Simulations
- Cover all routes - Ensure every route has at least one response
- Add error variants - Mock 4xx and 5xx responses
- Keep responses fresh - Review and update quarterly
- Monitor trends - Check health monthly
- Act on findings - Address critical issues promptly
Set Health Targets
-
Establish team standards:
- Minimum score for production-like simulations (e.g., 80+)
- Maximum uncovered routes allowed (e.g., 10%)
- Required error response coverage (e.g., 4xx, 5xx, rate limit)
-
Review health quarterly:
- Are scores improving?
- Are recommendations being implemented?
- Any declining simulations?
Health for Different Contexts
Development Simulation (Lower standards):
- Minimum score: 60+
- May have partial coverage
- Focus on happy path routes
Staging Simulation (Moderate standards):
- Minimum score: 75+
- Should have error variants
- Recent updates recommended
Production-like Simulation (High standards):
- Minimum score: 85+
- Complete route coverage
- All error scenarios covered
- Validated against actual API
Troubleshooting
Score Seems Inaccurate
- Refresh the score manually
- Check that routes were saved properly
- Verify responses are associated with correct routes
- Wait for auto-refresh if made recent changes
Health is F but Looks Good
- Review the detailed findings
- Check which dimension is pulling score down
- Focus on the specific dimension improvement
- Refresh after making changes
Can't See Health Insights
- Ensure simulation has traffic history
- Health scores improve with usage data
- Create some test requests to the simulation
- Wait for next auto-refresh
Score Not Updating
- Check when score was last computed
- Try manual refresh
- Verify no simulation errors blocking computation
- Contact support if stuck
API Reference
Health Score Endpoints
| Method | Path | Description |
|---|---|---|
GET | /instances/health-summary | Get health for all instances |
GET | /instances/:id/health | Get current health score |
GET | /instances/:id/health/history | Get score history timeline |
POST | /instances/:id/health/refresh | Force recompute health |
POST | /instances/:id/health/findings/:idx/fix | Get fix suggestion |
Next Steps
- Routes and Responses - Add routes and responses to improve coverage
- Request Validation - Set up validation to reduce error rate
- Analytics - Monitor simulation traffic and latency
- Response Versioning - Track response updates for freshness