Pulse/internal/mock
rcourtman 9923e4b04f Pace mock churn to homelab rates and stop phantom demo change spam
The public demo wrote ~110K resource_changes rows/day (restart 60K/day,
state_transition 45K/day), making the Changes timeline unreadable and
keeping unified_resources.db churning. Four generator-level engines,
all verified with before/after soaks against scratch mock backends:

- Per-tick flap probabilities ran 43,200x/day on the 2s update loop
  (docker restart p=0.01/tick alone is ~430 restarts/day/container).
  Churn rates are now expressed as events per day per entity and
  converted per tick against the configured interval, tuned to a few
  fleet-wide events per day with dwell times long enough to see.

- The pod scheduling reconciler fought the per-tick scenario re-pin
  and fabricated a fresh random StartTime on every recovery; derived
  uptime moved backwards, which change emission records as a restart.
  The reconciler is now idempotent: stable per-pod park/reschedule
  choices, StartTime never regenerated, and only pods it parked
  itself (NodeNotReady/ClusterOffline/NodeLost) get recovered, so
  curated Pending and ImagePullBackOff stories stay put.

- Swarm cluster objects were fabricated per host under one shared
  cluster key, so registry dedupe alternated between the divergent
  candidates every poll (service renames, status flips, node
  re-parenting). One leader manager now reports services, tasks,
  secrets, configs and the node inventory, like a real control plane.

- Demo docker host profiles cycled 2 hostnames across 4 online hosts,
  collapsing canonical identities, and scripted-offline hosts had
  their sighting refreshed right at the 2 minute staleness threshold,
  sawtoothing them online/offline. Four distinct host profiles now
  exist and offline hosts keep a stably stale sighting.

Before/after soak with a live client: pre-fix ~110-160 rows/min
sustained (restart ~45/min, matching the droplet's 60K/day); post-fix
zero rows/min at steady state with the curated degraded stories
(CrashLoop payments-worker, ImagePullBackOff, offline hosts) intact.
2026-07-08 09:49:03 +01:00
..
alert_history.go alerts(history): carry alert metadata to the frontend so resourceType resolves 2026-06-11 19:53:45 +01:00
availability_fixtures.go Attach mock availability checks to services 2026-06-30 21:16:16 +01:00
canonical_api_guardrails_test.go Make fixture graph the only mock runtime API 2026-03-31 15:42:16 +01:00
config_validation.go Make demo mock cadence configurable 2026-04-11 13:50:38 +01:00
config_validation_test.go Clear all errcheck and gofmt violations so make lint gates on real findings 2026-06-09 21:42:21 +01:00
demo_scenarios.go Pace mock churn to homelab rates and stop phantom demo change spam 2026-07-08 09:49:03 +01:00
demo_scenarios_test.go Add Kubernetes RBAC inventory to the agent + canonical + UI 2026-05-25 09:25:03 +01:00
discovery_fixtures.go Tighten Discovery drawer signal 2026-05-20 15:55:19 +01:00
discovery_fixtures_test.go Seed mock Discovery fixtures 2026-05-20 14:54:19 +01:00
env_dev.go Remove 198 unreachable Go functions 2026-06-03 12:29:37 +01:00
env_release.go Gate release mock fixtures behind demo entitlement 2026-04-10 12:33:57 +01:00
fixture_graph.go alerts(history): carry alert metadata to the frontend so resourceType resolves 2026-06-11 19:53:45 +01:00
generator.go Pace mock churn to homelab rates and stop phantom demo change spam 2026-07-08 09:49:03 +01:00
generator_helpers_coverage_test.go feat: Pulse v6 release 2026-03-18 16:06:30 +00:00
generator_test.go memory(cache): extend the reclaimable split to standalone host agents 2026-06-11 21:47:30 +01:00
integration.go Remove 198 unreachable Go functions 2026-06-03 12:29:37 +01:00
integration_additional_test.go Make demo mock cadence configurable 2026-04-11 13:50:38 +01:00
integration_concurrency_test.go Clear all errcheck and gofmt violations so make lint gates on real findings 2026-06-09 21:42:21 +01:00
integration_coverage_test.go Clear all errcheck and gofmt violations so make lint gates on real findings 2026-06-09 21:42:21 +01:00
integration_release_test.go Gate release mock fixtures behind demo entitlement 2026-04-10 12:33:57 +01:00
integration_security_test.go Clear all errcheck and gofmt violations so make lint gates on real findings 2026-06-09 21:42:21 +01:00
integration_shutdown_test.go Clear all errcheck and gofmt violations so make lint gates on real findings 2026-06-09 21:42:21 +01:00
integration_test.go Make demo mock cadence configurable 2026-04-11 13:50:38 +01:00
metric_personas.go Remove 198 unreachable Go functions 2026-06-03 12:29:37 +01:00
metric_runtime.go Sharpen mock summary isolation and role shaping 2026-04-01 12:21:36 +01:00
platform_fixtures.go Remove 198 unreachable Go functions 2026-06-03 12:29:37 +01:00
platform_fixtures_test.go Attach mock availability checks to services 2026-06-30 21:16:16 +01:00
platform_support_contract_test.go Consolidate container and Kubernetes platform tabs 2026-05-24 19:20:14 +01:00
recovery_points.go Remove 198 unreachable Go functions 2026-06-03 12:29:37 +01:00
recovery_points_test.go Clear all errcheck and gofmt violations so make lint gates on real findings 2026-06-09 21:42:21 +01:00
testhelpers_test.go Clear all errcheck and gofmt violations so make lint gates on real findings 2026-06-09 21:42:21 +01:00
truenas_metrics_identity.go Remove 198 unreachable Go functions 2026-06-03 12:29:37 +01:00