Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Separate reporting generation days from successful repeat periods

[email protected]7e502b5c9275
diff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.md
index b6b71720dd..96e0b5f652 100644
--- a/docs/release-control/v6/internal/subsystems/security-privacy.md
+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md
@@ -30,12 +30,15 @@ the installation through the existing opt-out-controlled heartbeat. Local tally
errors never fail reporting. Mock mode never records real reporting activity.
Generation counts include separate attempts and complete direct response writes.
-Distinct successful-generation days also measure returning manual use, with
-same-day attempts counted once. Saved files, SMTP acceptance, definite failures
-and uncertain acceptance remain
-separate. Persisted successful saved-schedule windows count once. Repeat use
-requires a different window on that schedule within 90 days, including monthly
-reuse, so retries and same-period reruns do not inflate adoption. The aggregate
+Distinct successful-generation days measure activity, including manual downloads
+and scheduled retries, with same-day attempts counted once. Multiple days alone
+cannot establish a fresh successful period or returning manual use. The adoption
+summary keeps multi-day generation separate from successful repeat periods.
+Saved files, SMTP acceptance, definite failures and uncertain acceptance remain
+separate. Persisted successful saved-schedule windows count once. A successful
+repeat period requires a different window on that schedule within 90 days,
+including monthly reuse, so retries and same-period reruns do not inflate that
+period metric. The aggregate
query uses only each eligible rotating ID's latest counts and marks old-schema,
missing-column and unavailable-tally data unmeasured. Elapsed observation days do
not establish continuous uptime, and SMTP acceptance does not prove inbox receipt.
diff --git a/scripts/telemetry_adoption_report.py b/scripts/telemetry_adoption_report.py
index 9bf5945757..c2a6b82485 100644
--- a/scripts/telemetry_adoption_report.py
+++ b/scripts/telemetry_adoption_report.py
@@ -2885,7 +2885,7 @@ def summarize_reporting_usage(
cohorts = {
posture: {"reporting_ids": 0, "covered_ids": 0, "unmeasured_ids": 0,
"partial_observation_ids": 0, "full_30d_observation_ids": 0,
- "ids_with_generated_reports": 0, "ids_with_repeat_periods": 0, "ids_with_repeat_use": 0,
+ "ids_with_generated_reports": 0, "ids_with_repeat_periods": 0, "ids_with_multiple_generation_days": 0,
"counts": dict.fromkeys(REPORTING_USAGE_COUNT_FIELDS, 0)}
for posture in ("nonfree", "free", "unknown")
}
@@ -2920,9 +2920,10 @@ def summarize_reporting_usage(
cohort["ids_with_generated_reports"] += 1
if any(count for field, count in counts.items() if field.startswith("reporting_repeat_")):
cohort["ids_with_repeat_periods"] += 1
- if (any(count for field, count in counts.items() if field.startswith("reporting_repeat_"))
- or any(count > 1 for field, count in counts.items() if "_active_days_" in field)):
- cohort["ids_with_repeat_use"] += 1
+ # Cross-day retries can generate again without another successful
+ # reporting period. Keep generation-day activity separate from reuse.
+ if any(count > 1 for field, count in counts.items() if "_active_days_" in field):
+ cohort["ids_with_multiple_generation_days"] += 1
return {"window": "7d", "minimum_schema_version": 20,
"counter_window_utc_days": 30, "repeat_marker_retention_days": 90,
"source_available": source_available, "excluded_ids": excluded, "cohorts": cohorts}
@@ -3790,8 +3791,8 @@ def format_text(summary: dict[str, Any], repo: str, since_days: int) -> str:
f"{cohort['unmeasured_ids']} unmeasured, "
f"{cohort['full_30d_observation_ids']} with 30 elapsed observation days, "
f"{cohort['ids_with_generated_reports']} generating reports, "
- f"{cohort['ids_with_repeat_periods']} with repeat reporting periods, "
- f"{cohort['ids_with_repeat_use']} with repeat use"
+ f"{cohort['ids_with_repeat_periods']} with repeat successful reporting periods, "
+ f"{cohort['ids_with_multiple_generation_days']} generating on multiple days"
)
for field, count in cohort["counts"].items():
lines.append(f" - {field}: {count}")
@@ -3799,7 +3800,8 @@ def format_text(summary: dict[str, Any], repo: str, since_days: int) -> str:
"- interpretation: schema v20+ and available tally only. Missing measurements are unknown, "
"not zero use. Latest rolling 30 UTC-day totals only, never summed heartbeats. "
"Active-day counts show distinct UTC days with successful generation, including manual downloads. "
- "Multiple attempts in one day count as one active day. "
+ "Multiple attempts in one day count as one active day. Cross-day generation may include "
+ "retries, so multiple active days alone do not establish a fresh successful period or returning manual use. "
"Generation and delivery counts include separate attempts. Successful periods require a persisted "
"successful saved-schedule run. Repeat periods require another distinct window on the same schedule "
"within 90 days, so retries and same-period reruns do not qualify. "
diff --git a/scripts/tests/test_telemetry_adoption_report.py b/scripts/tests/test_telemetry_adoption_report.py
index 95d44e4fec..77006e39be 100644
--- a/scripts/tests/test_telemetry_adoption_report.py
+++ b/scripts/tests/test_telemetry_adoption_report.py
@@ -32,26 +32,41 @@ class TelemetryAdoptionReportTest(unittest.TestCase):
"reporting_telemetry_available": 1, "reporting_observation_days": 30,
"reporting_generated_backup_health_30d": 4,
"reporting_backup_health_active_days_30d": 2,
+ "reporting_successful_backup_health_periods_30d": 2,
"reporting_repeat_backup_health_periods_30d": 1}
rows = [{**base, "install_id": "measured"},
{**base, "install_id": "measured", "received_at": "2026-10-16 11:00:00", "reporting_generated_backup_health_30d": 3},
- {**base, "install_id": "new", "reporting_observation_days": 1},
+ {**base, "install_id": "new", "reporting_observation_days": 1, "reporting_backup_health_active_days_30d": 1},
{**base, "install_id": "legacy", "schema_version": 19},
{**base, "install_id": "unavailable", "reporting_telemetry_available": 0},
{**base, "install_id": "inactive", "monitoring_active": 0},
{**base, "install_id": "dev", "version_is_development": 1}]
- usage = report.summarize_rows({}, rows, {"6.6.0"}, now=now)["reporting_usage_7d"]
+ summary = report.summarize_rows({}, rows, {"6.6.0"}, now=now)
+ usage = summary["reporting_usage_7d"]
cohort = usage["cohorts"]["nonfree"]
self.assertEqual((cohort["covered_ids"], cohort["unmeasured_ids"]), (2, 2))
self.assertEqual((cohort["full_30d_observation_ids"], cohort["partial_observation_ids"]), (1, 1))
self.assertEqual(cohort["counts"]["reporting_generated_backup_health_30d"], 8)
self.assertEqual(cohort["ids_with_repeat_periods"], 2)
- self.assertEqual(cohort["ids_with_repeat_use"], 2)
- manual = {**base, "install_id": "manual", "reporting_repeat_backup_health_periods_30d": 0}
- manual_cohort = report.summarize_reporting_usage(
- {"manual": manual}, {"6.6.0"}, now=now)["cohorts"]["nonfree"]
- self.assertEqual(manual_cohort["ids_with_repeat_periods"], 0)
- self.assertEqual(manual_cohort["ids_with_repeat_use"], 1)
+ self.assertEqual(cohort["ids_with_multiple_generation_days"], 1)
+ generation_only = {**base, "install_id": "generation-only",
+ "reporting_successful_backup_health_periods_30d": 0,
+ "reporting_repeat_backup_health_periods_30d": 0,
+ "reporting_delivery_failed_30d": 4}
+ activity_cohort = report.summarize_reporting_usage(
+ {"generation-only": generation_only}, {"6.6.0"}, now=now)["cohorts"]["nonfree"]
+ self.assertEqual(activity_cohort["ids_with_repeat_periods"], 0)
+ self.assertEqual(activity_cohort["ids_with_multiple_generation_days"], 1)
+ self.assertNotIn("ids_with_repeat_use", activity_cohort)
+ same_day_periods = {**base, "reporting_backup_health_active_days_30d": 1}
+ periods_cohort = report.summarize_reporting_usage(
+ {"same-day-periods": same_day_periods}, {"6.6.0"}, now=now)["cohorts"]["nonfree"]
+ self.assertEqual(periods_cohort["ids_with_repeat_periods"], 1)
+ self.assertEqual(periods_cohort["ids_with_multiple_generation_days"], 0)
+ text = report.format_text(summary, "rcourtman/Pulse", 7)
+ self.assertIn("generating on multiple days", text)
+ self.assertIn("Cross-day generation may include retries", text)
+ self.assertNotIn("with repeat use", text)
self.assertEqual(usage["excluded_ids"], 2)
unavailable = report.summarize_rows({}, rows, {"6.6.0"}, now=now,
unavailable_columns=["reporting_saved_30d"])["reporting_usage_7d"]