package hammer
import "github.com/google/trillian/testonly/hammer"
Index ¶
- Constants
- func HitMap(cfg MapConfig) error
- type Choice
- type MapBias
- type MapConfig
- type MapEntrypointName
Constants ¶
const ( GetLeavesName = MapEntrypointName("GetLeaves") GetLeavesRevName = MapEntrypointName("GetLeavesRev") SetLeavesName = MapEntrypointName("SetLeaves") GetSMRName = MapEntrypointName("GetSMR") GetSMRRevName = MapEntrypointName("GetSMRRev") )
Constants for entrypoint names, as exposed in statistics/logging.
const ( ExistingKey = Choice("ExistingKey") NonexistentKey = Choice("NonexistentKey") MalformedKey = Choice("MalformedKey") DuplicateKey = Choice("DuplicateKey") RevTooBig = Choice("RevTooBig") RevIsNegative = Choice("RevIsNegative") CreateLeaf = Choice("CreateLeaf") UpdateLeaf = Choice("UpdateLeaf") DeleteLeaf = Choice("DeleteLeaf") )
Constants for both valid and invalid operation choices.
Functions ¶
func HitMap ¶
HitMap performs load/stress operations according to given config.
Types ¶
type Choice ¶
type Choice string
Choice is a readable representation of a choice about how to perform a hammering operation.
type MapBias ¶
type MapBias struct { Bias map[MapEntrypointName]int // InvalidChance gives the odds of performing an invalid operation, as the N in 1-in-N. InvalidChance map[MapEntrypointName]int // contains filtered or unexported fields }
MapBias indicates the bias for selecting different map operations.
func (*MapBias) Choose ¶
func (hb *MapBias) Choose() MapEntrypointName
Choose randomly picks an operation to perform according to the biases.
func (*MapBias) Invalid ¶
func (hb *MapBias) Invalid(ep MapEntrypointName) bool
Invalid randomly chooses whether an operation should be invalid.
type MapConfig ¶
type MapConfig struct { MapID int64 MetricFactory monitoring.MetricFactory Client trillian.TrillianMapClient EPBias MapBias Operations uint64 EmitInterval time.Duration IgnoreErrors bool // TODO(phad): remove CheckSignatures when downstream dependencies no longer need it, // i.e. when all Map storage implementations support signature storage. CheckSignatures bool }
MapConfig provides configuration for a stress/load test.
func (MapConfig) String ¶
String conforms with Stringer for MapConfig.
type MapEntrypointName ¶
type MapEntrypointName string
MapEntrypointName identifies a Map RPC entrypoint
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
testonly/hammer/maphammer | maphammer is a stress/load test for a Trillian Map. |
- Version
- v1.0.8
- Published
- Mar 8, 2018
- Platform
- js/wasm
- Imports
- 14 packages
- Last checked
- 4 hours ago –
Tools for package owners.