Skip to content

Commit

Permalink
Merge #2080
Browse files Browse the repository at this point in the history
2080: Also trace the times of stake distribution LSQ queries r=Anviking a=Anviking

# Issue Number

#2005 / new issue

# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

- [x] Also measure and trace the times of the LSQ queries in the `stakeDistribution` function


# Comments

<!-- 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 <johannes.lund@iohk.io>
  • Loading branch information
iohk-bors[bot] and Anviking authored Aug 27, 2020
2 parents b35d737 + 9220846 commit cc433a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/shelley/src/Cardano/Wallet/Shelley/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -441,13 +441,13 @@ withNetworkLayer tr np addrInfo versionData action = do

_stakeDistribution queue bh coin = do
let pt = toPoint getGenesisBlockHash bh
stakeMap <- handleQueryFailure
stakeMap <- handleQueryFailure $ timeQryAndLog "GetStakeDistribution" tr
(queue `send` CmdQueryLocalState pt (QueryIfCurrentShelley Shelley.GetStakeDistribution))
let toStake = Set.singleton $ Left $ toShelleyCoin coin
liftIO $ traceWith tr $ MsgWillQueryRewardsForStake coin
rewardsPerAccount <- handleQueryFailure
rewardsPerAccount <- handleQueryFailure $ timeQryAndLog "GetNonMyopicMemberRewards" tr
(queue `send` CmdQueryLocalState pt (QueryIfCurrentShelley (Shelley.GetNonMyopicMemberRewards toStake)))
pparams <- handleQueryFailure
pparams <- handleQueryFailure $ timeQryAndLog "GetCurrentPParams" tr
(queue `send` CmdQueryLocalState pt (QueryIfCurrentShelley Shelley.GetCurrentPParams))

let fromJustRewards = fromMaybe (error "stakeDistribution: requested rewards not included in response")
Expand Down

0 comments on commit cc433a5

Please sign in to comment.