Track and analyze all scraper executions
Complete audit trail of all scraper executions in the WebHarvest IDE. Every execution is tracked with full metrics, performance data, and results.
Complete audit trail of all scraper executions
Production-Ready: Duration, Elements, Processing Rate, Session History
Simulated (Demo): HTTP Metrics, Plugin Breakdown - Real tracking in v2.3.0
All sessions stored in memory during IDE runtime
Duration, elements processed, processing rate
By status, pagination, time range
Programmatic access via HTTP endpoint
http://localhost:8080# Get last 20 sessions
curl http://localhost:8080/api/sessions/history
# Get only completed sessions
curl http://localhost:8080/api/sessions/history?status=COMPLETED
# Pagination
curl http://localhost:8080/api/sessions/history?limit=50&offset=0
Returns list of executed sessions with full metrics.
| Parameter | Type | Default | Description |
|---|---|---|---|
limit |
integer | 20 | Maximum sessions to return (max: 100) |
offset |
integer | 0 | Skip first N sessions (pagination) |
status |
string | - | Filter by status (COMPLETED, FAILED, etc.) |
{
"sessions": [
{
"sessionId": "abc123-def456-789...",
"timestamp": "2025-10-13T12:00:00Z",
"status": "COMPLETED",
"duration": 150,
"configName": "data-scraper.xml",
"elementsProcessed": 25,
"processingRate": 166.67
}
],
"total": 42,
"limit": 20,
"offset": 0
}
| Field | Type | Description |
|---|---|---|
sessionId |
string (UUID) | Unique session identifier |
timestamp |
string (ISO 8601) | Session start time (UTC) |
status |
enum | COMPLETED, FAILED, RUNNING, PENDING, CANCELLED |
duration |
long | Execution duration in milliseconds |
configName |
string | Name of executed configuration file |
elementsProcessed |
integer | Number of variables/elements processed |
processingRate |
double | Elements per second |
Track execution times across multiple runs:
// Fetch history
const response = await fetch('/api/sessions/history?limit=100');
const data = await response.json();
// Calculate average duration
const avgDuration = data.sessions
.reduce((sum, s) => sum + s.duration, 0) / data.sessions.length;
console.log(`Average execution time: ${avgDuration}ms`);
Filter only failed sessions:
curl "http://localhost:8080/api/sessions/history?status=FAILED" | jq
Export complete execution history:
// Get all sessions
const history = await fetch('/api/sessions/history?limit=1000')
.then(r => r.json());
// Export to CSV
const csv = ['Timestamp,Config,Status,Duration,Elements']
.concat(history.sessions.map(s =>
`${s.timestamp},${s.configName},${s.status},${s.duration},${s.elementsProcessed}`
))
.join('\n');
// Download
const blob = new Blob([csv], {type: 'text/csv'});
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'session-history.csv';
a.click();
Calculate success/failure ratio:
const sessions = await fetch('/api/sessions/history?limit=100')
.then(r => r.json());
const completed = sessions.sessions.filter(s => s.status === 'COMPLETED').length;
const failed = sessions.sessions.filter(s => s.status === 'FAILED').length;
const total = sessions.total;
console.log(`Success rate: ${(completed / total * 100).toFixed(1)}%`);
console.log(`Failure rate: ${(failed / total * 100).toFixed(1)}%`);
Set up periodic checks for jobs that run too long:
setInterval(async () => {
const response = await fetch('/api/sessions/history?limit=1');
const latest = await response.json();
const session = latest.sessions[0];
if (session.status === 'RUNNING' && session.duration > 60000) {
console.warn('Job running >60s:', session.sessionId);
// Alert or take action
}
}, 5000); // Check every 5 seconds
Compare current runs to historical average:
async function isSlowerThanUsual(currentDuration, configName) {
const history = await fetch('/api/sessions/history?limit=50')
.then(r => r.json());
const similar = history.sessions
.filter(s => s.configName === configName && s.status === 'COMPLETED');
const avgDuration = similar.reduce((sum, s) => sum + s.duration, 0)
/ similar.length;
return currentDuration > avgDuration * 1.5; // 50% slower
}
┌─────────────────────────────────────────────┐ │ Session History 6 sessions │ ├─────────────────────────────────────────────┤ │ ✓ COMPLETED 2025-10-13 14:20:00 │ │ 📄 05_data_pipeline.xml │ │ ⏱ 165ms 📦 9 elements ⚡ 54.5 elem/s │ │ 🔑 97266a7e... │ ├─────────────────────────────────────────────┤ │ ✓ COMPLETED 2025-10-13 14:18:30 │ │ 📄 03_json_api.xml │ │ ⏱ 320ms 📦 15 elements ⚡ 46.9 elem/s │ │ 🔑 37e37905... │ ├─────────────────────────────────────────────┤ │ ✗ FAILED 2025-10-13 14:15:10 │ │ 📄 invalid_config.xml │ │ ⏱ 5ms 📦 0 elements ⚡ 0.0 elem/s │ │ 🔑 fa860c00... │ └─────────────────────────────────────────────┘ │ [🔄 Refresh] │ └─────────────────────────────────────────────┘