{# Overview panel: disk capacity forecast from hourly rollups (services.forecast). Context: smp, rules #} {% set fc = smp.get('forecast') or {} %} {% set slope = fc.get('disk_slope_pct_per_day') %}{% set eta = fc.get('disk_eta_days') %}{% set now_pct = fc.get('disk_now') %}{% set series = fc.get('disk_series') or [] %}
Disk forecast · worst mount, {{ fc.get('window_days', 7) }}-day trend
{% if slope is none %}
Not enough history yet: the forecast needs at least 6 hourly rollups (about 6 h of reporting).
{% else %} {% if eta is not none and slope > 0 %}
Disk full in ~{{ eta|round(0)|int if eta >= 2 else eta }} day{{ 's' if eta != 1 }} at the current rate (+{{ '%.2f'|format(slope) }} %/day)
{{ now_pct }}% used now{% if fc.get('disk_eta_threshold_days') is not none %} · reaches the {{ fc.get('disk_threshold') }}% alert threshold in {{ fc.disk_eta_threshold_days }} days{% endif %} · alert when ≤ {{ rules.get('disk_forecast_days', 7) }} days
{% else %}
Disk usage stable ({{ '%+.2f'|format(slope) }} %/day, {{ now_pct }}% used)
No growth trend over the last {{ fc.get('disk_days', 7) }} days.
{% endif %} {% if series|length >= 2 %} {# history in the left 60 % of the chart, projection (dashed) for the same span of days on the right #} {% set n = series|length %}{% set hist_w = 360 %}{% set days = fc.get('disk_days') or 1 %} {% set last = series[-1] %}{% set proj_end = [[last + (slope or 0) * days, 100]|min, 0]|max %} {% for g in (25, 50, 75) %}{% endfor %} {% if rules.get('disk_pct') %}{% endif %}
{{ days|round(1) }} days of historynowprojection +{{ days|round(1) }} days
{% endif %} {% if fc.get('mem_slope_pct_per_day') is not none %}
Memory: {{ '%+.2f'|format(fc.mem_slope_pct_per_day) }} %/day{% if fc.get('mem_eta_days') is not none and fc.mem_slope_pct_per_day > 0 %} · full in ~{{ fc.mem_eta_days|round(0)|int }} days{% else %} · stable{% endif %}
{% endif %} {% endif %}