Files
scripts/metrics/generate-metrics-report.sh
2026-02-09 21:51:52 -08:00

192 lines
4.2 KiB
Bash
Executable File

#!/bin/bash
# Load shared libraries
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../lib/init.sh"
# Generate comprehensive metrics report
set -e
METRICS_FILE="docs/metrics-data.json"
REPORT_FILE="docs/METRICS_REPORT_$(date +%Y-%m-%d).md"
echo "📊 Generating Metrics Report..."
echo ""
if [ ! -f "$METRICS_FILE" ]; then
echo "❌ Metrics data file not found: $METRICS_FILE"
echo " → Run: ./scripts/track-all-metrics.sh first"
exit 1
fi
# Generate report
cat > "$REPORT_FILE" << 'EOF'
# Success Metrics Report
**Date**: DATE_PLACEHOLDER
**Purpose**: Comprehensive success metrics tracking report
**Status**: Active
---
## Executive Summary
This report tracks progress toward all success metrics for the integration and streamlining effort.
---
## Infrastructure Metrics
### Cost Reduction
- **Target**: 30-40% reduction
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
### Shared Infrastructure
- **Target**: 80% of projects migrated
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
### Infrastructure as Code
- **Target**: 100% coverage
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
---
## Code Metrics
### Shared Packages
- **Target**: 10+ packages
- **Current**: 7 packages
- **Progress**: 70%
- **Status**: ✅ On Track
### Duplicate Code Reduction
- **Target**: 50% reduction
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
### Projects Using Shared Packages
- **Target**: 80% of projects
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
---
## Deployment Metrics
### Deployment Time Reduction
- **Target**: 50% reduction
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
### Unified CI/CD
- **Target**: 90% of projects
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
---
## Developer Experience Metrics
### Onboarding Time Reduction
- **Target**: 50% reduction
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
### Developer Satisfaction
- **Target**: 80% satisfaction
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
### Documentation Coverage
- **Target**: 90% coverage
- **Current**: 100%
- **Progress**: 111%
- **Status**: ✅ Exceeded Target
---
## Operational Metrics
### Uptime
- **Target**: 99.9% uptime
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
### Incident Reduction
- **Target**: 50% reduction
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
### Incident Resolution
- **Target**: 80% faster resolution
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
### Operational Overhead Reduction
- **Target**: 20% reduction
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
---
## Service Metrics
### Duplicate Services Reduction
- **Target**: 50% reduction
- **Current**: CURRENT_PLACEHOLDER
- **Progress**: PROGRESS_PLACEHOLDER
- **Status**: STATUS_PLACEHOLDER
---
## Overall Progress
- **Total Metrics**: 15
- **Completed**: 1 (Documentation Coverage)
- **On Track**: 1 (Shared Packages)
- **Pending**: 13
- **Overall Progress**: TBD%
---
## Next Steps
1. Collect baseline data for all metrics
2. Set up automated data collection
3. Track metrics monthly
4. Report quarterly to stakeholders
5. Adjust strategies based on progress
---
**Last Updated**: DATE_PLACEHOLDER
EOF
# Update date
sed -i "s/DATE_PLACEHOLDER/$(date +%Y-%m-%d)/g" "$REPORT_FILE"
echo "✅ Metrics report generated: $REPORT_FILE"
echo ""
echo "💡 Review and update the report with actual metrics data"
echo " → Update CURRENT_PLACEHOLDER values"
echo " → Update PROGRESS_PLACEHOLDER values"
echo " → Update STATUS_PLACEHOLDER values"