Documentation ¶
Index ¶
- Constants
- Variables
- func BeforeExport()
- func DefaultMetricContext() context.Context
- func GetCIDFromMetricContext(ctx context.Context) (int, bool)
- func GetMetricContext(p context.Context, mk *tag.Key, v string) context.Context
- func GetMetricContextByCID(cid int) context.Context
- func Initialize(w module.Wallet)
- func Inspect(c module.Chain, informal bool) map[string]interface{}
- func NewMetricKey(k string) tag.Key
- func ParseMetricData(r *view.Row, prev interface{}, cnt int) interface{}
- func PrometheusExporter() *prometheus.Exporter
- func RegisterBeforeExportFunc(f func())
- func RegisterConsensus()
- func RegisterJsonrpc()
- func RegisterMetricView(m stats.Measure, a *view.Aggregation, tks []tag.Key) *view.View
- func RegisterNetwork()
- func RegisterTransaction()
- func RemoveMetricContext(mk *tag.Key, v string)
- func RemoveMetricContextByCID(cid int)
- func ResetMetricViews()
- type ConsensusMetric
- type Duration
- type Durations
- type JsonrpcMeasure
- type JsonrpcMetric
- type NetworkMetric
- type TxMetric
Constants ¶
View Source
const ( DefaultJsonrpcDurationsSize = 20000 DefaultJsonrpcDurationsExpire = 10 * time.Second )
View Source
const ( TxTypePatch = "patch" TxTypeNormal = "normal" )
Variables ¶
View Source
var ( MetricKeyHostname = NewMetricKey("hostname") MetricKeyChain = NewMetricKey("channel") )
metric common tag key
Functions ¶
func BeforeExport ¶ added in v1.2.0
func BeforeExport()
func DefaultMetricContext ¶
func GetCIDFromMetricContext ¶ added in v1.2.0
func GetMetricContext ¶
func GetMetricContextByCID ¶
func Initialize ¶
func NewMetricKey ¶
func ParseMetricData ¶
func PrometheusExporter ¶
func PrometheusExporter() *prometheus.Exporter
func RegisterBeforeExportFunc ¶ added in v1.2.0
func RegisterBeforeExportFunc(f func())
func RegisterConsensus ¶
func RegisterConsensus()
func RegisterJsonrpc ¶ added in v1.2.0
func RegisterJsonrpc()
func RegisterMetricView ¶
func RegisterNetwork ¶
func RegisterNetwork()
func RegisterTransaction ¶
func RegisterTransaction()
func RemoveMetricContext ¶
func RemoveMetricContextByCID ¶
func RemoveMetricContextByCID(cid int)
func ResetMetricViews ¶
func ResetMetricViews()
Types ¶
type ConsensusMetric ¶
type ConsensusMetric struct {
// contains filtered or unexported fields
}
func NewConsensusMetric ¶
func NewConsensusMetric(ctx context.Context) *ConsensusMetric
func (*ConsensusMetric) OnHeight ¶
func (m *ConsensusMetric) OnHeight(height int64)
func (*ConsensusMetric) OnRound ¶
func (m *ConsensusMetric) OnRound(round int32)
type Durations ¶ added in v1.2.0
type Durations struct {
// contains filtered or unexported fields
}
func NewDurations ¶ added in v1.2.0
type JsonrpcMeasure ¶ added in v1.2.0
type JsonrpcMeasure struct {
// contains filtered or unexported fields
}
func (*JsonrpcMeasure) Remove ¶ added in v1.2.0
func (m *JsonrpcMeasure) Remove(expire time.Duration)
func (*JsonrpcMeasure) RemoveAndRecord ¶ added in v1.2.0
type JsonrpcMetric ¶ added in v1.2.0
type JsonrpcMetric struct {
// contains filtered or unexported fields
}
func NewJsonrpcMetric ¶ added in v1.2.0
func NewJsonrpcMetric(expire time.Duration, durationsSize int, useDefault bool) *JsonrpcMetric
func (*JsonrpcMetric) EnsureMeasure ¶ added in v1.2.0
func (m *JsonrpcMetric) EnsureMeasure(ctx context.Context, ms *measure) *JsonrpcMeasure
func (*JsonrpcMetric) Remove ¶ added in v1.2.0
func (m *JsonrpcMetric) Remove()
type NetworkMetric ¶
type NetworkMetric struct {
// contains filtered or unexported fields
}
func NewNetworkMetric ¶
func NewNetworkMetric(ctx context.Context) *NetworkMetric
type TxMetric ¶
type TxMetric struct {
// contains filtered or unexported fields
}
func (*TxMetric) OnRemoveTx ¶
Click to show internal directories.
Click to hide internal directories.