Versions in this module Expand all Collapse all v0 v0.34.24 Sep 22, 2023 Changes in this version + type Metric struct + func NewMetric() *Metric + func NewMetricWithConfig(tmc MetricConfig) *Metric + func (tm *Metric) BadEvents(num int) + func (tm *Metric) Copy() *Metric + func (tm *Metric) GoodEvents(num int) + func (tm *Metric) HistoryJSON() MetricHistoryJSON + func (tm *Metric) Init(hist MetricHistoryJSON) + func (tm *Metric) NextTimeInterval() + func (tm *Metric) OnStart() error + func (tm *Metric) OnStop() + func (tm *Metric) Pause() + func (tm *Metric) SetTicker(ticker MetricTicker) + func (tm *Metric) TrustScore() int + func (tm *Metric) TrustValue() float64 + type MetricConfig struct + IntegralWeight float64 + IntervalLength time.Duration + ProportionalWeight float64 + TrackingWindow time.Duration + func DefaultConfig() MetricConfig + type MetricHistoryJSON struct + History []float64 + NumIntervals int + type MetricStore struct + func NewTrustMetricStore(db dbm.DB, tmc MetricConfig) *MetricStore + func (tms *MetricStore) AddPeerTrustMetric(key string, tm *Metric) + func (tms *MetricStore) GetPeerTrustMetric(key string) *Metric + func (tms *MetricStore) OnStart() error + func (tms *MetricStore) OnStop() + func (tms *MetricStore) PeerDisconnected(key string) + func (tms *MetricStore) SaveToDB() + func (tms *MetricStore) Size() int + type MetricTicker interface + GetChannel func() <-chan time.Time + Stop func() + type TestTicker struct + C chan time.Time + func NewTestTicker() *TestTicker + func (t *TestTicker) GetChannel() <-chan time.Time + func (t *TestTicker) NextTick() + func (t *TestTicker) Stop() + type Ticker struct + func NewTicker(d time.Duration) *Ticker + func (t *Ticker) GetChannel() <-chan time.Time