Documentation ¶
Index ¶
- func AddTimestampSuffix(tag string) string
- func CreatePoolsHolder(numShards uint32, selfShard uint32) dataRetriever.PoolsHolder
- func CreatePoolsHolderWithTxPool(txPool dataRetriever.ShardedDataCacherNotifier) dataRetriever.PoolsHolder
- func CreateTxPool(numShards uint32, selfShard uint32) (dataRetriever.ShardedDataCacherNotifier, error)
- func GetGeneralConfig() config.Config
- type CacherMock
- func (cacher *CacherMock) Clear()
- func (cacher *CacherMock) Get(key []byte) (value interface{}, ok bool)
- func (cacher *CacherMock) Has(key []byte) bool
- func (cacher *CacherMock) HasOrAdd(key []byte, value interface{}, _ int) (has, added bool)
- func (cacher *CacherMock) IsInterfaceNil() bool
- func (cacher *CacherMock) Keys() [][]byte
- func (cacher *CacherMock) Len() int
- func (cacher *CacherMock) MaxSize() int
- func (cacher *CacherMock) Peek(key []byte) (value interface{}, ok bool)
- func (cacher *CacherMock) Put(key []byte, value interface{}, _ int) (evicted bool)
- func (cacher *CacherMock) RegisterHandler(handler func(key []byte, value interface{}), _ string)
- func (cacher *CacherMock) Remove(key []byte)
- func (cacher *CacherMock) SizeInBytesContained() uint64
- func (cacher *CacherMock) UnRegisterHandler(string)
- type CacherStub
- func (cacher *CacherStub) Clear()
- func (cacher *CacherStub) Get(key []byte) (value interface{}, ok bool)
- func (cacher *CacherStub) Has(key []byte) bool
- func (cacher *CacherStub) HasOrAdd(key []byte, value interface{}, sizeInBytes int) (has, added bool)
- func (cacher *CacherStub) IsInterfaceNil() bool
- func (cacher *CacherStub) Keys() [][]byte
- func (cacher *CacherStub) Len() int
- func (cacher *CacherStub) MaxSize() int
- func (cacher *CacherStub) Peek(key []byte) (value interface{}, ok bool)
- func (cacher *CacherStub) Put(key []byte, value interface{}, sizeInBytes int) (evicted bool)
- func (cacher *CacherStub) RegisterHandler(handler func(key []byte, value interface{}), _ string)
- func (cacher *CacherStub) Remove(key []byte)
- func (cacher *CacherStub) SizeInBytesContained() uint64
- func (cacher *CacherStub) UnRegisterHandler(id string)
- type FallBackHeaderValidatorStub
- type HistoryRepositoryStub
- func (hp *HistoryRepositoryStub) GetEpochByHash(hash []byte) (uint32, error)
- func (hp *HistoryRepositoryStub) GetMiniblockMetadataByTxHash(hash []byte) (*dblookupext.MiniblockMetadata, error)
- func (hp *HistoryRepositoryStub) GetResultsHashesByTxHash(hash []byte, epoch uint32) (*dblookupext.ResultsHashesByTxHash, error)
- func (hp *HistoryRepositoryStub) IsEnabled() bool
- func (hp *HistoryRepositoryStub) IsInterfaceNil() bool
- func (hp *HistoryRepositoryStub) OnNotarizedBlocks(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte)
- func (hp *HistoryRepositoryStub) RecordBlock(blockHeaderHash []byte, blockHeader data.HeaderHandler, ...) error
- type PeerHonestyHandlerStub
- type PoolsHolderMock
- func (holder *PoolsHolderMock) CurrentBlockTxs() dataRetriever.TransactionCacher
- func (holder *PoolsHolderMock) Headers() dataRetriever.HeadersPool
- func (holder *PoolsHolderMock) IsInterfaceNil() bool
- func (holder *PoolsHolderMock) MiniBlocks() storage.Cacher
- func (holder *PoolsHolderMock) PeerChangesBlocks() storage.Cacher
- func (holder *PoolsHolderMock) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
- func (holder *PoolsHolderMock) SetTransactions(pool dataRetriever.ShardedDataCacherNotifier)
- func (holder *PoolsHolderMock) SetUnsignedTransactions(pool dataRetriever.ShardedDataCacherNotifier)
- func (holder *PoolsHolderMock) SmartContracts() storage.Cacher
- func (holder *PoolsHolderMock) Transactions() dataRetriever.ShardedDataCacherNotifier
- func (holder *PoolsHolderMock) TrieNodes() storage.Cacher
- func (holder *PoolsHolderMock) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
- type PoolsHolderStub
- func (holder *PoolsHolderStub) CurrentBlockTxs() dataRetriever.TransactionCacher
- func (holder *PoolsHolderStub) Headers() dataRetriever.HeadersPool
- func (holder *PoolsHolderStub) IsInterfaceNil() bool
- func (holder *PoolsHolderStub) MetaBlocks() storage.Cacher
- func (holder *PoolsHolderStub) MiniBlocks() storage.Cacher
- func (holder *PoolsHolderStub) PeerChangesBlocks() storage.Cacher
- func (holder *PoolsHolderStub) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
- func (holder *PoolsHolderStub) SmartContracts() storage.Cacher
- func (holder *PoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
- func (holder *PoolsHolderStub) TrieNodes() storage.Cacher
- func (holder *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
- type ProtoMarshalizerMock
- type ShardStatisticsMock
- func (ss *ShardStatisticsMock) AverageBlockTxCount() uint32
- func (ss *ShardStatisticsMock) AverageTPS() *big.Int
- func (ss *ShardStatisticsMock) CurrentBlockNonce() uint64
- func (ss *ShardStatisticsMock) IsInterfaceNil() bool
- func (ss *ShardStatisticsMock) LastBlockTxCount() uint32
- func (ss *ShardStatisticsMock) LiveTPS() float64
- func (ss *ShardStatisticsMock) PeakTPS() float64
- func (ss *ShardStatisticsMock) ShardID() uint32
- func (ss *ShardStatisticsMock) TotalProcessedTxCount() *big.Int
- type ShardedDataStub
- func (shardedData *ShardedDataStub) AddData(key []byte, data interface{}, sizeInBytes int, cacheID string)
- func (shardedData *ShardedDataStub) Clear()
- func (shardedData *ShardedDataStub) ClearShardStore(cacheID string)
- func (sd *ShardedDataStub) GetCounts() counting.CountsWithSize
- func (shardedData *ShardedDataStub) ImmunizeSetOfDataAgainstEviction(keys [][]byte, cacheID string)
- func (shardedData *ShardedDataStub) IsInterfaceNil() bool
- func (shardedData *ShardedDataStub) MergeShardStores(sourceCacheID, destCacheID string)
- func (shardedData *ShardedDataStub) RegisterOnAdded(handler func(key []byte, value interface{}))
- func (shardedData *ShardedDataStub) RemoveData(key []byte, cacheID string)
- func (shardedData *ShardedDataStub) RemoveDataFromAllShards(key []byte)
- func (shardedData *ShardedDataStub) RemoveSetOfDataFromPool(keys [][]byte, cacheID string)
- func (shardedData *ShardedDataStub) SearchFirstData(key []byte) (value interface{}, ok bool)
- func (shardedData *ShardedDataStub) ShardDataStore(cacheID string) storage.Cacher
- type TpsBenchmarkMock
- func (s *TpsBenchmarkMock) ActiveNodes() uint32
- func (s *TpsBenchmarkMock) AverageBlockTxCount() *big.Int
- func (s *TpsBenchmarkMock) BlockNumber() uint64
- func (s *TpsBenchmarkMock) IsInterfaceNil() bool
- func (s *TpsBenchmarkMock) LastBlockTxCount() uint32
- func (s *TpsBenchmarkMock) LiveTPS() float64
- func (s *TpsBenchmarkMock) NrOfShards() uint32
- func (s *TpsBenchmarkMock) PeakTPS() float64
- func (s *TpsBenchmarkMock) RoundNumber() uint64
- func (s *TpsBenchmarkMock) RoundTime() uint64
- func (s *TpsBenchmarkMock) ShardStatistic(shardID uint32) statistics.ShardStatistic
- func (s *TpsBenchmarkMock) ShardStatistics() map[uint32]statistics.ShardStatistic
- func (s *TpsBenchmarkMock) TotalProcessedTxCount() *big.Int
- func (s *TpsBenchmarkMock) Update(mb data.HeaderHandler)
- func (s *TpsBenchmarkMock) UpdateWithShardStats(mb *block.MetaBlock)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTimestampSuffix ¶ added in v1.0.147
AddTimestampSuffix -
func CreatePoolsHolder ¶
func CreatePoolsHolder(numShards uint32, selfShard uint32) dataRetriever.PoolsHolder
CreatePoolsHolder -
func CreatePoolsHolderWithTxPool ¶
func CreatePoolsHolderWithTxPool(txPool dataRetriever.ShardedDataCacherNotifier) dataRetriever.PoolsHolder
CreatePoolsHolderWithTxPool -
func CreateTxPool ¶
func CreateTxPool(numShards uint32, selfShard uint32) (dataRetriever.ShardedDataCacherNotifier, error)
CreateTxPool -
func GetGeneralConfig ¶
GetGeneralConfig returns the common configuration used for testing
Types ¶
type CacherMock ¶
type CacherMock struct {
// contains filtered or unexported fields
}
CacherMock -
func (*CacherMock) Get ¶
func (cacher *CacherMock) Get(key []byte) (value interface{}, ok bool)
Get -
func (*CacherMock) HasOrAdd ¶
func (cacher *CacherMock) HasOrAdd(key []byte, value interface{}, _ int) (has, added bool)
HasOrAdd -
func (*CacherMock) IsInterfaceNil ¶
func (cacher *CacherMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherMock) Peek ¶
func (cacher *CacherMock) Peek(key []byte) (value interface{}, ok bool)
Peek -
func (*CacherMock) Put ¶
func (cacher *CacherMock) Put(key []byte, value interface{}, _ int) (evicted bool)
Put -
func (*CacherMock) RegisterHandler ¶
func (cacher *CacherMock) RegisterHandler(handler func(key []byte, value interface{}), _ string)
RegisterHandler -
func (*CacherMock) SizeInBytesContained ¶ added in v1.1.45
func (cacher *CacherMock) SizeInBytesContained() uint64
SizeInBytesContained -
func (*CacherMock) UnRegisterHandler ¶
func (cacher *CacherMock) UnRegisterHandler(string)
UnRegisterHandler -
type CacherStub ¶
type CacherStub struct { ClearCalled func() PutCalled func(key []byte, value interface{}, sizeInBytes int) (evicted bool) GetCalled func(key []byte) (value interface{}, ok bool) HasCalled func(key []byte) bool PeekCalled func(key []byte) (value interface{}, ok bool) HasOrAddCalled func(key []byte, value interface{}, sizeInBytes int) (has, added bool) RemoveCalled func(key []byte) RemoveOldestCalled func() KeysCalled func() [][]byte LenCalled func() int MaxSizeCalled func() int RegisterHandlerCalled func(func(key []byte, value interface{})) UnRegisterHandlerCalled func(id string) }
CacherStub -
func (*CacherStub) Get ¶
func (cacher *CacherStub) Get(key []byte) (value interface{}, ok bool)
Get -
func (*CacherStub) HasOrAdd ¶
func (cacher *CacherStub) HasOrAdd(key []byte, value interface{}, sizeInBytes int) (has, added bool)
HasOrAdd -
func (*CacherStub) IsInterfaceNil ¶
func (cacher *CacherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherStub) Peek ¶
func (cacher *CacherStub) Peek(key []byte) (value interface{}, ok bool)
Peek -
func (*CacherStub) Put ¶
func (cacher *CacherStub) Put(key []byte, value interface{}, sizeInBytes int) (evicted bool)
Put -
func (*CacherStub) RegisterHandler ¶
func (cacher *CacherStub) RegisterHandler(handler func(key []byte, value interface{}), _ string)
RegisterHandler -
func (*CacherStub) SizeInBytesContained ¶ added in v1.1.45
func (cacher *CacherStub) SizeInBytesContained() uint64
SizeInBytesContained -
func (*CacherStub) UnRegisterHandler ¶
func (cacher *CacherStub) UnRegisterHandler(id string)
UnRegisterHandler -
type FallBackHeaderValidatorStub ¶ added in v1.1.3
type FallBackHeaderValidatorStub struct {
ShouldApplyFallbackValidationCalled func(headerHandler data.HeaderHandler) bool
}
FallBackHeaderValidatorStub -
func (*FallBackHeaderValidatorStub) IsInterfaceNil ¶ added in v1.1.3
func (fhvs *FallBackHeaderValidatorStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*FallBackHeaderValidatorStub) ShouldApplyFallbackValidation ¶ added in v1.1.3
func (fhvs *FallBackHeaderValidatorStub) ShouldApplyFallbackValidation(headerHandler data.HeaderHandler) bool
ShouldApplyFallbackValidation -
type HistoryRepositoryStub ¶ added in v1.1.1
type HistoryRepositoryStub struct { RecordBlockCalled func(blockHeaderHash []byte, blockHeader data.HeaderHandler, blockBody data.BodyHandler, scrsPool map[string]data.TransactionHandler, receipts map[string]data.TransactionHandler) error OnNotarizedBlocksCalled func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte) GetMiniblockMetadataByTxHashCalled func(hash []byte) (*dblookupext.MiniblockMetadata, error) GetEpochByHashCalled func(hash []byte) (uint32, error) GetEventsHashesByTxHashCalled func(hash []byte, epoch uint32) (*dblookupext.ResultsHashesByTxHash, error) IsEnabledCalled func() bool }
HistoryRepositoryStub -
func (*HistoryRepositoryStub) GetEpochByHash ¶ added in v1.1.1
func (hp *HistoryRepositoryStub) GetEpochByHash(hash []byte) (uint32, error)
GetEpochByHash -
func (*HistoryRepositoryStub) GetMiniblockMetadataByTxHash ¶ added in v1.1.1
func (hp *HistoryRepositoryStub) GetMiniblockMetadataByTxHash(hash []byte) (*dblookupext.MiniblockMetadata, error)
GetMiniblockMetadataByTxHash -
func (*HistoryRepositoryStub) GetResultsHashesByTxHash ¶ added in v1.1.12
func (hp *HistoryRepositoryStub) GetResultsHashesByTxHash(hash []byte, epoch uint32) (*dblookupext.ResultsHashesByTxHash, error)
GetResultsHashesByTxHash -
func (*HistoryRepositoryStub) IsEnabled ¶ added in v1.1.1
func (hp *HistoryRepositoryStub) IsEnabled() bool
IsEnabled -
func (*HistoryRepositoryStub) IsInterfaceNil ¶ added in v1.1.1
func (hp *HistoryRepositoryStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*HistoryRepositoryStub) OnNotarizedBlocks ¶ added in v1.1.1
func (hp *HistoryRepositoryStub) OnNotarizedBlocks(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte)
OnNotarizedBlocks -
func (*HistoryRepositoryStub) RecordBlock ¶ added in v1.1.1
func (hp *HistoryRepositoryStub) RecordBlock( blockHeaderHash []byte, blockHeader data.HeaderHandler, blockBody data.BodyHandler, scrsPool map[string]data.TransactionHandler, receipts map[string]data.TransactionHandler, ) error
RecordBlock -
type PeerHonestyHandlerStub ¶
PeerHonestyHandlerStub -
func (*PeerHonestyHandlerStub) ChangeScore ¶
func (phhs *PeerHonestyHandlerStub) ChangeScore(pk string, topic string, units int)
ChangeScore -
func (*PeerHonestyHandlerStub) IsInterfaceNil ¶
func (phhs *PeerHonestyHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
type PoolsHolderMock ¶
type PoolsHolderMock struct {
// contains filtered or unexported fields
}
PoolsHolderMock -
func (*PoolsHolderMock) CurrentBlockTxs ¶
func (holder *PoolsHolderMock) CurrentBlockTxs() dataRetriever.TransactionCacher
CurrentBlockTxs -
func (*PoolsHolderMock) Headers ¶
func (holder *PoolsHolderMock) Headers() dataRetriever.HeadersPool
Headers -
func (*PoolsHolderMock) IsInterfaceNil ¶
func (holder *PoolsHolderMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PoolsHolderMock) MiniBlocks ¶
func (holder *PoolsHolderMock) MiniBlocks() storage.Cacher
MiniBlocks -
func (*PoolsHolderMock) PeerChangesBlocks ¶
func (holder *PoolsHolderMock) PeerChangesBlocks() storage.Cacher
PeerChangesBlocks -
func (*PoolsHolderMock) RewardTransactions ¶
func (holder *PoolsHolderMock) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
RewardTransactions -
func (*PoolsHolderMock) SetTransactions ¶
func (holder *PoolsHolderMock) SetTransactions(pool dataRetriever.ShardedDataCacherNotifier)
SetTransactions -
func (*PoolsHolderMock) SetUnsignedTransactions ¶
func (holder *PoolsHolderMock) SetUnsignedTransactions(pool dataRetriever.ShardedDataCacherNotifier)
SetUnsignedTransactions -
func (*PoolsHolderMock) SmartContracts ¶ added in v1.1.12
func (holder *PoolsHolderMock) SmartContracts() storage.Cacher
SmartContracts -
func (*PoolsHolderMock) Transactions ¶
func (holder *PoolsHolderMock) Transactions() dataRetriever.ShardedDataCacherNotifier
Transactions -
func (*PoolsHolderMock) TrieNodes ¶
func (holder *PoolsHolderMock) TrieNodes() storage.Cacher
TrieNodes -
func (*PoolsHolderMock) UnsignedTransactions ¶
func (holder *PoolsHolderMock) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
UnsignedTransactions -
type PoolsHolderStub ¶
type PoolsHolderStub struct { HeadersCalled func() dataRetriever.HeadersPool TransactionsCalled func() dataRetriever.ShardedDataCacherNotifier UnsignedTransactionsCalled func() dataRetriever.ShardedDataCacherNotifier RewardTransactionsCalled func() dataRetriever.ShardedDataCacherNotifier MiniBlocksCalled func() storage.Cacher MetaBlocksCalled func() storage.Cacher CurrBlockTxsCalled func() dataRetriever.TransactionCacher TrieNodesCalled func() storage.Cacher PeerChangesBlocksCalled func() storage.Cacher SmartContractsCalled func() storage.Cacher }
PoolsHolderStub -
func (*PoolsHolderStub) CurrentBlockTxs ¶
func (holder *PoolsHolderStub) CurrentBlockTxs() dataRetriever.TransactionCacher
CurrentBlockTxs -
func (*PoolsHolderStub) Headers ¶
func (holder *PoolsHolderStub) Headers() dataRetriever.HeadersPool
Headers -
func (*PoolsHolderStub) IsInterfaceNil ¶
func (holder *PoolsHolderStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PoolsHolderStub) MetaBlocks ¶
func (holder *PoolsHolderStub) MetaBlocks() storage.Cacher
MetaBlocks -
func (*PoolsHolderStub) MiniBlocks ¶
func (holder *PoolsHolderStub) MiniBlocks() storage.Cacher
MiniBlocks -
func (*PoolsHolderStub) PeerChangesBlocks ¶
func (holder *PoolsHolderStub) PeerChangesBlocks() storage.Cacher
PeerChangesBlocks -
func (*PoolsHolderStub) RewardTransactions ¶
func (holder *PoolsHolderStub) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
RewardTransactions -
func (*PoolsHolderStub) SmartContracts ¶ added in v1.1.12
func (holder *PoolsHolderStub) SmartContracts() storage.Cacher
SmartContracts -
func (*PoolsHolderStub) Transactions ¶
func (holder *PoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
Transactions -
func (*PoolsHolderStub) TrieNodes ¶
func (holder *PoolsHolderStub) TrieNodes() storage.Cacher
TrieNodes -
func (*PoolsHolderStub) UnsignedTransactions ¶
func (holder *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
UnsignedTransactions -
type ProtoMarshalizerMock ¶
type ProtoMarshalizerMock struct { }
ProtoMarshalizerMock implements marshaling with protobuf
func (*ProtoMarshalizerMock) IsInterfaceNil ¶
func (pmm *ProtoMarshalizerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ProtoMarshalizerMock) Marshal ¶
func (pmm *ProtoMarshalizerMock) Marshal(obj interface{}) ([]byte, error)
Marshal does the actual serialization of an object The object to be serialized must implement the gogoProtoObj interface
func (*ProtoMarshalizerMock) Unmarshal ¶
func (pmm *ProtoMarshalizerMock) Unmarshal(obj interface{}, buff []byte) error
Unmarshal does the actual deserialization of an object The object to be deserialized must implement the gogoProtoObj interface
type ShardStatisticsMock ¶ added in v1.0.147
type ShardStatisticsMock struct {
// contains filtered or unexported fields
}
ShardStatisticsMock will hold the tps statistics for each shard
func (*ShardStatisticsMock) AverageBlockTxCount ¶ added in v1.0.147
func (ss *ShardStatisticsMock) AverageBlockTxCount() uint32
AverageBlockTxCount returns an average transaction count for
func (*ShardStatisticsMock) AverageTPS ¶ added in v1.0.147
func (ss *ShardStatisticsMock) AverageTPS() *big.Int
AverageTPS returns an average tps for all processed blocks in a shard
func (*ShardStatisticsMock) CurrentBlockNonce ¶ added in v1.0.147
func (ss *ShardStatisticsMock) CurrentBlockNonce() uint64
CurrentBlockNonce returns the block nounce of the last processed block in a shard
func (*ShardStatisticsMock) IsInterfaceNil ¶ added in v1.0.147
func (ss *ShardStatisticsMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ShardStatisticsMock) LastBlockTxCount ¶ added in v1.0.147
func (ss *ShardStatisticsMock) LastBlockTxCount() uint32
LastBlockTxCount returns the number of transactions included in the last block
func (*ShardStatisticsMock) LiveTPS ¶ added in v1.0.147
func (ss *ShardStatisticsMock) LiveTPS() float64
LiveTPS returns tps for the last block
func (*ShardStatisticsMock) PeakTPS ¶ added in v1.0.147
func (ss *ShardStatisticsMock) PeakTPS() float64
PeakTPS returns peak tps for for all the blocks of the current shard
func (*ShardStatisticsMock) ShardID ¶ added in v1.0.147
func (ss *ShardStatisticsMock) ShardID() uint32
ShardID returns the shard id of the current statistic object
func (*ShardStatisticsMock) TotalProcessedTxCount ¶ added in v1.0.147
func (ss *ShardStatisticsMock) TotalProcessedTxCount() *big.Int
TotalProcessedTxCount returns the total number of processed transactions for this shard
type ShardedDataStub ¶
type ShardedDataStub struct { RegisterOnAddedCalled func(func(key []byte, value interface{})) ShardDataStoreCalled func(cacheID string) storage.Cacher AddDataCalled func(key []byte, data interface{}, sizeInBytes int, cacheID string) SearchFirstDataCalled func(key []byte) (value interface{}, ok bool) RemoveDataCalled func(key []byte, cacheID string) RemoveDataFromAllShardsCalled func(key []byte) MergeShardStoresCalled func(sourceCacheID, destCacheID string) MoveDataCalled func(sourceCacheID, destCacheID string, key [][]byte) ClearCalled func() ClearShardStoreCalled func(cacheID string) RemoveSetOfDataFromPoolCalled func(keys [][]byte, destCacheID string) ImmunizeSetOfDataAgainstEvictionCalled func(keys [][]byte, cacheID string) CreateShardStoreCalled func(destCacheID string) GetCountsCalled func() counting.CountsWithSize }
ShardedDataStub -
func (*ShardedDataStub) AddData ¶
func (shardedData *ShardedDataStub) AddData(key []byte, data interface{}, sizeInBytes int, cacheID string)
AddData -
func (*ShardedDataStub) ClearShardStore ¶
func (shardedData *ShardedDataStub) ClearShardStore(cacheID string)
ClearShardStore -
func (*ShardedDataStub) GetCounts ¶
func (sd *ShardedDataStub) GetCounts() counting.CountsWithSize
GetCounts -
func (*ShardedDataStub) ImmunizeSetOfDataAgainstEviction ¶
func (shardedData *ShardedDataStub) ImmunizeSetOfDataAgainstEviction(keys [][]byte, cacheID string)
ImmunizeSetOfDataAgainstEviction -
func (*ShardedDataStub) IsInterfaceNil ¶
func (shardedData *ShardedDataStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ShardedDataStub) MergeShardStores ¶
func (shardedData *ShardedDataStub) MergeShardStores(sourceCacheID, destCacheID string)
MergeShardStores -
func (*ShardedDataStub) RegisterOnAdded ¶ added in v1.0.137
func (shardedData *ShardedDataStub) RegisterOnAdded(handler func(key []byte, value interface{}))
RegisterOnAdded -
func (*ShardedDataStub) RemoveData ¶
func (shardedData *ShardedDataStub) RemoveData(key []byte, cacheID string)
RemoveData -
func (*ShardedDataStub) RemoveDataFromAllShards ¶
func (shardedData *ShardedDataStub) RemoveDataFromAllShards(key []byte)
RemoveDataFromAllShards -
func (*ShardedDataStub) RemoveSetOfDataFromPool ¶
func (shardedData *ShardedDataStub) RemoveSetOfDataFromPool(keys [][]byte, cacheID string)
RemoveSetOfDataFromPool -
func (*ShardedDataStub) SearchFirstData ¶
func (shardedData *ShardedDataStub) SearchFirstData(key []byte) (value interface{}, ok bool)
SearchFirstData -
func (*ShardedDataStub) ShardDataStore ¶
func (shardedData *ShardedDataStub) ShardDataStore(cacheID string) storage.Cacher
ShardDataStore -
type TpsBenchmarkMock ¶ added in v1.0.147
type TpsBenchmarkMock struct {
// contains filtered or unexported fields
}
TpsBenchmarkMock will calculate statistics for the network activity
func (*TpsBenchmarkMock) ActiveNodes ¶ added in v1.0.147
func (s *TpsBenchmarkMock) ActiveNodes() uint32
ActiveNodes returns the number of active nodes
func (*TpsBenchmarkMock) AverageBlockTxCount ¶ added in v1.0.147
func (s *TpsBenchmarkMock) AverageBlockTxCount() *big.Int
AverageBlockTxCount returns an average of the tx/block
func (*TpsBenchmarkMock) BlockNumber ¶ added in v1.0.147
func (s *TpsBenchmarkMock) BlockNumber() uint64
BlockNumber returns the last processed block number
func (*TpsBenchmarkMock) IsInterfaceNil ¶ added in v1.0.147
func (s *TpsBenchmarkMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TpsBenchmarkMock) LastBlockTxCount ¶ added in v1.0.147
func (s *TpsBenchmarkMock) LastBlockTxCount() uint32
LastBlockTxCount returns the number of transactions processed in the last block
func (*TpsBenchmarkMock) LiveTPS ¶ added in v1.0.147
func (s *TpsBenchmarkMock) LiveTPS() float64
LiveTPS returns tps for the last block
func (*TpsBenchmarkMock) NrOfShards ¶ added in v1.0.147
func (s *TpsBenchmarkMock) NrOfShards() uint32
NrOfShards returns the number of shards
func (*TpsBenchmarkMock) PeakTPS ¶ added in v1.0.147
func (s *TpsBenchmarkMock) PeakTPS() float64
PeakTPS returns tps for the last block
func (*TpsBenchmarkMock) RoundNumber ¶ added in v1.0.147
func (s *TpsBenchmarkMock) RoundNumber() uint64
RoundNumber returns the round index for this benchmark object
func (*TpsBenchmarkMock) RoundTime ¶ added in v1.0.147
func (s *TpsBenchmarkMock) RoundTime() uint64
RoundTime returns the round duration in seconds
func (*TpsBenchmarkMock) ShardStatistic ¶ added in v1.0.147
func (s *TpsBenchmarkMock) ShardStatistic(shardID uint32) statistics.ShardStatistic
ShardStatistic returns the current statistical state for a given shard
func (*TpsBenchmarkMock) ShardStatistics ¶ added in v1.0.147
func (s *TpsBenchmarkMock) ShardStatistics() map[uint32]statistics.ShardStatistic
ShardStatistics returns the current statistical state for a given shard
func (*TpsBenchmarkMock) TotalProcessedTxCount ¶ added in v1.0.147
func (s *TpsBenchmarkMock) TotalProcessedTxCount() *big.Int
TotalProcessedTxCount returns the total number of processed transactions
func (*TpsBenchmarkMock) Update ¶ added in v1.0.147
func (s *TpsBenchmarkMock) Update(mb data.HeaderHandler)
Update receives a metablock and updates all fields accordingly for each shard available in the meta block
func (*TpsBenchmarkMock) UpdateWithShardStats ¶ added in v1.0.147
func (s *TpsBenchmarkMock) UpdateWithShardStats(mb *block.MetaBlock)
UpdateWithShardStats -