-
Notifications
You must be signed in to change notification settings - Fork 87
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
LocalTxMonitor: Add support for GetMeasures #4918
base: main
Are you sure you want to change the base?
Conversation
d45e534
to
7398881
Compare
ouroboros-network-protocols/src/Ouroboros/Network/Protocol/LocalTxMonitor/Type.hs
Outdated
Show resolved
Hide resolved
9488451
to
d6eb7bb
Compare
d6eb7bb
to
0a00293
Compare
118738a
to
1007422
Compare
…reName just a newtype around Text, so that network doesn't need to know about anything ledger-specific
1007422
to
e415888
Compare
MsgReplyGetMeasures measures -> | ||
CBOR.encodeListLen 2 | ||
<> CBOR.encodeWord 12 | ||
<> CBOR.encodeListLen 2 | ||
<> CBOR.encodeWord32 (txCount measures) | ||
<> encodeMeasureMap (measuresMap measures) |
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.
Why not?
MsgReplyGetMeasures measures -> | |
CBOR.encodeListLen 2 | |
<> CBOR.encodeWord 12 | |
<> CBOR.encodeListLen 2 | |
<> CBOR.encodeWord32 (txCount measures) | |
<> encodeMeasureMap (measuresMap measures) | |
MsgReplyGetMeasures measures -> | |
CBOR.encodeListLen 3 | |
<> CBOR.encodeWord 12 | |
<> CBOR.encodeWord32 (txCount measures) | |
<> encodeMeasureMap (measuresMap measures) |
f mn sc = | ||
encodeMeasureName mn <> encodeSizeAndCapacity sc |
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 it be ⬇️ for it to produce valid CBOR?
f mn sc = | |
encodeMeasureName mn <> encodeSizeAndCapacity sc | |
f mn sc = | |
encodeListLen 2 | |
<> encodeMeasureName mn | |
<> encodeSizeAndCapacity sc |
, recvMsgGetMeasures = | ||
let measures = MempoolMeasures | ||
{ txCount = fromIntegral (length allTxs) | ||
, measuresMap = mempty |
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.
mempty
? Is it unfinished?
data TokBusyKind (k :: StBusyKind) where | ||
TokNextTx :: TokBusyKind NextTx | ||
TokHasTx :: TokBusyKind HasTx | ||
TokGetSizes :: TokBusyKind GetSizes | ||
TokNextTx :: TokBusyKind NextTx | ||
TokHasTx :: TokBusyKind HasTx | ||
TokGetSizes :: TokBusyKind GetSizes | ||
TokGetMeasures :: TokBusyKind GetMeasures |
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.
We have SingBusyKind
; I suspect TokBusyKind
is not needed at all (either I missed removing it, or it resurfaced after a rebase).
Description
This PR adds a new message to
LocalTxMonitor
,GetMeasures
, which is similar toGetSize
(returning the current mempool transaction count, the size of those transactions, and the total mempool capacity), but returns information about several other metrics in addition to the byte size and capacity of the mempool.GetMeasures
currently returns size and capacity information for transaction byte size, ledger's execution units (both their memory and execution steps), and the reference scripts size, but can easily be extended to support any new metric types in future while remaining backwards compatible.This change works towards ouroboros-consensus#1178, and has a dependent PR in ouroboros-consensus
Checklist
Quality
Maintenance
ouroboros-network
project.