Documentation ¶
Index ¶
- func CompareSeries(a, b seriesKeyField) int
- func TagValuesLimitOption(n int) tagsValuesOption
- func TagValuesSampleOption(n float64) tagsValuesOption
- func WalkDown(v Visitor, node SchemaNode)
- func WalkUp(v Visitor, node SchemaNode)
- type BooleanValuesSequence
- type CountableSequence
- type CounterByteSequence
- type Field
- type FieldArraySource
- type FieldConstantValue
- type FieldFloatRandomSource
- type FieldIntegerZipfSource
- type FieldSource
- type FieldValuesSpec
- type Fields
- type FloatValuesSequence
- type IntegerValuesSequence
- type Measurement
- type MeasurementSpec
- type Measurements
- type NewCountableSequenceFn
- type NewTagsValuesSequenceFn
- type NewTimeValuesSequenceFn
- type Schema
- type SchemaNode
- type Sequence
- type SeriesGenerator
- func NewMergedSeriesGenerator(s []SeriesGenerator) SeriesGenerator
- func NewMergedSeriesGeneratorLimit(s []SeriesGenerator, n int64) SeriesGenerator
- func NewSeriesGenerator(name []byte, field []byte, vg TimeValuesSequence, tags TagsSequence) SeriesGenerator
- func NewSeriesGeneratorFromSpec(s *Spec, tr TimeRange) SeriesGenerator
- func NewSeriesGeneratorLimit(name []byte, field []byte, vg TimeValuesSequence, tags TagsSequence, n int64) SeriesGenerator
- type SeriesLimit
- type Spec
- type StringArraySequence
- type StringConstantSequence
- type StringValuesSequence
- type Tag
- type TagArraySource
- type TagFileSource
- type TagSequenceSource
- type TagSource
- type TagValuesSpec
- type Tags
- type TagsSequence
- type TagsSpec
- type TimeRange
- type TimeSequenceSpec
- type TimeValuesSequence
- func NewTimeBooleanValuesSequence(count int, ts TimestampSequence, vs BooleanValuesSequence) TimeValuesSequence
- func NewTimeFloatValuesSequence(count int, ts TimestampSequence, vs FloatValuesSequence) TimeValuesSequence
- func NewTimeIntegerValuesSequence(count int, ts TimestampSequence, vs IntegerValuesSequence) TimeValuesSequence
- func NewTimeStringValuesSequence(count int, ts TimestampSequence, vs StringValuesSequence) TimeValuesSequence
- func NewTimeUnsignedValuesSequence(count int, ts TimestampSequence, vs UnsignedValuesSequence) TimeValuesSequence
- type TimestampSequence
- type UnsignedValuesSequence
- type Values
- type Visitor
- type VisitorFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareSeries ¶
func CompareSeries(a, b seriesKeyField) int
Compare returns an integer comparing two SeriesGenerator instances lexicographically. The result will be 0 if a==b, -1 if a < b, and +1 if a > b. A nil argument is equivalent to an empty SeriesGenerator.
func TagValuesLimitOption ¶
func TagValuesLimitOption(n int) tagsValuesOption
func TagValuesSampleOption ¶
func TagValuesSampleOption(n float64) tagsValuesOption
func WalkDown ¶
func WalkDown(v Visitor, node SchemaNode)
WalkDown performs a pre-order, depth-first traversal of the graph, calling v for each node. Pre-order starts by calling the visitor for the root and each child as it traverses down the graph to the leaves.
func WalkUp ¶
func WalkUp(v Visitor, node SchemaNode)
WalkUp performs a post-order, depth-first traversal of the graph, calling v for each node. Post-order starts by calling the visitor for the leaves then each parent as it traverses up the graph to the root.
Types ¶
type BooleanValuesSequence ¶
type BooleanValuesSequence interface { Reset() Write(v []bool) }
func NewBooleanArrayValuesSequence ¶
func NewBooleanArrayValuesSequence(v []bool) BooleanValuesSequence
func NewBooleanConstantValuesSequence ¶
func NewBooleanConstantValuesSequence(v bool) BooleanValuesSequence
type CountableSequence ¶
type CounterByteSequence ¶
type CounterByteSequence struct {
// contains filtered or unexported fields
}
func NewCounterByteSequence ¶
func NewCounterByteSequence(format string, start, end int) *CounterByteSequence
func NewCounterByteSequenceCount ¶
func NewCounterByteSequenceCount(n int) *CounterByteSequence
func (*CounterByteSequence) Count ¶
func (s *CounterByteSequence) Count() int
func (*CounterByteSequence) Next ¶
func (s *CounterByteSequence) Next() bool
func (*CounterByteSequence) Value ¶
func (s *CounterByteSequence) Value() string
type Field ¶
type Field struct { Name string Count int64 TimePrecision *precision `toml:"time-precision"` // TimePrecision determines the precision for generated timestamp values TimeInterval *duration `toml:"time-interval"` // TimeInterval determines the duration between timestamp values Source FieldSource }
func (*Field) TimeSequenceSpec ¶
func (t *Field) TimeSequenceSpec() TimeSequenceSpec
func (*Field) UnmarshalTOML ¶
type FieldArraySource ¶
type FieldArraySource struct {
Value interface{}
}
func (*FieldArraySource) String ¶
func (f *FieldArraySource) String() string
type FieldConstantValue ¶
type FieldConstantValue struct {
Value interface{}
}
func (*FieldConstantValue) String ¶
func (f *FieldConstantValue) String() string
type FieldFloatRandomSource ¶
func (*FieldFloatRandomSource) String ¶
func (f *FieldFloatRandomSource) String() string
type FieldIntegerZipfSource ¶
func (*FieldIntegerZipfSource) String ¶
func (f *FieldIntegerZipfSource) String() string
type FieldSource ¶
type FieldSource interface { fmt.Stringer SchemaNode // contains filtered or unexported methods }
type FieldValuesSpec ¶
type FieldValuesSpec struct { TimeSequenceSpec Name string DataType models.FieldType Values NewTimeValuesSequenceFn }
type FloatValuesSequence ¶
type FloatValuesSequence interface { Reset() Write(v []float64) }
func NewFloatArrayValuesSequence ¶
func NewFloatArrayValuesSequence(v []float64) FloatValuesSequence
func NewFloatConstantValuesSequence ¶
func NewFloatConstantValuesSequence(v float64) FloatValuesSequence
func NewFloatRandomValuesSequence ¶
func NewFloatRandomValuesSequence(min, max float64, r *rand.Rand) FloatValuesSequence
type IntegerValuesSequence ¶
type IntegerValuesSequence interface { Reset() Write(v []int64) }
func NewIntegerArrayValuesSequence ¶
func NewIntegerArrayValuesSequence(v []int64) IntegerValuesSequence
func NewIntegerConstantValuesSequence ¶
func NewIntegerConstantValuesSequence(v int64) IntegerValuesSequence
func NewIntegerZipfValuesSequence ¶
func NewIntegerZipfValuesSequence(s *FieldIntegerZipfSource) IntegerValuesSequence
NewIntegerZipfValuesSequence produces int64 values using a Zipfian distribution described by s.
type Measurement ¶
type Measurement struct { Name string SeriesLimit *SeriesLimit `toml:"series-limit"` Sample *sample Tags Tags Fields Fields }
type MeasurementSpec ¶
type MeasurementSpec struct { Name string SeriesLimit *SeriesLimit TagsSpec *TagsSpec FieldValuesSpec *FieldValuesSpec }
type Measurements ¶
type Measurements []Measurement
type NewCountableSequenceFn ¶
type NewCountableSequenceFn func() CountableSequence
type NewTagsValuesSequenceFn ¶
type NewTagsValuesSequenceFn func() TagsSequence
type NewTimeValuesSequenceFn ¶
type NewTimeValuesSequenceFn func(spec TimeSequenceSpec) TimeValuesSequence
NewTimeValuesSequenceFn returns a TimeValuesSequence that will generate a sequence of values based on the spec.
type Schema ¶
type Schema struct { Title string Version string SeriesLimit *SeriesLimit `toml:"series-limit"` Measurements Measurements }
func NewSchemaFromPath ¶
type SchemaNode ¶
type SchemaNode interface {
// contains filtered or unexported methods
}
type SeriesGenerator ¶
type SeriesGenerator interface { // Next advances the series generator to the next series key. Next() bool // Key returns the series key. // The returned value may be cached. Key() []byte // Name returns the name of the measurement. // The returned value may be modified by a subsequent call to Next. Name() []byte // Tags returns the tag set. // The returned value may be modified by a subsequent call to Next. Tags() models.Tags // Field returns the name of the field. // The returned value may be modified by a subsequent call to Next. Field() []byte // TimeValuesGenerator returns a values sequence for the current series. TimeValuesGenerator() TimeValuesSequence }
func NewMergedSeriesGenerator ¶
func NewMergedSeriesGenerator(s []SeriesGenerator) SeriesGenerator
func NewMergedSeriesGeneratorLimit ¶
func NewMergedSeriesGeneratorLimit(s []SeriesGenerator, n int64) SeriesGenerator
func NewSeriesGenerator ¶
func NewSeriesGenerator(name []byte, field []byte, vg TimeValuesSequence, tags TagsSequence) SeriesGenerator
func NewSeriesGeneratorFromSpec ¶
func NewSeriesGeneratorFromSpec(s *Spec, tr TimeRange) SeriesGenerator
func NewSeriesGeneratorLimit ¶
func NewSeriesGeneratorLimit(name []byte, field []byte, vg TimeValuesSequence, tags TagsSequence, n int64) SeriesGenerator
type SeriesLimit ¶
type SeriesLimit int64
func (*SeriesLimit) UnmarshalTOML ¶
func (s *SeriesLimit) UnmarshalTOML(data interface{}) error
type Spec ¶
type Spec struct { SeriesLimit *int64 Measurements []MeasurementSpec }
func NewSpecFromPath ¶
func NewSpecFromSchema ¶
func NewSpecFromToml ¶
type StringArraySequence ¶
type StringArraySequence struct {
// contains filtered or unexported fields
}
func NewStringArraySequence ¶
func NewStringArraySequence(vals []string) *StringArraySequence
func (*StringArraySequence) Count ¶
func (s *StringArraySequence) Count() int
func (*StringArraySequence) Next ¶
func (s *StringArraySequence) Next() bool
func (*StringArraySequence) Value ¶
func (s *StringArraySequence) Value() string
type StringConstantSequence ¶
type StringConstantSequence struct {
// contains filtered or unexported fields
}
func NewStringConstantSequence ¶
func NewStringConstantSequence(val string) *StringConstantSequence
func (*StringConstantSequence) Count ¶
func (s *StringConstantSequence) Count() int
func (*StringConstantSequence) Next ¶
func (s *StringConstantSequence) Next() bool
func (*StringConstantSequence) Value ¶
func (s *StringConstantSequence) Value() string
type StringValuesSequence ¶
type StringValuesSequence interface { Reset() Write(v []string) }
func NewStringArrayValuesSequence ¶
func NewStringArrayValuesSequence(v []string) StringValuesSequence
func NewStringConstantValuesSequence ¶
func NewStringConstantValuesSequence(v string) StringValuesSequence
type Tag ¶
func (*Tag) UnmarshalTOML ¶
type TagArraySource ¶
type TagArraySource struct {
Values []string
}
func (*TagArraySource) String ¶
func (s *TagArraySource) String() string
type TagFileSource ¶
type TagFileSource struct {
Path string
}
func (*TagFileSource) String ¶
func (s *TagFileSource) String() string
type TagSequenceSource ¶
func (*TagSequenceSource) String ¶
func (t *TagSequenceSource) String() string
type TagSource ¶
type TagSource interface { fmt.Stringer SchemaNode // contains filtered or unexported methods }
type TagValuesSpec ¶
type TagValuesSpec struct { TagKey string Values NewCountableSequenceFn }
type TagsSequence ¶
func NewTagsValuesSequenceCounts ¶
func NewTagsValuesSequenceCounts(prefix string, counts []int) TagsSequence
func NewTagsValuesSequenceKeysValues ¶
func NewTagsValuesSequenceKeysValues(keys []string, vals []CountableSequence, opts ...tagsValuesOption) TagsSequence
func NewTagsValuesSequenceValues ¶
func NewTagsValuesSequenceValues(prefix string, vals []CountableSequence) TagsSequence
type TagsSpec ¶
type TagsSpec struct { Tags []*TagValuesSpec Sample *sample }
type TimeSequenceSpec ¶
type TimeSequenceSpec struct { // Count specifies the maximum number of values to generate. Count int // Start specifies the starting time for the values. Start time.Time // Delta specifies the interval between time stamps. Delta time.Duration // Precision specifies the precision of timestamp intervals Precision time.Duration }
func (TimeSequenceSpec) ForTimeRange ¶
func (ts TimeSequenceSpec) ForTimeRange(tr TimeRange) TimeSequenceSpec
type TimeValuesSequence ¶
func NewTimeBooleanValuesSequence ¶
func NewTimeBooleanValuesSequence(count int, ts TimestampSequence, vs BooleanValuesSequence) TimeValuesSequence
func NewTimeFloatValuesSequence ¶
func NewTimeFloatValuesSequence(count int, ts TimestampSequence, vs FloatValuesSequence) TimeValuesSequence
func NewTimeIntegerValuesSequence ¶
func NewTimeIntegerValuesSequence(count int, ts TimestampSequence, vs IntegerValuesSequence) TimeValuesSequence
func NewTimeStringValuesSequence ¶
func NewTimeStringValuesSequence(count int, ts TimestampSequence, vs StringValuesSequence) TimeValuesSequence
func NewTimeUnsignedValuesSequence ¶
func NewTimeUnsignedValuesSequence(count int, ts TimestampSequence, vs UnsignedValuesSequence) TimeValuesSequence
type TimestampSequence ¶
type TimestampSequence interface { Reset() Write(ts []int64) }
func NewTimestampSequenceFromSpec ¶
func NewTimestampSequenceFromSpec(spec TimeSequenceSpec) TimestampSequence
type UnsignedValuesSequence ¶
type UnsignedValuesSequence interface { Reset() Write(v []uint64) }
func NewUnsignedArrayValuesSequence ¶
func NewUnsignedArrayValuesSequence(v []uint64) UnsignedValuesSequence
func NewUnsignedConstantValuesSequence ¶
func NewUnsignedConstantValuesSequence(v uint64) UnsignedValuesSequence
type Visitor ¶
type Visitor interface {
Visit(node SchemaNode) (w Visitor)
}
type VisitorFn ¶
type VisitorFn func(node SchemaNode) bool
func (VisitorFn) Visit ¶
func (fn VisitorFn) Visit(node SchemaNode) (w Visitor)