Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Configuration ¶
type Configuration struct { // total machines count Machines int // group machines by clusters. // machine in every cluster will drain unique tags from cluster private set of possible tags Clusters int // number of tags that will be assigned to every machine // value will be unique to machine GlobalTags int // unique tags are tags assigned per machine ClusterTags int // minimun tags MinimumTags int // Total metrics MetricsTotal int // Set of base metrics that reported by all machines BaseMetrics int // Maximum metrics per machine MaxMetrics int // Metrics per namespace MetricsPerNamespace int // Tags per metric TagsPerMetric int // TagValuesPerMetricTag configures how deiverse values of metric tags. TagValuesPerMetricTag int // StartSplay configures how far machines start time could drift away from startTime StartSplay int }
Configuration keeps simulation configuration
func NewConfiguration ¶
func NewConfiguration(machines int, metrics int, clusters int) Configuration
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
Machine struct keeps state of simulated machine, including timeseries and metadata
func NewMachine ¶
NewMachine creates Machine with specified tags and initial timestamp.
func (*Machine) AddTimeseries ¶
AddTimeseries adds timeseries with generator and period.
func (*Machine) AddTimeseriesWithTags ¶
func (m *Machine) AddTimeseriesWithTags( ns string, name string, tags Tags, gen generator.Generator, period uint64)
AddTimeseriesWithTags adds timeseries with series specific tags with generator and period.
func (*Machine) Tick ¶
func (m *Machine) Tick(timestamp uint64) *[]TaggedPoints
Tick advance time for machine. Machine generates all metrics up to provided timestamp. Returns tagged points for every timeseries.
type Simulator ¶
type Simulator struct {
// contains filtered or unexported fields
}
Simulator keeps state of simulation.
func NewSimulator ¶
func NewSimulator(rnd *rand.Rand, conf Configuration, startTime uint64) *Simulator
type TaggedPoints ¶
type TaggedPoints struct { Namespace *string MetricName *string Tags *Tags Datapoints *[]generator.Point }
TaggedPoints structure hold points with attached Tags
type Tags ¶
type Tags []Tag
Tags is for sorting here.
func (*Tags) FormatSeparated ¶
FormatSeparated builds string from tags: tag=value<separator>tag=value...
type TimeSeries ¶
type TimeSeries struct {
// contains filtered or unexported fields
}
TimeSeries keeps track on timestamps and operate on generator to create new points.
func (*TimeSeries) Tick ¶
func (ts *TimeSeries) Tick(timestamp uint64) (*TaggedPoints, bool)
Tick advaces single timeseries to timestamp, generating points in between last timestamp and new