Performance Monitoring Setup Guide
Performance Monitoring Setup Guide
π― Overview
Automated performance monitoring with email alerts and data commits to repository.
What You Get:
- π§ Email alerts when TTFB > 1.5s or other performance issues
- π Weekly summary emails when everything is healthy
- π€ Auto-committed performance logs for Claude analysis
- π Historical performance tracking in
performance-logs/
π§ Required GitHub Secrets
You need to add these secrets to your GitHub repository:
Go to: GitHub.com β Your Repo β Settings β Secrets and Variables β Actions
Required Secrets:
| Secret Name | Description | Example Value |
|---|---|---|
EMAIL_USERNAME |
Your Gmail address | your.email@gmail.com |
EMAIL_PASSWORD |
Gmail App Password | abcd efgh ijkl mnop |
ALERT_EMAIL |
Where to send alerts | your.email@gmail.com |
PAGESPEED_API_KEY |
Already set | AIzaSyBfsVckRL... |
π§ Gmail Setup for Email Alerts
Step 1: Enable 2-Factor Authentication
- Go to Google Account Security
- Turn on 2-Step Verification if not already enabled
Step 2: Create App Password
- Go to Google Account Security
- Click 2-Step Verification
- Scroll down to App passwords
- Click Select app β Other (custom name)
- Enter:
Academic Website Monitor - Click GENERATE
- Copy the 16-character password (looks like:
abcd efgh ijkl mnop)
Step 3: Add Secrets to GitHub
# Go to your repo on GitHub.com
# Settings β Secrets and variables β Actions β New repository secret
EMAIL_USERNAME: your.email@gmail.com
EMAIL_PASSWORD: abcd efgh ijkl mnop # The app password from step 2
ALERT_EMAIL: your.email@gmail.com # Can be same as EMAIL_USERNAME
π How It Works
Triggers:
- After every deployment (automatic)
- Every Monday at 9 AM UTC (scheduled)
- Manual trigger (workflow_dispatch)
Process:
- Performance tests run (TTFB + PageSpeed API when available)
- Results committed to
performance-logs/performance-YYYYMMDD-HHMMSS.log - Email sent if issues detected (TTFB > 1.5s)
- Weekly summary sent every Monday if all healthy
Email Types:
π¨ Alert Email (Performance Issues):
Subject: β οΈ Academic Website Performance Alert - wevbarker.co.uk
Performance regression detected!
- Homepage TTFB: 2.3s (threshold: 1.5s)
- Action needed: Check performance-logs/performance-20250906.log
Recommended: Pull latest changes and ask Claude to analyze.
π Weekly Summary (All Good):
Subject: π Weekly Performance Report - wevbarker.co.uk
Your website performance is healthy! β
- All pages under TTFB thresholds
- Ready for academic use
- Performance data logged for trending
π Your Workflow
When You Get an Alert:
- Check email for performance alert details
- Pull latest changes:
git pull origin master - Ask Claude: βI got a performance alert, analyze the latest performance logsβ
- Claude reads the committed log file and diagnoses issues
- Fix issues based on Claudeβs recommendations
Weekly Monitoring:
- Healthy weeks: Just get summary email, no action needed
- Performance trends: Historical data building in
performance-logs/ - Academic calendar: Extra attention during busy periods (semester start, etc.)
π― Performance Thresholds
Alert Triggers:
- TTFB > 1.5 seconds (immediate alert)
- PageSpeed API errors (service issues)
- Build failures (deployment problems)
Academic Standards:
- Homepage: < 0.8s (student accessibility)
- Course pages: < 1.0s (classroom access)
- Papers/CV: < 0.6s (professional impression)
π§ Testing Your Setup
Immediate Test:
# Trigger performance monitoring manually
# Go to: GitHub Actions β Performance Monitoring β Run workflow
Email Test:
# Force an alert by temporarily lowering threshold in performance-monitor.yml
# Change: if (( $(echo "$ttfb > 1.5" | bc -l) )); then
# To: if (( $(echo "$ttfb > 0.1" | bc -l) )); then
Verify Commit:
git pull origin master
ls -la performance-logs/ # Should see new log files
π Example Performance Log Analysis
What Claude Will See:
performance-logs/performance-20250906-090045.log:
=== CURL TIMING: Homepage (https://wevbarker.co.uk/) ===
TTFB: 2.340s # This triggers alert
Total: 2.567s
Size: 42KB
=== CURL TIMING: Publications (https://wevbarker.co.uk/publications/) ===
TTFB: 0.456s # This is healthy
Total: 0.523s
Size: 43KB
Claudeβs Analysis: βI see the homepage TTFB jumped to 2.34s while other pages remain healthy at ~0.45s. This suggests a homepage-specific issue, likely a large asset or caching problem. Check for recently added images or scripts on the homepage.β
π Benefits
For You:
- β Set-and-forget monitoring - No daily maintenance
- β Proactive alerts - Know about problems before users complain
- β AI-ready analysis - Claude can diagnose issues from committed logs
- β Academic focused - Thresholds set for teaching/research needs
For Your Users:
- β Better student experience - Fast loading course materials
- β Professional impression - Quick CV/publication access
- β Mobile friendly - Performance monitored across devices
The system is now ready to deploy! Just add the GitHub secrets and youβll have professional performance monitoring for your academic website.