Merge pull request #857 from filecoin-project/feat/elepost-metric

Feat/elepost metric
This commit is contained in:
Łukasz Magiera 2019-12-11 15:58:29 +01:00 committed by GitHub
commit 135e432cfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 758 additions and 568 deletions

View File

@ -68,7 +68,7 @@ jobs:
- run: sudo apt-get install npm
- restore_cache:
name: restore go mod cache
key: v1-go-deps-{{ arch }}-{{ checksum "/home/circleci/project/lotus/go.mod" }}
key: v1-go-deps-{{ arch }}-{{ checksum "/home/circleci/project/go.mod" }}
- run:
command: make buildall
- store_artifacts:

View File

@ -1,3 +1,5 @@
SHELL=/usr/bin/env bash
all: build
.PHONY: all
@ -77,6 +79,9 @@ lotus-shed: $(BUILD_DEPS)
BINS+=lotus-seal-worker
build: lotus lotus-storage-miner lotus-seal-worker
@[[ $$(type -P "lotus") ]] && echo "Caution: you have \
an existing lotus binary in your PATH. This may cause problems if you don't run 'sudo make install'" || true
.PHONY: build
install:

File diff suppressed because it is too large Load Diff

View File

@ -14,6 +14,7 @@ import (
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/address"
"github.com/filecoin-project/lotus/chain/types"
"github.com/multiformats/go-multihash"
_ "github.com/influxdata/influxdb1-client"
models "github.com/influxdata/influxdb1-client/models"
@ -124,8 +125,11 @@ func RecordTipsetPoints(ctx context.Context, api api.FullNode, pl *PointList, ti
if err != nil {
return err
}
p := NewPoint("chain.election", 1)
p.AddTag("miner", blockheader.Miner.String())
pl.AddPoint(p)
p := NewPoint("chain.blockheader_size", len(bs))
p = NewPoint("chain.blockheader_size", len(bs))
pl.AddPoint(p)
}
@ -212,7 +216,13 @@ func RecordTipsetMessagesPoints(ctx context.Context, api api.FullNode, pl *Point
}
p = NewPoint("chain.message_count", 1)
p.AddTag("actor", actor.Code.String())
dm, err := multihash.Decode(actor.Code.Hash())
if err != nil {
continue
}
p.AddTag("actor", string(dm.Digest))
p.AddTag("method", fmt.Sprintf("%d", msg.Message.Method))
p.AddTag("exitcode", fmt.Sprintf("%d", recp[i].ExitCode))
pl.AddPoint(p)