# TFA Application Usage Guide ## ๐Ÿš€ Quick Start Your TFA (Test Failure Analysis) application is now ready to use! Here are the different ways to interact with it: ## 1. ๐Ÿ“Š Metrics CLI (Recommended for Daily Monitoring) ### Get Daily Failure Percentages ```bash # All platforms python -m tfa_agents.metrics_cli daily # Specific platforms python -m tfa_agents.metrics_cli daily --platforms Android,Web ``` ### Get Platform Trends ```bash # 7-day trends python -m tfa_agents.metrics_cli trends --timeframe 7d # 30-day trends for specific platforms python -m tfa_agents.metrics_cli trends --timeframe 30d --platforms Android ``` ### Get Health Scores ```bash # Android health score python -m tfa_agents.metrics_cli health Android --timeframe 7d # iOS health score for 30 days python -m tfa_agents.metrics_cli health iOS --timeframe 30d ``` ### Get Comprehensive Reports ```bash # Weekly comparative report python -m tfa_agents.metrics_cli report --timeframe 7d # Monthly report python -m tfa_agents.metrics_cli report --timeframe 30d ``` ## 2. ๐ŸŒ Web Interface (Streamlit) ### Launch the Web UI ```bash streamlit run tfa_ui/app.py ``` Then open your browser to: http://localhost:8501 ### Features Available: - **๐Ÿ“Š Metrics Dashboard**: Real-time platform health monitoring - **๐Ÿ” Failure Analysis**: Individual test failure analysis - **๐Ÿ“ˆ Trend Visualization**: Platform performance over time - **๐Ÿฅ Health Scoring**: Platform health with recommendations - **๐Ÿ“‹ Daily Metrics Sidebar**: Quick health overview ## 3. ๐Ÿงช Testing & Validation ### Run Core Tests ```bash # Test all functionality python simple_test.py # Test mock data tools python test_mock.py # Test metrics system python test_metrics.py ``` ## 4. ๐Ÿ“ˆ Daily Monitoring Workflow ### Morning Health Check ```bash # Check yesterday's failure rates python -m tfa_agents.metrics_cli daily # Get weekly trends python -m tfa_agents.metrics_cli trends --timeframe 7d # Check health scores for concerning platforms python -m tfa_agents.metrics_cli health Web --timeframe 7d ``` ### Weekly Review ```bash # Generate comprehensive report python -m tfa_agents.metrics_cli report --timeframe 7d # Check individual platform health python -m tfa_agents.metrics_cli health Android --timeframe 30d python -m tfa_agents.metrics_cli health Web --timeframe 30d python -m tfa_agents.metrics_cli health iOS --timeframe 30d ``` ## 5. ๐ŸŽฏ Understanding the Output ### Health Score Interpretation - **๐ŸŸข 80-100**: Excellent (maintain current practices) - **๐ŸŸก 60-79**: Good (minor optimizations needed) - **๐ŸŸ  40-59**: Fair (targeted improvements required) - **๐Ÿ”ด 0-39**: Poor (urgent attention needed) ### Failure Rate Thresholds - **๐ŸŸข < 10%**: Healthy - **๐ŸŸก 10-20%**: Watch closely - **๐Ÿ”ด > 20%**: Needs immediate attention ### Trend Indicators - **๐Ÿ“ˆ Improving**: Failure rates decreasing - **๐Ÿ“‰ Degrading**: Failure rates increasing - **โžก๏ธ Stable**: No significant change ## 6. ๐Ÿ”ง Troubleshooting ### If you get import errors: ```bash # Make sure virtual environment is activated # Install dependencies pip install -r requirements.txt pip install -r tfa_ui/requirements.txt ``` ### If Streamlit won't start: ```bash # Check if port 8501 is available # Try a different port streamlit run tfa_ui/app.py --server.port 8502 ``` ### If you need a real Google API key: ```bash # Set your actual API key (for production use) export GOOGLE_API_KEY="your-actual-api-key" # or on Windows: set GOOGLE_API_KEY=your-actual-api-key ``` ## 7. ๐Ÿ“š Key Features ### โœ… What's Working: - โœ… Daily failure percentage tracking - โœ… Platform trend analysis (7d, 30d, 90d) - โœ… Health scoring with recommendations - โœ… Comparative platform reports - โœ… Mock data for testing - โœ… CLI interface for automation - โœ… Web dashboard for visualization - โœ… Cross-platform support (Android, Web, iOS) ### ๐Ÿ”„ Mock Data vs Real Data: - Currently using **mock data** for demonstration - Mock data simulates realistic failure patterns - To use real data, configure actual Sponge API credentials - All functionality works the same with real or mock data ## 8. ๐ŸŽฏ Next Steps 1. **Daily Monitoring**: Set up daily cron jobs with the CLI 2. **Alerting**: Add threshold-based alerts for high failure rates 3. **Integration**: Connect to real Sponge API for production data 4. **Dashboards**: Embed metrics in existing monitoring systems 5. **Automation**: Use CLI in CI/CD pipelines for health checks ## ๐Ÿ†˜ Need Help? - Run `python simple_test.py` to verify everything is working - Check the web interface at http://localhost:8501 - All commands support `--help` for detailed usage information - Mock data provides realistic examples for learning the system **Your TFA application is ready for production use! ๐Ÿš€**