This repository has been archived by the owner on May 13, 2022. It is now read-only.
Report stats on accounts with and without code #975
Merged
silasdavis
merged 3 commits into
hyperledger-archives:develop
from
seanyoung:accounts-stat
Dec 7, 2018
Merged
Report stats on accounts with and without code #975
silasdavis
merged 3 commits into
hyperledger-archives:develop
from
seanyoung:accounts-stat
Dec 7, 2018
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seanyoung
force-pushed
the
accounts-stat
branch
from
December 7, 2018 14:21
36d1424
to
1ddc194
Compare
Signed-off-by: Sean Young <sean.young@monax.io>
seanyoung
force-pushed
the
accounts-stat
branch
from
December 7, 2018 14:24
1ddc194
to
20ce1fb
Compare
silasdavis
approved these changes
Dec 7, 2018
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.
Perfect just minor remark on IterableReader
@@ -62,6 +71,7 @@ type Iterable interface { | |||
type IterableReader interface { | |||
Iterable | |||
Reader | |||
AccountStatsGetter |
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 sure we want to pile this on IterableReader?
Signed-off-by: Sean Young <sean.young@monax.io>
compleatang
reviewed
Dec 7, 2018
rpc/metrics/server.go
Outdated
@@ -49,6 +49,8 @@ type Datum struct { | |||
TxPerBlockBuckets map[float64]float64 | |||
TotalTime float64 | |||
TimePerBlockBuckets map[float64]float64 | |||
AccountsWithCode uint64 | |||
AccountsWithoutCode uint64 |
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.
Can't add a comment on the line but we need to add the appropriate metrics into func AddMetrics()
with something like:
burrowMetrics["Contracts"] = prometheus.NewDesc(
prometheus.BuildFQName("burrow", "accounts", "contracts"),
"Current contracts on the chain",
[]string{"chain_id", "moniker"}, nil,
)
burrowMetrics["Users"] = prometheus.NewDesc(
prometheus.BuildFQName("burrow", "accounts", "users"),
"Current users on the chain",
[]string{"chain_id", "moniker"}, nil,
)
and also something in func (e *Exporter) Collect(ch chan<- prometheus.Metric)
that looks like this:
ch <- prometheus.MustNewConstMetric(
e.burrowMetrics["Contracts"],
prometheus.GaugeValue,
e.datum.AccountsWithCode,
e.chainID,
e.validatorMoniker,
)
ch <- prometheus.MustNewConstMetric(
e.burrowMetrics["Users"],
prometheus.GaugeValue,
e.datum.AccountsWithoutCode,
e.chainID,
e.validatorMoniker,
)
Signed-off-by: Sean Young <sean.young@monax.io>
silasdavis
added a commit
to silasdavis/burrow
that referenced
this pull request
Mar 9, 2019
Report stats on accounts with and without code
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Sean Young sean.young@monax.io