Merge pull request #6821 from urbit/yu/color-flow-debug

dbug: add color for closing/corked flows
This commit is contained in:
Pyry Kovanen 2023-10-09 15:59:51 +03:00 committed by GitHub
commit 03e522ac3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 87002 additions and 14 deletions

View File

@ -628,6 +628,8 @@
:: duct: ['/paths', ...], :: duct: ['/paths', ...],
:: message-num: 123 :: message-num: 123
:: }, ...], :: }, ...],
:: closing: [bone, ..., bone],
:: corked: [bone, ..., bone],
:: heeds: [['/paths', ...] ...] :: heeds: [['/paths', ...] ...]
:: scries: :: scries:
:: -> { =path :: -> { =path
@ -706,8 +708,8 @@
|^ =/ mix=(list flow) |^ =/ mix=(list flow)
=- (sort - dor) =- (sort - dor)
%+ welp %+ welp
(turn ~(tap by snd) (tack %snd)) (turn ~(tap by snd) (tack %snd closing corked))
(turn ~(tap by rcv) (tack %rcv)) (turn ~(tap by rcv) (tack %rcv closing corked))
=/ [forward=(list flow) backward=(list flow)] =/ [forward=(list flow) backward=(list flow)]
%+ skid mix %+ skid mix
|= [=bone *] |= [=bone *]
@ -719,6 +721,8 @@
:: ::
+$ flow +$ flow
$: =bone $: =bone
closing=?
corked=?
:: ::
$= state $= state
$% [%snd message-pump-state] $% [%snd message-pump-state]
@ -727,17 +731,17 @@
== ==
:: ::
++ tack ++ tack
|* =term |* [=term closing=(set bone) corked=(set bone)]
|* [=bone =noun] |* [=bone =noun]
[bone [term noun]] [bone (~(has in closing) bone) (~(has in corked) bone) [term noun]]
:: ::
++ build ++ build
|= flow |= flow
^- json ^- json
%+ frond -.state %+ frond -.state
?- -.state ?- -.state
%snd (snd-with-bone ossuary bone +.state) %snd (snd-with-bone ossuary bone closing corked +.state)
%rcv (rcv-with-bone ossuary bone +.state) %rcv (rcv-with-bone ossuary bone closing corked +.state)
== ==
-- --
:: ::
@ -749,6 +753,10 @@
:* 'message-num'^(numb message-num) :* 'message-num'^(numb message-num)
(bone-to-pairs bone ossuary) (bone-to-pairs bone ossuary)
== ==
::
'closing'^(set-array closing numb)
::
'corked'^(set-array corked numb)
:: ::
'heeds'^(set-array heeds from-duct) 'heeds'^(set-array heeds from-duct)
:: ::
@ -756,10 +764,12 @@
== ==
:: ::
++ snd-with-bone ++ snd-with-bone
|= [=ossuary =bone message-pump-state] |= [=ossuary =bone closing=? corked=? message-pump-state]
^- json ^- json
%- pairs %- pairs
:* 'current'^(numb current) :* 'closing'^b+closing
'corked'^b+corked
'current'^(numb current)
'next'^(numb next) 'next'^(numb next)
:: ::
:- 'unsent-messages' :: as byte sizes :- 'unsent-messages' :: as byte sizes
@ -811,10 +821,12 @@
== ==
:: ::
++ rcv-with-bone ++ rcv-with-bone
|= [=ossuary =bone message-sink-state] |= [=ossuary =bone closing=? corked=? message-sink-state]
^- json ^- json
%- pairs %- pairs
:* 'last-acked'^(numb last-acked) :* 'closing'^b+closing
'corked'^b+corked
'last-acked'^(numb last-acked)
'last-heard'^(numb last-heard) 'last-heard'^(numb last-heard)
:: ::
:- 'pending-vane-ack' :- 'pending-vane-ack'

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5326,6 +5326,9 @@
:: /ax/snubbed (?(%allow %deny) (list ship)) :: /ax/snubbed (?(%allow %deny) (list ship))
:: /ax/fine/hunk/[path/...] (list @ux) scry response fragments :: /ax/fine/hunk/[path/...] (list @ux) scry response fragments
:: /ax/fine/ducts/[path/] (list duct) :: /ax/fine/ducts/[path/] (list duct)
:: /ax/rift @
:: /ax/corked/[ship] (set bone)
:: /ax/closing/[ship] (set bone)
:: ::
?. ?=(%x ren) ~ ?. ?=(%x ren) ~
=> .(tyl `(pole knot)`tyl) => .(tyl `(pole knot)`tyl)
@ -5498,5 +5501,19 @@
:: ::
[%rift ~] [%rift ~]
``noun+!>(rift.ames-state) ``noun+!>(rift.ames-state)
::
[%corked her=@ ~]
=/ who (slaw %p her.tyl)
?~ who [~ ~]
=/ per (~(get by peers.ames-state) u.who)
?. ?=([~ %known *] per) [~ ~]
``noun+!>(corked.u.per)
::
[%closing her=@ ~]
=/ who (slaw %p her.tyl)
?~ who [~ ~]
=/ per (~(get by peers.ames-state) u.who)
?. ?=([~ %known *] per) [~ ~]
``noun+!>(closing.u.per)
== ==
-- --

View File

@ -153,8 +153,12 @@ export class Ames extends Component {
snd['packet-pump-state'].live.length > 0 ) snd['packet-pump-state'].live.length > 0 )
? 'active, ' ? 'active, '
: ''; : '';
const color = snd['closing'] ? 'lightyellow': snd['corked'] ? 'lightred' : 'transparent';
return {key: 'snd ' + active + snd.bone + ', ' + renderDuct(snd.duct), jsx: ( return {key: 'snd ' + active + snd.bone + ', ' + renderDuct(snd.duct), jsx: (
<Summary summary={summary} details={details} /> <div style={{backgroundColor: color}}>
<Summary summary={summary} details={details} />
</div>
)}; )};
} }
@ -198,8 +202,12 @@ export class Ames extends Component {
{nax}<br/> {nax}<br/>
{liveMessages} {liveMessages}
</>); </>);
const color = rcv['closing'] ? 'ligthyellow': rcv['corked'] ? 'lightred' : 'transparent';
return {key: 'rcv ' + rcv.bone + ', ' + renderDuct(rcv.duct), jsx: ( return {key: 'rcv ' + rcv.bone + ', ' + renderDuct(rcv.duct), jsx: (
<Summary summary={summary} details={details} /> <div style={{backgroundColor: color}}>
<Summary summary={summary} details={details} />
</div>
)}; )};
} }
@ -330,6 +338,13 @@ export class Ames extends Component {
last contact {msToDa(p.qos['last-contact'])} last contact {msToDa(p.qos['last-contact'])}
</td> </td>
</tr> </tr>
<tr>
<td class="inter">Bones </td>
<td>
closing: {p.closing.length},
corked: {p.corked.length}
</td>
</tr>
</tbody></table> </tbody></table>
</>); </>);