Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/server/chunked_load.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,8 @@ func (s *PacketStore) scanAndMergeChunk(rows *sql.Rows, relayPM *prefixMap, cold
// scanned to keep scanArgs aligned with the o.raw_hex column,
// and its header route feeds wireRoute (#76).
Timestamp: normalizeTimestamp(nullStrVal(obsTimestamp)),
wireRoute: wireRouteFromRawHex(obsRawHex.String),
}
cacheObservationWireEvidence(obs, obsRawHex.String)

// Same relay-hop indexing as Load and live ingest (see
// indexObservationRelayHops). relayPM is passed in from
Expand Down
16 changes: 2 additions & 14 deletions cmd/server/openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,15 @@ func routeDescriptions() map[string]routeMeta {
"GET /api/regions/observed": {Summary: "Observed scoped relay positions", Description: "Bulk Regions map snapshot with selectable 1h, 24h or 7d window. Includes unpositioned scoped relays, current identity visibility filters, conservative retained-history coverage and explicit node/scope truncation flags. Reported positions are self-reported coordinates; neighbor estimates are excluded. Window bounds end at generatedAt, the shared relay snapshot time (normally refreshed every five minutes).", Tag: "analytics", Response: schemaRef("RegionsObservedResponse"),
QueryParams: []paramMeta{{Name: "window", Description: "1h, 24h (default), or 7d", Type: "string"}},
Errors: []routeError{{Status: "400", Description: "Invalid window."}, {Status: "500", Description: "Current identity or node metadata could not be read."}, {Status: "503", Description: "Relay snapshot is unavailable or warming up."}}},
"GET /api/regions/history": {Summary: "Hourly scoped relay history", Description: "One bounded bulk snapshot for Regions timeline and equal-window comparison. Includes 504 UTC clock-hour buckets over 21 days, excluding the unfinished current hour. Counts distinct transmissions per confirmed node and scope, assigned by transmission FirstSeen; summed node counts are relay appearances. Metadata is current, or archived only when no current row exists. Current catalog identity resolution and live visibility policies apply. Coverage and truncation must be checked before interpreting changes.", Tag: "analytics", Response: schemaRef("RegionsHistoryResponse"),
Errors: []routeError{{Status: "500", Description: "Identity or node metadata could not be read."}, {Status: "503", Description: "Relay history snapshot is unavailable or warming up."}}},
"GET /api/regions/routes": {Summary: "Observed directed scoped relay steps", Description: "Paired Regions history plus bounded directed adjacent relay steps from each explicitly observed scoped flood path. The observation transport codes must match the canonical transmission frame underlying its existing scope name. Counts deduplicate transmission IDs per directed step and scope and use FirstSeen hourly buckets. Scope handoffs, RF links, complete end-to-end paths and observer/origin edges are not inferred. Independent stepNodes carry current or archived endpoint metadata. Snapshot-wide diagnostics expose skipped or incomplete evidence.", Tag: "analytics", Response: schemaRef("RegionsRoutesResponse"), Errors: []routeError{{Status: "500", Description: "Identity or endpoint metadata could not be read."}, {Status: "503", Description: "Paired relay routes snapshot is unavailable or warming up."}}},
"GET /api/config/theme": {Summary: "Get theme configuration", Description: "Returns color maps, CSS variables, and theme defaults.", Tag: "config"},
"GET /api/config/map": {Summary: "Get map configuration", Tag: "config"},
"GET /api/config/geo-filter": {Summary: "Get geo-filter configuration", Tag: "config"},

// Admin / system
"GET /api/health": {Summary: "Health check", Description: "Returns server health, uptime, and memory stats.", Tag: "admin"},
"GET /api/stats": {Summary: "Network statistics", Description: "Returns aggregate stats (node counts, packet counts, observer counts). Cached for 10s.", Tag: "admin"},
"GET /api/perf": {Summary: "Performance statistics", Description: "Returns per-endpoint request timing and slow query log. mem=1 adds the store memory breakdown, a full store walk: one scan at a time per server plus a 5 s cooldown after it, otherwise 429 with Retry-After. mem=1 also adds regionsSnapshot, the retained size of the published Regions route/membership/history/evidence snapshot (#508); it is O(published cells), takes no packet lock and is absent before the first background relay snapshot. regionsSnapshot.capture adds the transient capture state's fill against its own budgets (retained paths and interned paths, retained references with the per-hour high-water mark, retained transmissions, aggregated membership cells and identities, each against its budget, the per-transmission path and path-byte high-water marks against theirs, and per-reason capped counters -- cappedPathBytes, cappedTransmissionPaths, cappedHourReferences and cappedOverlongPaths account for cappedObservations, while cappedMembershipCells and cappedMembershipNodes are dropped memberships), since those decide whether evidence is reported as capped; regionsSnapshot.truncated is budget truncation only and regionsSnapshot.evidenceIncomplete carries evidence qualification separately (#510).", Tag: "admin",
QueryParams: []paramMeta{{Name: "mem", Description: "1 = include memoryBreakdown and regionsSnapshot (rate-limited, see description)", Type: "string"}}},
"GET /api/perf": {Summary: "Performance statistics", Description: "Returns per-endpoint request timing and slow query log. mem=1 adds the store memory breakdown, a full store walk: one scan at a time per server plus a 5 s cooldown after it, otherwise 429 with Retry-After.", Tag: "admin",
QueryParams: []paramMeta{{Name: "mem", Description: "1 = include memoryBreakdown (rate-limited, see description)", Type: "string"}}},
"GET /api/mqtt/status": {Summary: "MQTT source status", Description: "Returns per-MQTT-source connection state and counters (lastConnectUnix, lastPacketUnix, packetsTotal, etc.). Broker URL credentials (user-info, query, fragment) are masked in broker and lastError, and in a name that is a raw broker URL. Sourced from the ingestor stats file; empty list when unavailable. stale is true when the file's sampleAt is older than the /api/perf/io freshness threshold (5s) or unreadable, i.e. the rows are frozen; sampleAgeSec gives its age. (#1043, #160)", Tag: "admin"},
"GET /api/perf/ws-clients": {Summary: "WebSocket client history", Description: "Returns open WebSocket connection counts, oldest first. range accepts 24h (default), 7d or 30d; other values return 400. Samples are one minute for 24h, five minutes for 7d and fifteen minutes for 30d, with the last clients count and maximum peak in each bucket. gapBefore marks interrupted sampling; missing periods are not zero-filled. persistence.enabled and persistence.healthy indicate whether the separate history journal is saving successfully. At most 30 days are retained; history survives server/container replacement when its data directory is retained and writable. No packet database writes.", Tag: "admin",
QueryParams: []paramMeta{{Name: "range", Description: "24h (default), 7d or 30d", Type: "string"}}},
Expand Down Expand Up @@ -1016,15 +1013,6 @@ func componentSchemas() map[string]interface{} {
for name, schema := range regionsObservedSchemas() {
schemas[name] = schema
}
for name, schema := range regionsHistorySchemas() {
schemas[name] = schema
}
for name, schema := range regionsRoutesSchemas() {
schemas[name] = schema
}
for name, schema := range regionsEvidenceSchemas() {
schemas[name] = schema
}
for name, schema := range heardBySchemas() {
schemas[name] = schema
}
Expand Down
Loading
Loading