Historical Data
jolt can track battery and power data over time, enabling analysis of usage patterns and trends.
Enabling History
Section titled “Enabling History”History collection requires the daemon to be running:
jolt daemon startOr enable auto-start:
jolt daemon installViewing History
Section titled “Viewing History”Summary
Section titled “Summary”Get an overview of collected data:
jolt history summaryShows:
- Total records
- Date range
- Average battery level
- Average power consumption
- Peak power usage
Time Periods
Section titled “Time Periods”Filter by time period:
# Today's datajolt history summary --period today
# Last 7 daysjolt history summary --period week
# Last 30 daysjolt history summary --period month
# All datajolt history summary --period allTop Power Consumers
Section titled “Top Power Consumers”See which processes used the most energy:
jolt history topOptions:
# More resultsjolt history top --limit 20
# Specific time periodjolt history top --period week
# Sort by CPU time instead of energyjolt history top --sort cpuExporting Data
Section titled “Exporting Data”Export historical data to JSON:
# Export all datajolt history export --output data.json
# Export specific periodjolt history export --period week --output week.json
# Export with process datajolt history export --include-processes --output full.jsonExport Format
Section titled “Export Format”{ "exported_at": "2024-01-15T10:30:00Z", "period": { "start": "2024-01-08T00:00:00Z", "end": "2024-01-15T10:30:00Z" }, "samples": [ { "timestamp": "2024-01-15T10:00:00Z", "battery": { "percentage": 85, "state": "discharging", "health": 92 }, "power": { "total_watts": 12.5, "cpu_watts": 8.2, "gpu_watts": 3.1 } } ]}Managing Storage
Section titled “Managing Storage”Check Storage Usage
Section titled “Check Storage Usage”jolt history summaryShows database size and record count.
Pruning Old Data
Section titled “Pruning Old Data”Remove data older than a specified number of days:
# Remove data older than 30 daysjolt history prune --older-than 30
# Dry run (show what would be removed)jolt history prune --older-than 30 --dry-runClearing All Data
Section titled “Clearing All Data”jolt history clearConfiguration
Section titled “Configuration”History settings in config file:
macOS: ~/Library/Application Support/jolt/config.toml
Linux: ~/.config/jolt/config.toml
[history]# Enable history collectionenabled = true
# Days to retain data (0 = forever)retention_days = 30
# Sample interval in secondssample_interval = 60
# Include process snapshotsinclude_processes = true
# Maximum database size in MB (0 = unlimited)max_size_mb = 500Automatic Pruning
Section titled “Automatic Pruning”With retention_days set, old data is automatically pruned:
[history]retention_days = 30 # Auto-delete data older than 30 daysTUI History View
Section titled “TUI History View”Press H in the TUI to open the history view:
- Browse historical data by date
- View graphs of past battery/power levels
- Compare different time periods
- See daily summaries
History Graph
Section titled “History Graph”The main TUI graph can show historical data:
- Press
gto toggle graph metric - Press
[/]to change time range - Scroll through history with
</>
Data Aggregation
Section titled “Data Aggregation”For long-term storage efficiency, jolt aggregates old data:
| Age | Resolution |
|---|---|
| < 24 hours | Full resolution |
| 1-7 days | Hourly averages |
| 7-30 days | 4-hour averages |
| > 30 days | Daily averages |
This keeps the database size manageable while preserving useful trends.
Integration with Scripts
Section titled “Integration with Scripts”Use exported data in your own scripts:
# Get today's average powerjolt history export --period today --output - | \ jq '.samples | map(.power.total_watts) | add / length'
# Find peak battery drainjolt history export --period week --output - | \ jq '.samples | max_by(.power.total_watts)'