feat(freshness): enhance diagnostics and update snapshot structure
- Introduced a new Diagnostics struct to capture transaction visibility state and activity state. - Updated BuildSnapshot function to return diagnostics alongside snapshot, completeness, and sampling. - Enhanced test cases to validate the new diagnostics data. - Updated frontend components to utilize the new diagnostics information for improved user feedback on freshness context. This change improves the observability of transaction activity and enhances the user experience by providing clearer insights into the freshness of data.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { getExplorerApiBase } from './blockscout'
|
||||
import type { ExplorerFreshnessDiagnostics } from './stats'
|
||||
|
||||
export interface MissionControlRelaySummary {
|
||||
text: string
|
||||
@@ -99,6 +100,7 @@ export interface MissionControlBridgeStatusResponse {
|
||||
status?: string
|
||||
checked_at?: string
|
||||
freshness?: unknown
|
||||
diagnostics?: ExplorerFreshnessDiagnostics | null
|
||||
sampling?: {
|
||||
stats_generated_at?: string | null
|
||||
rpc_probe_at?: string | null
|
||||
@@ -150,6 +152,11 @@ function describeRelayStatus(snapshot: MissionControlRelaySnapshot, status: stri
|
||||
? 'underfunded queued release'
|
||||
: 'underfunded release'
|
||||
}
|
||||
if (snapshot.last_error?.scope === 'bridge_inventory_probe') {
|
||||
return snapshot.queue?.size && snapshot.queue.size > 0
|
||||
? 'inventory check deferred'
|
||||
: 'inventory check pending'
|
||||
}
|
||||
if (status === 'paused' && snapshot.monitoring?.delivery_enabled === false) {
|
||||
return snapshot.queue?.size && snapshot.queue.size > 0 ? 'delivery paused (queueing)' : 'delivery paused'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user