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

60 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# Load shared libraries
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/../../lib/init.sh"
# Collect developer experience metrics
set -e
METRICS_FILE="docs/metrics-data.json"
OUTPUT_FILE="docs/metrics-reports/developer-$(date +%Y-%m-%d).json"
echo "📊 Collecting Developer Experience Metrics..."
echo ""
mkdir -p docs/metrics-reports
# Initialize metrics object
cat > "$OUTPUT_FILE" << 'EOF'
{
"date": "",
"developerExperience": {
"onboardingTime": {
"baseline": null,
"current": null,
"reduction": null,
"target": 50
},
"developerSatisfaction": {
"current": null,
"target": 80,
"surveyResponses": null
},
"documentationCoverage": {
"totalProjects": null,
"documentedProjects": null,
"percentage": 100,
"target": 90
}
}
}
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 "📝 Developer experience metrics template created: $OUTPUT_FILE"
echo ""
echo "💡 To collect metrics:"
echo " 1. Track onboarding times for new developers"
echo " 2. Conduct developer satisfaction survey"
echo " 3. Audit documentation coverage"
echo " 4. Update values in $OUTPUT_FILE"
echo " 5. Run: ./scripts/update-metrics.sh developer"