Skip to content
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
merged 3 commits into from Dec 7, 2018

Conversation

seanyoung
Copy link
Contributor

Signed-off-by: Sean Young sean.young@monax.io

Signed-off-by: Sean Young <sean.young@monax.io>
Copy link
Contributor

@silasdavis silasdavis left a 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
Copy link
Contributor

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>
@@ -49,6 +49,8 @@ type Datum struct {
TxPerBlockBuckets map[float64]float64
TotalTime float64
TimePerBlockBuckets map[float64]float64
AccountsWithCode uint64
AccountsWithoutCode uint64
Copy link
Contributor

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 silasdavis merged commit 48ce611 into hyperledger-archives:develop Dec 7, 2018
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.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants