Skip to content

Command Line Tools

analyze performance

Analyzes application performance, identifying bottlenecks and optimization opportunities in your Wheels application.

Terminal window
wheels analyze performance [--target=<target>] [--duration=<seconds>] [--report] [--threshold=<ms>] [--profile]
ParameterDescriptionDefault
--targetAnalysis target: all, controller, view, query, memoryall
--durationDuration to run analysis in seconds (1-300)30
--reportGenerate HTML performance report with chartsfalse
--thresholdPerformance threshold in milliseconds for slow requests100
--profileEnable profiling mode for real metrics (when available)false

The analyze performance command monitors your Wheels application to identify performance bottlenecks and provide optimization recommendations. It tracks metrics in real-time and provides both console output and optional HTML reports.

  • Request Performance: Response times, slow requests, controller/action patterns
  • Database Queries: Query execution times, slow queries, query patterns
  • Memory Usage: Memory consumption, peak usage, memory trends
  • View Rendering: Template rendering times (when target includes views)
  • Overall Health: Performance score and grade (A-F)

The analyzer assigns a performance grade based on collected metrics:

  • A (90-100): Excellent performance
  • B (80-89): Good performance
  • C (70-79): Acceptable performance
  • D (60-69): Poor performance, optimization needed
  • F (0-59): Critical performance issues

Monitor all metrics for 30 seconds:

Terminal window
wheels analyze performance

Analyze for 2 minutes:

Terminal window
wheels analyze performance --duration=120

Monitor only database queries:

Terminal window
wheels analyze performance --target=query

Monitor only memory consumption:

Terminal window
wheels analyze performance --target=memory

Set slow request threshold to 200ms:

Terminal window
wheels analyze performance --threshold=200

Attempt to collect real metrics (if available):

Terminal window
wheels analyze performance --profile

Create a detailed HTML report with charts:

Terminal window
wheels analyze performance --report

Full analysis with all options:

Terminal window
wheels analyze performance --target=all --duration=60 --threshold=200 --profile --report
Analyzing application performance...
Starting performance monitoring for 30 seconds...
Target: all
Threshold: 100ms
[====================] 100% Complete!
Profiling mode disabled
==================================================
PERFORMANCE ANALYSIS COMPLETE
==================================================
Data Source: SIMULATED (Enable --profile for real data)
Request Performance
--------------------------------------------------
Requests Analyzed: 42
Average Response Time: 156ms
Slowest Request: 891ms
Fastest Request: 23ms
Slow Requests (>100ms): 18
Database Performance
--------------------------------------------------
Queries Executed: 42
Average Query Time: 28ms
Slow Queries (>50ms): 8
Memory Usage
--------------------------------------------------
Average Memory: 193MB
Peak Memory: 205MB
Top Slow Requests:
--------------------------------------------------
1. reports.index() - 891ms
2. users.create() - 645ms
3. products.update() - 523ms
4. orders.index() - 412ms
5. dashboard.show() - 387ms
Top Slow Queries:
--------------------------------------------------
1. SELECT * FROM orders WHERE id = ? - 187ms
2. UPDATE products WHERE id = ? - 156ms
3. SELECT * FROM users WHERE id = ? - 98ms
==================================================
Performance Grade: B (83/100)
==================================================
Performance Recommendations:
--------------------------------------------------
* Implement caching strategies for frequently accessed data
* Optimize database queries and add appropriate indexes
* Enable query result caching in production
* Minimize database round trips
* Use connection pooling for database connections

The HTML report includes:

  • Performance Dashboard: Visual metrics with color-coded indicators
  • Performance Grade: Large visual display of grade and score
  • Charts:
    • Response time trends over monitoring period
    • Memory usage over time
  • Detailed Tables:
    • Top 10 slow requests with timing
    • Top 10 slow queries with execution times
  • Recommendations: Context-aware optimization suggestions

Reports are saved to: reports/performance-[timestamp].html

  • Generates realistic performance patterns
  • Useful for testing and demonstration
  • Provides consistent baseline metrics

When enabled, attempts to:

  • Access ColdFusion’s metrics service
  • Hook into Wheels debug information
  • Collect real request/response times
  • Capture actual query execution data
  • Falls back to simulation if real data unavailable

Default thresholds used for categorization:

  • Slow Requests: > 100ms (configurable via —threshold)
  • Slow Queries: > 50ms (fixed)
  • High Memory: > 500MB
  • Response Time Categories:
    • Fast: < 100ms
    • Moderate: 100-300ms
    • Slow: > 300ms

The analyzer provides context-aware recommendations based on:

  • High Average Response Time (>200ms): Suggests caching strategies
  • Slow Queries Detected: Recommends indexing and query optimization
  • High Memory Usage (>500MB): Suggests memory optimization
  • Multiple Slow Requests: Recommends async processing and lazy loading

Exit codes for automation:

  • 0: Performance acceptable
  • 1: Performance issues detected (slow requests or queries found)

Example Jenkins integration:

stage('Performance Check') {
steps {
sh 'wheels analyze performance --duration=60 --threshold=200'
}
}
  1. Run regularly in staging environment
  2. Compare metrics over time to track improvements
  3. Use HTML reports for stakeholder communication
  4. Set appropriate thresholds based on application requirements
  1. Baseline First: Establish performance baselines before optimization
  2. Target Specific Areas: Use —target to focus on suspected bottlenecks
  3. Realistic Load: Run during typical usage patterns for accurate results
  4. Profile Mode: Enable —profile when real metrics are needed
  5. Regular Monitoring: Schedule regular performance checks
  6. Track Trends: Save reports to track performance over time
  • Simulated Data: Default mode uses simulated data; enable —profile for real metrics
  • Single Instance: Monitors single application instance only
  • External Services: Doesn’t track external API or service calls
  • Browser Performance: Server-side only, doesn’t measure client-side performance
  • Ensure application has debug mode available
  • Check ColdFusion administrator settings
  • Verify appropriate permissions for metrics access
  • Normal for JVM applications
  • Monitor trends rather than absolute values
  • Consider JVM heap settings
  • Adjust threshold to match application expectations
  • Check if application is under unusual load
  • Verify database connection pool settings