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', ...],
:: message-num: 123
:: }, ...],
:: closing: [bone, ..., bone],
:: corked: [bone, ..., bone],
:: heeds: [['/paths', ...] ...]
:: scries:
:: -> { =path
@ -706,8 +708,8 @@
|^ =/ mix=(list flow)
=- (sort - dor)
%+ welp
(turn ~(tap by snd) (tack %snd))
(turn ~(tap by rcv) (tack %rcv))
(turn ~(tap by snd) (tack %snd closing corked))
(turn ~(tap by rcv) (tack %rcv closing corked))
=/ [forward=(list flow) backward=(list flow)]
%+ skid mix
|= [=bone *]
@ -719,6 +721,8 @@
::
+$ flow
$: =bone
closing=?
corked=?
::
$= state
$% [%snd message-pump-state]
@ -727,17 +731,17 @@
==
::
++ tack
|* =term
|* [=term closing=(set bone) corked=(set bone)]
|* [=bone =noun]
[bone [term noun]]
[bone (~(has in closing) bone) (~(has in corked) bone) [term noun]]
::
++ build
|= flow
^- json
%+ frond -.state
?- -.state
%snd (snd-with-bone ossuary bone +.state)
%rcv (rcv-with-bone ossuary bone +.state)
%snd (snd-with-bone ossuary bone closing corked +.state)
%rcv (rcv-with-bone ossuary bone closing corked +.state)
==
--
::
@ -749,6 +753,10 @@
:* 'message-num'^(numb message-num)
(bone-to-pairs bone ossuary)
==
::
'closing'^(set-array closing numb)
::
'corked'^(set-array corked numb)
::
'heeds'^(set-array heeds from-duct)
::
@ -756,10 +764,12 @@
==
::
++ snd-with-bone
|= [=ossuary =bone message-pump-state]
|= [=ossuary =bone closing=? corked=? message-pump-state]
^- json
%- pairs
:* 'current'^(numb current)
:* 'closing'^b+closing
'corked'^b+corked
'current'^(numb current)
'next'^(numb next)
::
:- 'unsent-messages' :: as byte sizes
@ -811,10 +821,12 @@
==
::
++ rcv-with-bone
|= [=ossuary =bone message-sink-state]
|= [=ossuary =bone closing=? corked=? message-sink-state]
^- json
%- pairs
:* 'last-acked'^(numb last-acked)
:* 'closing'^b+closing
'corked'^b+corked
'last-acked'^(numb last-acked)
'last-heard'^(numb last-heard)
::
:- '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/fine/hunk/[path/...] (list @ux) scry response fragments
:: /ax/fine/ducts/[path/] (list duct)
:: /ax/rift @
:: /ax/corked/[ship] (set bone)
:: /ax/closing/[ship] (set bone)
::
?. ?=(%x ren) ~
=> .(tyl `(pole knot)`tyl)
@ -5498,5 +5501,19 @@
::
[%rift ~]
``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 )
? 'active, '
: '';
const color = snd['closing'] ? 'lightyellow': snd['corked'] ? 'lightred' : 'transparent';
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/>
{liveMessages}
</>);
const color = rcv['closing'] ? 'ligthyellow': rcv['corked'] ? 'lightred' : 'transparent';
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'])}
</td>
</tr>
<tr>
<td class="inter">Bones </td>
<td>
closing: {p.closing.length},
corked: {p.corked.length}
</td>
</tr>
</tbody></table>
</>);