Skip to content

Add additional metrics#2500

Merged
xla merged 6 commits intotendermint:developfrom
mslipper:issue-2169-2
Oct 10, 2018
Merged

Add additional metrics#2500
xla merged 6 commits intotendermint:developfrom
mslipper:issue-2169-2

Conversation

@mslipper
Copy link
Contributor

Continues addressing cosmos/cosmos-sdk#2169.

  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG_PENDING.md

Subsystem: MetricsSubsytem,
Name: "tx_size_bytes",
Help: "Transaction sizes in bytes.",
Buckets: stdprometheus.ExponentialBuckets(1, 2, 10),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the last bucket - 1024 bytes? some of our users have 100KB transactions. the max size for a transaction right now is 21MB (block size)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was unaware of what the best buckets would be, so I made a guess based on my knowledge of Bitcoin.

// Histogram of transaction sizes, in bytes.
TxSizeBytes metrics.Histogram
// Number of failed transactions.
FailedTxs metrics.Gauge
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why gauge if it's only growing?

state/metrics.go Outdated
Namespace: namespace,
Subsystem: MetricsSubsystem,
Name: "block_processing_time",
Help: "Time between BeginBlock and EndBlock.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit? seconds? ms?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ms. Will add.

@codecov-io
Copy link

codecov-io commented Sep 27, 2018

Codecov Report

❗ No coverage uploaded for pull request base (develop@4c4a95c). Click here to learn what that means.
The diff coverage is 41.46%.

@@            Coverage Diff             @@
##             develop    #2500   +/-   ##
==========================================
  Coverage           ?   61.19%           
==========================================
  Files              ?      198           
  Lines              ?    16556           
  Branches           ?        0           
==========================================
  Hits               ?    10131           
  Misses             ?     5565           
  Partials           ?      860
Impacted Files Coverage Δ
mempool/mempool.go 74.9% <100%> (ø)
consensus/reactor.go 71.61% <100%> (ø)
p2p/metrics.go 17.94% <14.28%> (ø)
consensus/metrics.go 15.59% <14.28%> (ø)
mempool/metrics.go 18.18% <16.66%> (ø)
state/metrics.go 25% <25%> (ø)
state/execution.go 75.45% <66.66%> (ø)
node/node.go 66.05% <84.61%> (ø)

Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍰 🌮 🍉

@melekes
Copy link
Contributor

melekes commented Oct 2, 2018

@mslipper mslipper requested a review from zramsay as a code owner October 4, 2018 19:03
@mslipper
Copy link
Contributor Author

mslipper commented Oct 8, 2018

@melekes docs should be good to go :)

Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow-up and introduction of even more metrics, this is ace!

Some style nits to be addressed.

if numVotes := ps.RecordVote(); numVotes%votesToContributeToBecomeGoodPeer == 0 {
conR.Switch.MarkPeerAsGood(peer)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reformatting seems incorrect.

conR.Switch.MarkPeerAsGood(peer)
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect reformatting.

mempool\_tx\_size\_bytes |histogram |on dev| |transaction sizes in bytes
mempool\_failed\_txs |counter|on dev| |number of failed transactions
mempool\_recheck\_times |counter|on dev| |number of transactions rechecked in the mempool
state\_block\_processing\_time|histogram|on dev| |time between BeginBlock and EndBlock in ms
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reformatting makes it harder to read the content. Let's revert.

// It returns the application root hash (result of abci.Commit).
func ExecCommitBlock(appConnConsensus proxy.AppConnConsensus, block *types.Block,
logger log.Logger, lastValSet *types.ValidatorSet, stateDB dbm.DB) ([]byte, error) {
logger log.Logger, lastValSet *types.ValidatorSet, stateDB dbm.DB) ([]byte, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we reformat this than one param per line wtih trailing comma and newline after the last param.

// updateState returns a new State updated according to the header and responses.
func updateState(state State, blockID types.BlockID, header *types.Header,
abciResponses *ABCIResponses) (State, error) {
abciResponses *ABCIResponses) (State, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we reformat this than one param per line wtih trailing comma and newline after the last param.

// Returns a list of transaction results and updates to the validator set
func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus,
block *types.Block, lastValSet *types.ValidatorSet, stateDB dbm.DB) (*ABCIResponses, error) {
block *types.Block, lastValSet *types.ValidatorSet, stateDB dbm.DB) (*ABCIResponses, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we reformat this than one param per line wtih trailing comma and newline after the last param.

node/node.go Outdated
blockExecLogger := logger.With("module", "state")
// make block executor for consensus and blockchain reactors to execute blocks
blockExec := sm.NewBlockExecutor(stateDB, blockExecLogger, proxyApp.Consensus(), mempool, evidencePool)
blockExec := sm.NewBlockExecutor(stateDB, blockExecLogger, proxyApp.Consensus(), mempool, evidencePool, sm.BlockExecutorWithMetrics(smMetrics))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be broken up, it grew quit big.

@xla xla self-assigned this Oct 8, 2018
@jackzampolin
Copy link
Contributor

I think these comments are addressed @xla! Looks like this is ready to merge.

Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 :octocat: :shipit: 🍡

Thanks for addressing the style concerns.

@xla xla merged commit 92343ef into tendermint:develop Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants