agorix
AirdropMarketsCollectionsLeaderboardActivity
Agorix · Decentralized Marketplace
Independent · Resilient · Community-Run

A cross-chain marketplace, run by the community.

Discover, list, and trade across Bitcoin, Ethereum, and Solana on an open, community-run network.

Marketplace
CollectionsMarketsLeaderboardActivity
Network
GovernanceExplorerAirdropDocs
Account
ProfileSettings
Legal
Terms of ServicePrivacy PolicyYour Privacy Choices
agorix.io — Lasting Access
CID: 0xA60R1X · v0.1
AirdropMarketsCollections
D
Protocol Docs
Node ArchitectureGateway Front DoorProtocol ExplorerMesh NetworkingHeartbeat SystemData ShardingSSR & ShortlinksLocal Node Telemetry Rollups
Docs/Network/Local Node Telemetry Rollups
Network

Local Node Telemetry Rollups

Time-bucketed local telemetry for mesh RTT, peer health, and node-internal metrics. How rollups stay cheap (one row per metric per peer per bucket) and feed both the explorer and gateway routing.

#Local Node Telemetry Rollups

Every node measures itself constantly: RTT to each mesh peer, heartbeat latencies, scanner loop durations, cache hit rates. Storing every individual sample would generate millions of rows per day per node and is wasteful — what matters is the aggregate over a meaningful window. The agorix_node_local_telemetry_rollups table compresses these signals into time-bucketed summaries that stay cheap to write and easy to query.

#Schema

The table is keyed by (nodeId, metric, peerNodeId, bucketSeconds, bucketStart) so a single row holds the aggregate for one metric, one peer (or empty string for node-global metrics), one bucket size, and one bucket start time:

ColumnPurpose
metricMetric name (e.g. mesh_rtt, heartbeat_latency, block_scan_ms)
peerNodeIdThe peer this sample relates to, or empty string for global metrics
bucketSecondsBucket granularity (e.g. 60 for 1-min, 300 for 5-min, 3600 for hourly)
bucketStartBucket window start timestamp
sampleCountHow many raw samples landed in this bucket
successCountHow many of those samples were classified as successful
valueSumSum of sample values (divide by sampleCount for the mean)
valueMin / valueMaxBucket extremes
sampleBitmapCompact bitmap encoding when each sample landed within the bucket — useful for sparseness detection
metadataFree-form JSONB for metric-specific extras

The composite primary key means rollup writes are pure UPSERTs — increment counters and update min/max in place, never insert duplicate rows for the same window.

#Multiple Bucket Sizes

A single metric is typically tracked at several granularities simultaneously: a 1-minute bucket for live dashboards, a 5-minute bucket for routing decisions, an hourly bucket for trends. Each granularity gets its own primary-key tuple, so storing all three costs only three small rows per peer per window.

The cleanup policy keeps high-resolution buckets only for short windows (1m for ~6h, 5m for ~24h, 1h indefinitely) — old fine-grained rows get pruned while the hourly trend stays around.

#How Metrics Reach the Table

Local writers (the gossip ping worker, scanner loops, cache instrumentation) batch their samples in memory and flush rollup deltas to PostgreSQL on a timer rather than writing per sample. This keeps the database write rate proportional to active metric+peer pairs, not raw event count.

#Where Rollups Are Used

  • Gateway routing reads the latest mesh_rtt rollups to weight cohort selection — fresh peer latencies feed directly into routing scores
  • Mesh rebalancer uses RTT trends across the last several buckets to decide whether to swap a neighbor
  • Explorer mesh tab plots min/avg/max curves directly from the rollup table without scanning raw samples
  • Misbehavior detection flags peers whose successful-sample ratio drops sharply

#Why Local-Only

Rollups stay on the originating node — they are not gossiped. Every node measures the network from its own vantage point, and the truth about RTT from node A to node B is meaningful primarily to node A. Aggregating across nodes would either double-count or smear the signal. The gateway and explorer combine multiple nodes' rollups when they need a network-wide view, but the storage stays decentralized.

PreviousSSR & ShortlinksNext Marketplace Overview

On this page

  • Local Node Telemetry Rollups
  • Schema
  • Multiple Bucket Sizes
  • How Metrics Reach the Table
  • Where Rollups Are Used
  • Why Local-Only