-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CAD-430, CAD-429: live peer list & other TUI improvements #493
Conversation
675a4d8
to
d3ef40d
Compare
f35eef8
to
0b71e51
Compare
a8f444f
to
ec704f0
Compare
<3 |
c5c3587
to
967c68b
Compare
@karknu, done! : -) |
967c68b
to
f793fbf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor changes needed
4456547
to
9b68a78
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic looks fine - but I think suggested changes would help maintainabluty
, lvsUIThread :: !LiveViewThread | ||
, lvsMetricsThread :: !LiveViewThread | ||
, lvsNodeThread :: !LiveViewThread | ||
|
||
, lvsNodeKernel :: Maybe (LVNodeKernel blk) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be strict?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful that simply adding a !
on a Maybe
is pretty useless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would agree - except - given that this data structure is also an instance of NoUnexpectedThunks
you might need it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, by adding SMaybe
.
return $ lvs { lvsNetworkUsageInCurr = currentNetRate | ||
, lvsNetworkUsageInPerc = (currentNetRate / (maxNetRate / 100.0)) / 100.0 | ||
, lvsNetworkUsageInLast = inBytes | ||
, lvsNetworkUsageInNs = currentTimeInNs | ||
, lvsNetworkUsageInMax = maxNetRate | ||
, lvsUpTime = diffUTCTime (tstamp meta) (lvsStartTime lvs) | ||
, lvsPeers = Map.elems . flip Map.mapMaybeWithKey candidates $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to pull this calculation out into a supporting function and put it near the newtype above - then it could be clearly documented that this is dependent on details of the wrapped data structure - just for longer term maintenance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, good point!
withOneDecimal :: (Fractional f, Ord f, Show f) => f -> String | ||
withOneDecimal x | ||
| x < 0.1 = "0.0" | ||
| otherwise = uncurry (<>) . (id *** take 2) $ span (/= '.') (show x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems to be the same basic functionality as those in Numeric
ie ShowFFloat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks!
9b68a78
to
6de835b
Compare
# Conflicts: # cardano-node/src/Cardano/Node/TUI/LiveView.hs
6de835b
to
aa8f66a
Compare
78d0b77
to
7da74b1
Compare
@CodiePP, this is the plot I'm getting after 45 minutes of running ..so the definite leaks are:
|
bors r+ |
493: CAD-430, CAD-429: live peer list & other TUI improvements r=deepfire a=deepfire TUI changes: 1. give the TUI direct access to the `NodeKernel`, to allow easier & richer data queries 1. added a peer list screen, accessible by the 'p' key 1. minor string changes 1. compressed the mempool bars in one line 1. a bunch of minor refactoring ![Screenshot from 2020-01-30 17-01-48](https://user-images.githubusercontent.com/452652/73456064-42939880-4382-11ea-912d-345162bd8158.png) Co-authored-by: Kosyrev Serge <[email protected]>
Build succeeded |
I didn't follow this PR in detail, but your response to "definite leaks" is "bors it"? 😕 |
TUI changes:
NodeKernel
, to allow easier & richer data queries