-
Notifications
You must be signed in to change notification settings - Fork 724
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
EKG counter for tips served #3300
Conversation
let mSlotNo = case pointSlot p of | ||
Origin -> Nothing | ||
At slotNo -> Just slotNo | ||
|
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.
It doesn't seem necessary to transform one maybe type into another one. A few lines below we pattern match on mSlotNo
, equally well we can just pattern match on pointSlot p
.
case compare maxSlotNo slotNo of | ||
LT -> do | ||
STM.writeTVar tMaxSlotNo slotNo | ||
lu <- STM.modifyReadTVar' tLocalUp (+1) |
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.
What is modifyReadTVar'
?
Is it equialvent to:
STM.modifyTVar' tLocalUP (+1) >> STM.readTVar tLocalUP
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.
EQ -> do | ||
lu <- STM.modifyReadTVar' tLocalUp (+1) | ||
return (served, Just lu) | ||
sendEKGDirectInt ekgDirect |
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.
Please add an empty line above.
traceBlockFetchServerMetrics (Just ekgDirect) tBlocksServed tLocalUp tMaxSlotNo tracer = Tracer bsTracer | ||
|
||
where | ||
bsTracer :: TraceBlockFetchServerEvent blk -> IO () |
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 adds the local upstreaminess metric which tries to answer the question: how many times we serve a block which slot is either equal or ahead of last served block.
I would like to see a description how this related to the upstreaminess metric that is used to choose peers.
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 don't think we should mention that at all. This is a useful metric on its own, regardless of if that is how down stream peers may judge the node in the future.
b61da79
to
8b70830
Compare
Add an EKG counter, cardano.node.metrics.served.block.latest.coun, which can be used to track how usefull the node is to its down stream peers.
8b70830
to
53b9acd
Compare
bors r+ |
Build succeeded: |
more useful details for this new metric:
|
Add an EKG counter, cardano.node.metrics.served.block.latest.count, which
can be used to track how usefull the node is to its down stream peers.
This counter can be used as follows
rate(cardano_node_metrics_served_block_latest_count_int[1h])/rate(cardano_node_metrics_blockNum_int[1h])
. Which gives a value close to 0 for unpopular node. And a value around 1 or more for a very useful node.