lull: implement +wyt for getting the size of a |deq

This commit is contained in:
yosoyubik 2023-03-22 12:26:50 +01:00
parent 9772114f6f
commit 2545e05c7a
3 changed files with 22 additions and 12 deletions

View File

@ -80,6 +80,15 @@
[* * * * ~] [%4 ls]
==
::
++ wyt
|= a=(pha val)
^- @ud
?- -.a
%nul 0
%one 1
%big :(add (lent +.p.a) (lent +.r.a) $(a q.a))
==
::
++ afx-to-pha
|= =(afx val)
^- (pha val)

View File

@ -3092,11 +3092,6 @@
++ packet-queue
%- (ordered-map live-packet-key live-packet-val)
lte-packets
:: +live-packets: number of sent packets awaiting ack
::
:: ++ live-packets
:: ^- @ud
:: ~(wyt by live.state)
:: +gauge: inflate a |pump-gauge to track congestion control
::
++ gauge (ga metrics.state ~(wyt by live.state))
@ -3715,13 +3710,13 @@
(call %done ok=%.y)
--
--
:: +fine: construct remote scry core
:: +fi: construct |fine remote scry core
:: XX TODO rethink core naming/structure to follow current ames
::
++ fi
=< |%
++ fine-core .
:: ++ pe-abed XX
:: ++ fi-abed XX TODO
++ fi-abet abet :: +abet:pe
::
:: +| %entry-points
@ -4017,7 +4012,7 @@
=. cor (ke-send:cor hoot.want)
[`want | cor]
::
++ ke-gauge (ga metrics.keen 0) :: XX implement length deq
++ ke-gauge (ga metrics.keen (wyt:ke-deq wan.keen))
::
++ ke-timer-wire
`wire`(welp /fine/behn/wake/(scot %p her) path)

View File

@ -20,6 +20,12 @@
(tap:de big)
(expect-eq !>(ls) !>(big-list))
::
++ test-wyt
=/ le
~> %bout.[1 %wyt]
(wyt:de big)
(expect-eq !>(le) !>(big-num))
::
++ test-left
^- tang
=/ bar