From cc3384c4221bc95fc57301cadfe2036ff29b5623 Mon Sep 17 00:00:00 2001 From: Sidnym Ladrut Date: Tue, 23 Jan 2024 02:55:35 +0000 Subject: [PATCH] improve time accuracy of vitals thread reports; fix bug in /lib/vitals/hoon scry path --- desk/lib/vitals.hoon | 17 +++++------------ desk/ted/vitals/connection-check.hoon | 4 +++- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/desk/lib/vitals.hoon b/desk/lib/vitals.hoon index da7489c8..8e1d916e 100644 --- a/desk/lib/vitals.hoon +++ b/desk/lib/vitals.hoon @@ -14,20 +14,13 @@ :: a ship is not guaranteed by %ames to know itself, so we fake it ?: =(ship peer) [%live time] - :: .^(* %ax /=//=/peers/[peer]) crashes if the peer is unknown, so we + :: .^(* /ax/=//=/peers/[peer]) crashes if the peer is unknown, so we :: check the source map beforehand and fake an %unborn if we can see :: a crash coming - =/ peers .^((map ^ship ?(%alien %known)) ~[%ax %$ %peers]) + =/ ames-peers=path /ax/(scot %p ship)//(scot %da time)/peers + =/ peers .^((map ^ship ?(%alien %known)) ames-peers) ?. (~(has by peers) peer) [%unborn time] - %- simplify-qos - .^ ship-state:ames - %ax - (scot %p ship) - %$ - (scot %da time) - %peers - (scot %p peer) - ~ - == + =/ pqos .^(ship-state:ames (snoc ames-peers (scot %p peer))) + (simplify-qos pqos) -- diff --git a/desk/ted/vitals/connection-check.hoon b/desk/ted/vitals/connection-check.hoon index b1e25972..7550c644 100644 --- a/desk/ted/vitals/connection-check.hoon +++ b/desk/ted/vitals/connection-check.hoon @@ -12,10 +12,10 @@ ^- form:m =+ !<([~ target=ship] arg) ;< our=@p bind:m get-our:io -;< now=@da bind:m get-time:io |^ :: early exit; check if we have live path to target ;< tqos=qos:ames bind:m (get-qos target) + ;< now=@da bind:m get-time:io ?: ?& ?=(%live -.tqos) (gth last-contact.tqos (sub now info-timeout:vitals)) == @@ -96,6 +96,7 @@ |= =pending:vitals =/ m (strand ,~) ^- form:m + ;< now=@da bind:m get-time:io %+ poke-our:io %vitals :- %update-status @@ -107,6 +108,7 @@ |= peer=ship =/ m (strand ,qos:ames) ^- form:m + ;< now=@da bind:m get-time:io ?: =(our peer) (pure:m [%live now]) ;< peers=(map ship ?(%alien %known)) bind:m