Progress Monitoring
Real-time tracking and monitoring of content generation operations
WP Automator provides comprehensive real-time monitoring capabilities for all content generation operations. This guide covers progress tracking, status indicators, performance metrics, and advanced monitoring techniques.
Real-Time Progress Tracking
Progress Indicators
Monitor operations with detailed progress information:
Percentage Complete
Visual progress bars with exact percentages
Items Processed
Current item / Total items counter
Time Estimates
ETA based on current processing rate
Live Status
Real-time status updates for each item
Progress Bar Components
Understanding progress visualization:
interface ProgressData {
// Overall progress
totalItems: number;
completedItems: number;
failedItems: number;
pendingItems: number;
// Current item
currentItem: string;
currentProgress: number;
currentStatus: 'processing' | 'completed' | 'failed';
// Time tracking
startTime: Date;
estimatedCompletion: Date;
averageTimePerItem: number;
// Performance
successRate: number;
processingRate: number;
}
Streaming Progress Updates
Server-Sent Events (SSE)
Real-time progress streaming implementation:
// Connect to progress stream
const eventSource = new EventSource('/api/progress/stream');
eventSource.onmessage = (event) => {
const progress = JSON.parse(event.data);
updateProgressUI(progress);
};
eventSource.addEventListener('complete', (event) => {
console.log('Operation complete:', event.data);
eventSource.close();
});
eventSource.onerror = (error) => {
console.error('Progress stream error:', error);
handleStreamError(error);
};
// Server-side progress streaming
export async function GET(request: Request) {
const stream = new ReadableStream({
async start(controller) {
const encoder = new TextEncoder();
// Send progress updates
const sendProgress = (data: any) => {
controller.enqueue(
encoder.encode(`data: ${JSON.stringify(data)}\n\n`)
);
};
// Monitor operation
await monitorOperation(sendProgress);
// Send completion
controller.enqueue(
encoder.encode('event: complete\ndata: done\n\n')
);
controller.close();
}
});
return new Response(stream, {
headers: {
'Content-Type': 'text/event-stream',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive'
}
});
}
Event Types:
progress:
- percentage: 0-100
- message: Current operation
- itemsCompleted: number
- totalItems: number
item-complete:
- itemId: string
- status: success | failed
- duration: milliseconds
- details: object
error:
- message: string
- itemId: string
- retryable: boolean
- errorCode: string
complete:
- totalTime: milliseconds
- successCount: number
- failureCount: number
- summary: object
Performance Note: Server-Sent Events provide low-latency updates with minimal overhead, perfect for progress monitoring.
Progress Dashboard
Visual Monitoring Interface
Comprehensive dashboard components:
Overall Progress
Master progress bar showing total completion percentage
Individual Items
List view with status icons for each item
Performance Metrics
Real-time charts showing processing rate
Error Summary
Failed items with retry options
Status Color Coding
Visual status indicators:
/* Status color system */
.status-pending { background: #6b7280; } /* Gray - Waiting */
.status-processing { background: #3b82f6; } /* Blue - Active */
.status-completed { background: #10b981; } /* Green - Success */
.status-failed { background: #ef4444; } /* Red - Failed */
.status-warning { background: #f59e0b; } /* Yellow - Warning */
.status-retrying { background: #8b5cf6; } /* Purple - Retrying */
Operation States
State Machine
Understanding operation lifecycle:
stateDiagram-v2
[*] --> Queued
Queued --> Processing
Processing --> Validating
Validating --> Generating
Generating --> Publishing
Publishing --> Completed
Publishing --> Failed
Failed --> Retrying
Retrying --> Processing
Failed --> [*]
Completed --> [*]
State Transitions
Track detailed state changes:
const operationStates = {
QUEUED: {
description: "Waiting to start",
canCancel: true,
canRetry: false,
expectedDuration: null
},
PROCESSING: {
description: "Actively processing",
canCancel: true,
canRetry: false,
expectedDuration: "30-60s"
},
VALIDATING: {
description: "Checking requirements",
canCancel: false,
canRetry: false,
expectedDuration: "5-10s"
},
GENERATING: {
description: "Creating content",
canCancel: false,
canRetry: false,
expectedDuration: "20-40s"
},
PUBLISHING: {
description: "Sending to WordPress",
canCancel: false,
canRetry: true,
expectedDuration: "5-15s"
},
COMPLETED: {
description: "Successfully finished",
canCancel: false,
canRetry: false,
expectedDuration: null
},
FAILED: {
description: "Operation failed",
canCancel: false,
canRetry: true,
expectedDuration: null
}
};
// State transition logging
const transitions = [
{
from: "QUEUED",
to: "PROCESSING",
timestamp: "2024-01-15T10:00:00Z",
trigger: "worker_assigned"
},
{
from: "PROCESSING",
to: "VALIDATING",
timestamp: "2024-01-15T10:00:05Z",
trigger: "processing_complete"
},
{
from: "VALIDATING",
to: "GENERATING",
timestamp: "2024-01-15T10:00:08Z",
trigger: "validation_passed"
},
{
from: "GENERATING",
to: "PUBLISHING",
timestamp: "2024-01-15T10:00:35Z",
trigger: "content_ready"
},
{
from: "PUBLISHING",
to: "COMPLETED",
timestamp: "2024-01-15T10:00:42Z",
trigger: "publish_success"
}
];
Persistence Strategy:
Database:
- Current state
- State history
- Transition timestamps
- Error details
Cache:
- Active operations
- Recent completions
- Performance metrics
Session Storage:
- UI state
- Filter preferences
- Sort order
Performance Metrics
Key Performance Indicators
Monitor operation efficiency:
Throughput
Articles processed per minute/hour
Success Rate
Percentage of successful operations
Average Duration
Mean time per article generation
Queue Time
Average wait time before processing
Metric Calculation
// Performance metric calculations
const metrics = {
throughput: {
formula: "completedItems / elapsedTime",
unit: "items/minute",
threshold: { good: 10, warning: 5, critical: 2 }
},
successRate: {
formula: "(successCount / totalCount) * 100",
unit: "percentage",
threshold: { good: 95, warning: 85, critical: 70 }
},
avgDuration: {
formula: "totalProcessingTime / completedItems",
unit: "seconds",
threshold: { good: 30, warning: 60, critical: 120 }
},
queueTime: {
formula: "sum(waitTimes) / totalItems",
unit: "seconds",
threshold: { good: 5, warning: 30, critical: 60 }
}
};
Advanced Monitoring Features
Predictive Analytics
Intelligent completion estimates:
Historical Analysis
- Analyze past performance
- Identify patterns
- Calculate baselines
Current Rate Calculation
- Monitor real-time speed
- Detect slowdowns
- Adjust estimates
Prediction Algorithm
- Weight recent performance
- Factor in queue size
- Consider time of day
Confidence Intervals
- Best case scenario
- Expected completion
- Worst case scenario
Anomaly Detection
Identify unusual patterns:
Anomaly Types:
Performance:
- Sudden slowdown (>50% decrease)
- Unusual error spike
- Memory consumption increase
- Network latency issues
Content:
- Duplicate detection
- Quality score drops
- Unusual word counts
- Failed validations
System:
- API rate limiting
- Database congestion
- Worker failures
- Resource exhaustion
Alert Triggers:
- Immediate: Critical failures
- 5 minutes: Performance degradation
- 15 minutes: Trend deviations
- Hourly: Summary reports
Alert Fatigue: Configure thresholds carefully to avoid excessive notifications while maintaining awareness of issues.
Progress Notifications
Notification Channels
Stay informed about operation progress:
In-App Notifications
Real-time updates in the dashboard
Email Updates
Milestone notifications and summaries
Browser Notifications
Desktop alerts for important events
Webhook Integration
Send progress to external systems
Notification Configuration
// Notification preferences
const notificationSettings = {
channels: {
inApp: true,
email: true,
browser: false
},
events: {
operationStart: ['inApp'],
milestone25: ['inApp'],
milestone50: ['inApp', 'email'],
milestone75: ['inApp'],
operationComplete: ['inApp', 'email'],
operationFailed: ['inApp', 'email']
},
batching: {
enabled: true,
interval: 300, // 5 minutes
maxBatch: 10
},
quiet_hours: {
enabled: true,
start: "22:00",
end: "08:00",
timezone: "America/New_York"
}
};
Queue Management
Queue Visualization
Monitor queue status:
Queue Status:
Total Items: 156
Processing: 5
Pending: 145
Failed: 6
Estimated Time:
Current Rate: 2 items/minute
Time Remaining: ~73 minutes
Completion: 11:45 AM
Resource Usage:
Workers: 5/10 active
Memory: 2.3GB/4GB
CPU: 65%
Priority Distribution:
Critical (P0): 2 items
High (P1): 15 items
Normal (P2): 120 items
Low (P3): 13 items
Processing Order:
1. All P0 items
2. P1 items (FIFO)
3. P2/P3 interleaved
Failed Items:
Total: 6
Reasons:
- API Error: 2
- Validation Failed: 2
- Timeout: 1
- Unknown: 1
Actions:
- Retry All
- Retry Selected
- Export Failed
- Clear Queue
Historical Analysis
Progress History
Review past operations:
// Historical data structure
const operationHistory = {
operations: [
{
id: "op_123",
date: "2024-01-15",
type: "bulk_generation",
items: 100,
duration: 3600000, // 1 hour
successRate: 98,
averageTime: 35, // seconds per item
articlesGenerated: 100
}
],
analytics: {
trends: {
daily_average: 500,
weekly_total: 3500,
monthly_total: 15000
},
performance: {
best_day: "2024-01-10",
worst_day: "2024-01-05",
peak_hour: "10:00 AM",
quiet_hour: "3:00 AM"
}
}
};
Trend Analysis
Identify patterns over time:
Daily Patterns
Peak hours and quiet periods
Weekly Trends
Busiest days and workload distribution
Monthly Cycles
Seasonal variations and growth trends
Performance Evolution
Speed improvements and optimization impact
Troubleshooting Progress Issues
Common Issues
Debug Mode: Enable detailed logging to diagnose progress tracking issues.
Resolution guide for progress problems:
Issue | Cause | Solution |
---|---|---|
Progress stuck at 0% | Queue not processing | Check worker status |
No real-time updates | SSE connection failed | Verify network/firewall |
Incorrect time estimates | Variable processing speed | Adjust calculation window |
Missing progress bars | UI rendering issue | Clear cache, reload |
Duplicate progress events | Multiple connections | Implement deduplication |
Best Practices
Progress Monitoring Guidelines
- Set Realistic Expectations: Display conservative time estimates
- Provide Context: Show what's currently being processed
- Handle Failures Gracefully: Clear error messages with retry options
- Optimize Update Frequency: Balance real-time feel with performance
- Maintain History: Keep logs for troubleshooting
- Test Edge Cases: Large batches, network issues, timeouts
- Implement Fallbacks: Polling backup for SSE failures
Pro Tip: Use progress monitoring data to identify optimization opportunities and improve overall system performance.
Next Steps
Enhance your monitoring capabilities:
- Error Handling for failure recovery
- Batch Operations for large-scale processing
- Troubleshooting Guide for issue resolution
Need assistance with progress monitoring? Our support team can help configure advanced monitoring features for your workflow.
Last updated on