-
Notifications
You must be signed in to change notification settings - Fork 199
/
interface.go
38 lines (34 loc) · 954 Bytes
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package statistics
import (
"math/big"
"github.com/ElrondNetwork/elrond-go/data"
)
// TPSBenchmark is an interface used to calculate statistics for the network activity
type TPSBenchmark interface {
Update(mb data.HeaderHandler)
ActiveNodes() uint32
RoundTime() uint64
BlockNumber() uint64
RoundNumber() uint64
AverageBlockTxCount() *big.Int
LastBlockTxCount() uint32
TotalProcessedTxCount() *big.Int
LiveTPS() float64
PeakTPS() float64
NrOfShards() uint32
ShardStatistics() map[uint32]ShardStatistic
ShardStatistic(shardID uint32) ShardStatistic
IsInterfaceNil() bool
}
// ShardStatistic is an interface used to calculate statistics for the network activity of a specific shard
type ShardStatistic interface {
ShardID() uint32
AverageTPS() *big.Int
AverageBlockTxCount() uint32
CurrentBlockNonce() uint64
LiveTPS() float64
PeakTPS() float64
LastBlockTxCount() uint32
TotalProcessedTxCount() *big.Int
IsInterfaceNil() bool
}