Skip to content

Commit

Permalink
improve time accuracy of vitals thread reports; fix bug in /lib/vital…
Browse files Browse the repository at this point in the history
…s/hoon scry path
  • Loading branch information
sidnym-ladrut committed Jan 23, 2024
1 parent b57ce3a commit cc3384c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
17 changes: 5 additions & 12 deletions desk/lib/vitals.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -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)
--
4 changes: 3 additions & 1 deletion desk/ted/vitals/connection-check.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -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))
==
Expand Down Expand Up @@ -96,6 +96,7 @@
|= =pending:vitals
=/ m (strand ,~)
^- form:m
;< now=@da bind:m get-time:io
%+ poke-our:io
%vitals
:- %update-status
Expand All @@ -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
Expand Down

0 comments on commit cc3384c

Please sign in to comment.