-
Notifications
You must be signed in to change notification settings - Fork 217
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
Less verbose LSQ pool response trace #1864
Conversation
@@ -381,6 +381,9 @@ withNetworkLayer tr np addrInfo versionData action = do | |||
(optimumNumberOfPools pparams) | |||
rewardMap | |||
stakeMap | |||
liftIO $ traceWith tr $ MsgFetchedNodePoolLsqDataSummary | |||
(Map.size stakeMap) | |||
(Map.size rewardMap) | |||
liftIO $ traceWith tr $ MsgFetchedNodePoolLsqData res |
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.
That's one way to do it, what about using only a single message, and depending on the severity, show either the full result, or a summary :) ?
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.
That was how I first imagined it, but I don't see how.
We need to provide a severity, given a MsgFetchedNodePoolLsqData
. Not the other way around. We don't know the global severity level.
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.
Hmmm... right, the ToText
instance is actually not aware of the severity!
@@ -724,6 +727,9 @@ data NetworkLayerLog | |||
| MsgDestroyCursor ThreadId | |||
| MsgWillQueryRewardsForStake W.Coin | |||
| MsgFetchedNodePoolLsqData NodePoolLsqData | |||
| MsgFetchedNodePoolLsqDataSummary Int Int |
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.
Wish we had some kind of anonymous records / named-tuples (e.g. (stakeDistrSize :: Int, rewardMapSize :: Int)
) for situations like these :/
Think a separate record-type is overkill and not sure Quantity "pools in stakeDistr"
helps that much. Or maybe the latter?
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.
anonymous records / named-tuples
Yeah! One of the thing I really like in Elm <3
bors r+ |
1864: Less verbose LSQ pool response trace r=Anviking a=Anviking # Overview - [x] Log the full response as DEBUG, not INFO - [x] Log the _size_ of the stake distribution and reward map as INFO # Comments We now see: ``` [cardano-wallet.network:Info:65] [2020-07-06 15:07:56.63 UTC] Will query non-myopic rewards using the stake 100000000000 [cardano-wallet.network:Info:65] [2020-07-06 15:07:56.82 UTC] Fetched pool data from node tip using LSQ. Got 360 pools in the stake distribution, and 360 pools in the non-myopic member reward map. ``` With: ``` --trace-network=DEBUG ``` we still see the full response. <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]>
Build failed |
We now see: ``` [cardano-wallet.network:Info:65] [2020-07-06 15:07:56.63 UTC] Will query non-myopic rewards using the stake 100000000000 [cardano-wallet.network:Info:65] [2020-07-06 15:07:56.82 UTC] Fetched pool data from node tip using LSQ. Got 360 pools in the stake distribution, and 360 pools in the non-myopic member reward map. ``` With: --trace-network=DEBUG we still see the full response.
2a3115d
to
8321139
Compare
bors r+ |
1864: Less verbose LSQ pool response trace r=Anviking a=Anviking # Overview - [x] Log the full response as DEBUG, not INFO - [x] Log the _size_ of the stake distribution and reward map as INFO # Comments We now see: ``` [cardano-wallet.network:Info:65] [2020-07-06 15:07:56.63 UTC] Will query non-myopic rewards using the stake 100000000000 [cardano-wallet.network:Info:65] [2020-07-06 15:07:56.82 UTC] Fetched pool data from node tip using LSQ. Got 360 pools in the stake distribution, and 360 pools in the non-myopic member reward map. ``` With: ``` --trace-network=DEBUG ``` we still see the full response. <!-- Additional comments or screenshots to attach if any --> <!-- Don't forget to: ✓ Self-review your changes to make sure nothing unexpected slipped through ✓ Assign yourself to the PR ✓ Assign one or several reviewer(s) ✓ Once created, link this PR to its corresponding ticket ✓ Assign the PR to a corresponding milestone ✓ Acknowledge any changes required to the Wiki --> Co-authored-by: Johannes Lund <[email protected]>
Build failed |
bors r+ |
Build succeeded |
Overview
Comments
We now see:
With:
we still see the full response.