Skip to content

Historical Data

jolt can track battery and power data over time, enabling analysis of usage patterns and trends.

History collection requires the daemon to be running:

Terminal window
jolt daemon start

Or enable auto-start:

Terminal window
jolt daemon install

Get an overview of collected data:

Terminal window
jolt history summary

Shows:

  • Total records
  • Date range
  • Average battery level
  • Average power consumption
  • Peak power usage

Filter by time period:

Terminal window
# Today's data
jolt history summary --period today
# Last 7 days
jolt history summary --period week
# Last 30 days
jolt history summary --period month
# All data
jolt history summary --period all

See which processes used the most energy:

Terminal window
jolt history top

Options:

Terminal window
# More results
jolt history top --limit 20
# Specific time period
jolt history top --period week
# Sort by CPU time instead of energy
jolt history top --sort cpu

Export historical data to JSON:

Terminal window
# Export all data
jolt history export --output data.json
# Export specific period
jolt history export --period week --output week.json
# Export with process data
jolt history export --include-processes --output full.json
{
"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
}
}
]
}
Terminal window
jolt history summary

Shows database size and record count.

Remove data older than a specified number of days:

Terminal window
# Remove data older than 30 days
jolt history prune --older-than 30
# Dry run (show what would be removed)
jolt history prune --older-than 30 --dry-run
Terminal window
jolt history clear

History settings in config file:

macOS: ~/Library/Application Support/jolt/config.toml Linux: ~/.config/jolt/config.toml

[history]
# Enable history collection
enabled = true
# Days to retain data (0 = forever)
retention_days = 30
# Sample interval in seconds
sample_interval = 60
# Include process snapshots
include_processes = true
# Maximum database size in MB (0 = unlimited)
max_size_mb = 500

With retention_days set, old data is automatically pruned:

[history]
retention_days = 30 # Auto-delete data older than 30 days

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

The main TUI graph can show historical data:

  1. Press g to toggle graph metric
  2. Press [ / ] to change time range
  3. Scroll through history with < / >

For long-term storage efficiency, jolt aggregates old data:

AgeResolution
< 24 hoursFull resolution
1-7 daysHourly averages
7-30 days4-hour averages
> 30 daysDaily averages

This keeps the database size manageable while preserving useful trends.

Use exported data in your own scripts:

Terminal window
# Get today's average power
jolt history export --period today --output - | \
jq '.samples | map(.power.total_watts) | add / length'
# Find peak battery drain
jolt history export --period week --output - | \
jq '.samples | max_by(.power.total_watts)'