Spaces:
Sleeping

TFA / USAGE_GUIDE.md
VAH6002's picture
Upload 61 files
1af9fb8 verified
|
Raw History Blame Contribute Delete
5 kB
# 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! πŸš€**