Skip to main content

Communication: hbf-stats

1-hop view of how this service communicates with its siblings. For the full system view, see service-communication.md.

Calls Out To

ServiceProtocolPurposeKey calls / queues
hbf-coreHTTP (hbf-core-api)Tenant polling, stats write-back, org timezone, analytics summaryTenantsClient.list() (statsUpdateLessThan filter), TenantsClient.createOrUpdateStats(), organization timezone fetch, analytics summary fetch

Called By

Daemon service. Not called by other services.

Daemon Loop

  • Polls hbf-core for tenants with stale stats (EXECUTION_TIME_INTERVAL_MILLISECONDS)
  • Fetches analytics summary for daily (60 days) and monthly (13 months) periods per tenant
  • Writes aggregated stats back via TenantsClient.createOrUpdateStats()
  • Processes in configurable batch size with BATCH_COOLDOWN_SECONDS pause between batches

Contracts

Inbound

None. This is a daemon with no inbound API.

Outbound

TargetAuthEnv Vars
hbf-coreBearer token (CORE_TOKEN)CORE_URL, CORE_TOKEN

Additional env vars: EXECUTION_TIME_INTERVAL_MILLISECONDS, BATCH_COOLDOWN_SECONDS

Flows Involving This Service