Versions in this module Expand all Collapse all v0 v0.31.12 Oct 9, 2022 v0.31.11 Oct 29, 2019 Changes in this version + type MetricHistoryJSON struct + History []float64 + NumIntervals 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 + type TrustMetric struct + func NewMetric() *TrustMetric + func NewMetricWithConfig(tmc TrustMetricConfig) *TrustMetric + func (tm *TrustMetric) BadEvents(num int) + func (tm *TrustMetric) Copy() *TrustMetric + func (tm *TrustMetric) GoodEvents(num int) + func (tm *TrustMetric) HistoryJSON() MetricHistoryJSON + func (tm *TrustMetric) Init(hist MetricHistoryJSON) + func (tm *TrustMetric) NextTimeInterval() + func (tm *TrustMetric) OnStart() error + func (tm *TrustMetric) OnStop() + func (tm *TrustMetric) Pause() + func (tm *TrustMetric) SetTicker(ticker MetricTicker) + func (tm *TrustMetric) TrustScore() int + func (tm *TrustMetric) TrustValue() float64 + type TrustMetricConfig struct + IntegralWeight float64 + IntervalLength time.Duration + ProportionalWeight float64 + TrackingWindow time.Duration + func DefaultConfig() TrustMetricConfig + type TrustMetricStore struct + func NewTrustMetricStore(db dbm.DB, tmc TrustMetricConfig) *TrustMetricStore + func (tms *TrustMetricStore) AddPeerTrustMetric(key string, tm *TrustMetric) + func (tms *TrustMetricStore) GetPeerTrustMetric(key string) *TrustMetric + func (tms *TrustMetricStore) OnStart() error + func (tms *TrustMetricStore) OnStop() + func (tms *TrustMetricStore) PeerDisconnected(key string) + func (tms *TrustMetricStore) SaveToDB() + func (tms *TrustMetricStore) Size() int