67 lines
1.5 KiB
Bash
Executable File
67 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Load shared libraries
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "$SCRIPT_DIR/../../lib/init.sh"
|
|
|
|
# Collect operational metrics
|
|
|
|
set -e
|
|
|
|
METRICS_FILE="docs/metrics-data.json"
|
|
OUTPUT_FILE="docs/metrics-reports/operational-$(date +%Y-%m-%d).json"
|
|
|
|
echo "📊 Collecting Operational Metrics..."
|
|
echo ""
|
|
|
|
mkdir -p docs/metrics-reports
|
|
|
|
# Initialize metrics object
|
|
cat > "$OUTPUT_FILE" << 'EOF'
|
|
{
|
|
"date": "",
|
|
"operational": {
|
|
"uptime": {
|
|
"current": null,
|
|
"target": 99.9,
|
|
"downtime": null
|
|
},
|
|
"incidentReduction": {
|
|
"baseline": null,
|
|
"current": null,
|
|
"reduction": null,
|
|
"target": 50
|
|
},
|
|
"incidentResolution": {
|
|
"baseline": null,
|
|
"current": null,
|
|
"improvement": null,
|
|
"target": 80
|
|
},
|
|
"operationalOverhead": {
|
|
"baseline": null,
|
|
"current": null,
|
|
"reduction": null,
|
|
"target": 20
|
|
}
|
|
}
|
|
}
|
|
EOF
|
|
|
|
# Update date
|
|
if command -v jq &> /dev/null; then
|
|
jq ".date = \"$(date -Iseconds)\"" "$OUTPUT_FILE" > "$OUTPUT_FILE.tmp"
|
|
mv "$OUTPUT_FILE.tmp" "$OUTPUT_FILE"
|
|
fi
|
|
|
|
echo "📝 Operational metrics template created: $OUTPUT_FILE"
|
|
echo ""
|
|
echo "💡 To collect metrics:"
|
|
echo " 1. Review monitoring dashboards for uptime"
|
|
echo " 2. Count incidents from incident tracking system"
|
|
echo " 3. Calculate average incident resolution times"
|
|
echo " 4. Track operational time spent"
|
|
echo " 5. Update values in $OUTPUT_FILE"
|
|
echo " 6. Run: ./scripts/update-metrics.sh operational"
|
|
|