mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-06-07 06:33:06 -04:00
Merge branch 'uptime-debug-command' into 'main'
Add "uptime" debug command See merge request veilid/veilid!323
This commit is contained in:
commit
5e81379469
10 changed files with 379 additions and 85 deletions
|
@ -2588,9 +2588,17 @@
|
|||
"kind",
|
||||
"local_network_ready",
|
||||
"public_internet_ready",
|
||||
"state"
|
||||
"state",
|
||||
"uptime"
|
||||
],
|
||||
"properties": {
|
||||
"attached_uptime": {
|
||||
"description": "Uptime since last attach, empty if the node is currently detached",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
@ -2598,11 +2606,11 @@
|
|||
]
|
||||
},
|
||||
"local_network_ready": {
|
||||
"description": "If attached and there are enough eachable nodes in the routing table to perform all the actions of the LocalNetwork RoutingDomain.",
|
||||
"description": "If attached and there are enough reachable nodes in the routing table to perform all the actions of the LocalNetwork RoutingDomain.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"public_internet_ready": {
|
||||
"description": "If attached and there are enough eachable nodes in the routing table to perform all the actions of the PublicInternet RoutingDomain, including things like private/safety route allocation and DHT operations.",
|
||||
"description": "If attached and there are enough reachable nodes in the routing table to perform all the actions of the PublicInternet RoutingDomain, including things like private/safety route allocation and DHT operations.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"state": {
|
||||
|
@ -2612,6 +2620,10 @@
|
|||
"$ref": "#/definitions/AttachmentState"
|
||||
}
|
||||
]
|
||||
},
|
||||
"uptime": {
|
||||
"description": "Node uptime",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -4618,15 +4630,23 @@
|
|||
"required": [
|
||||
"local_network_ready",
|
||||
"public_internet_ready",
|
||||
"state"
|
||||
"state",
|
||||
"uptime"
|
||||
],
|
||||
"properties": {
|
||||
"attached_uptime": {
|
||||
"description": "Uptime since last attach, empty if the node is currently detached",
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"local_network_ready": {
|
||||
"description": "If attached and there are enough eachable nodes in the routing table to perform all the actions of the LocalNetwork RoutingDomain.",
|
||||
"description": "If attached and there are enough reachable nodes in the routing table to perform all the actions of the LocalNetwork RoutingDomain.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"public_internet_ready": {
|
||||
"description": "If attached and there are enough eachable nodes in the routing table to perform all the actions of the PublicInternet RoutingDomain, including things like private/safety route allocation and DHT operations.",
|
||||
"description": "If attached and there are enough reachable nodes in the routing table to perform all the actions of the PublicInternet RoutingDomain, including things like private/safety route allocation and DHT operations.",
|
||||
"type": "boolean"
|
||||
},
|
||||
"state": {
|
||||
|
@ -4636,6 +4656,10 @@
|
|||
"$ref": "#/definitions/AttachmentState"
|
||||
}
|
||||
]
|
||||
},
|
||||
"uptime": {
|
||||
"description": "Node uptime",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -31,16 +31,22 @@ class VeilidStateAttachment:
|
|||
state: AttachmentState
|
||||
public_internet_ready: bool
|
||||
local_network_ready: bool
|
||||
uptime: TimestampDuration
|
||||
attached_uptime: Optional[TimestampDuration]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
state: AttachmentState,
|
||||
public_internet_ready: bool,
|
||||
local_network_ready: bool,
|
||||
uptime: TimestampDuration,
|
||||
attached_uptime: Optional[TimestampDuration],
|
||||
):
|
||||
self.state = state
|
||||
self.public_internet_ready = public_internet_ready
|
||||
self.local_network_ready = local_network_ready
|
||||
self.uptime = uptime
|
||||
self.attached_uptime = attached_uptime
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, j: dict) -> Self:
|
||||
|
@ -49,6 +55,8 @@ class VeilidStateAttachment:
|
|||
AttachmentState(j["state"]),
|
||||
j["public_internet_ready"],
|
||||
j["local_network_ready"],
|
||||
j["uptime"],
|
||||
j["attached_uptime"],
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue