mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-09 22:54:53 +03:00
Merge pull request #6076 from urbit/yu/remove-num-live
ames: remove num-live from pump-metrics
This commit is contained in:
commit
da4046a859
@ -716,7 +716,7 @@
|
||||
'rtt'^(numb (div rtt ~s1))
|
||||
'rttvar'^(numb (div rttvar ~s1))
|
||||
'ssthresh'^(numb ssthresh)
|
||||
'num-live'^(numb num-live)
|
||||
'num-live'^(numb ~(wyt by live))
|
||||
'cwnd'^(numb cwnd)
|
||||
'counter'^(numb counter)
|
||||
==
|
||||
|
@ -3218,9 +3218,14 @@
|
||||
++ 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 (make-pump-gauge now.channel metrics.state [her bug]:channel)
|
||||
++ gauge (make-pump-gauge metrics.state live-packets [now her bug]:channel)
|
||||
:: +work: handle $packet-pump-task request
|
||||
::
|
||||
++ work
|
||||
@ -3334,7 +3339,6 @@
|
||||
:: update .live and .metrics
|
||||
::
|
||||
=. live.state (gas:packet-queue live.state send-list)
|
||||
=. metrics.state (on-sent:gauge (lent send-list))
|
||||
:: TMI
|
||||
::
|
||||
=> .(sent `(list static-fragment)`sent)
|
||||
@ -3420,7 +3424,7 @@
|
||||
==
|
||||
^- [new-val=(unit live-packet-val) stop=? _acc]
|
||||
::
|
||||
=/ gauge (make-pump-gauge now.channel metrics.acc [her bug]:channel)
|
||||
=/ gauge (make-pump-gauge metrics.acc live-packets [now her bug]:channel)
|
||||
:: is this the acked packet?
|
||||
::
|
||||
?: =(key [message-num fragment-num])
|
||||
@ -3467,7 +3471,7 @@
|
||||
==
|
||||
^- [new-val=(unit live-packet-val) stop=? pump-metrics]
|
||||
::
|
||||
=/ gauge (make-pump-gauge now.channel metrics [her bug]:channel)
|
||||
=/ gauge (make-pump-gauge metrics live-packets [now her bug]:channel)
|
||||
:: if we get an out-of-order ack for a message, skip until it
|
||||
::
|
||||
?: (lth message-num.key message-num)
|
||||
@ -3515,9 +3519,10 @@
|
||||
:: +make-pump-gauge: construct |pump-gauge congestion control core
|
||||
::
|
||||
++ make-pump-gauge
|
||||
|= [now=@da pump-metrics =ship =bug]
|
||||
|= [pump-metrics live-packets=@ud now=@da =ship =bug]
|
||||
:: TODO rename live-packets num-live
|
||||
=* veb veb.bug
|
||||
=* metrics +<+<
|
||||
=* metrics +<-
|
||||
|%
|
||||
++ trace
|
||||
|= [verb=? print=(trap tape)]
|
||||
@ -3537,15 +3542,7 @@
|
||||
::
|
||||
++ num-slots
|
||||
^- @ud
|
||||
(sub-safe cwnd num-live)
|
||||
:: +on-sent: adjust metrics based on sending .num-sent fresh packets
|
||||
::
|
||||
++ on-sent
|
||||
|= num-sent=@ud
|
||||
^- pump-metrics
|
||||
::
|
||||
=. num-live (add num-live num-sent)
|
||||
metrics
|
||||
(sub-safe cwnd live-packets)
|
||||
:: +on-ack: adjust metrics based on a packet getting acknowledged
|
||||
::
|
||||
++ on-ack
|
||||
@ -3553,7 +3550,6 @@
|
||||
^- pump-metrics
|
||||
::
|
||||
=. counter +(counter)
|
||||
=. num-live (dec num-live)
|
||||
:: if below congestion threshold, add 1; else, add avg. 1 / cwnd
|
||||
::
|
||||
=. cwnd
|
||||
@ -3619,12 +3615,12 @@
|
||||
(lth cwnd ssthresh)
|
||||
:: +in-recovery: %.y iff we're recovering from a skipped packet
|
||||
::
|
||||
:: We finish recovering when .num-live finally dips back down to
|
||||
:: We finish recovering when .live-packets finally dips back down to
|
||||
:: .cwnd.
|
||||
::
|
||||
++ in-recovery
|
||||
^- ?
|
||||
(gth num-live cwnd)
|
||||
(gth live-packets cwnd)
|
||||
:: +sub-safe: subtract with underflow protection
|
||||
::
|
||||
++ sub-safe
|
||||
@ -3641,7 +3637,7 @@
|
||||
rttvar=(div rttvar ms)
|
||||
ssthresh=ssthresh
|
||||
cwnd=cwnd
|
||||
num-live=num-live
|
||||
num-live=live-packets
|
||||
counter=counter
|
||||
==
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user