package gen
import "github.com/influxdata/flux/internal/gen"
Index ¶
- Constants
- func CsvInput(ctx context.Context, schema Schema) (string, error)
- func Input(ctx context.Context, schema Schema) (flux.TableIterator, error)
- type Schema
- type Tag
Constants ¶
const ( // DefaultNumPoints is the default number of points that should // be generated for each series. DefaultNumPoints = 6 // DefaultPeriod is the default period between points in a series. DefaultPeriod = 10 * time.Second )
Functions ¶
func CsvInput ¶
CsvInput generates a csv input based on the Schema.
func Input ¶
Input constructs a TableIterator with randomly generated data according to the Schema.
Types ¶
type Schema ¶
type Schema struct { // Start is the start time for generating data. This will default // so the current time would be the last point generated, but // truncated to the period. Start time.Time // Tags is a listing of tags and the generated cardinality for // that tag. Tags []Tag // NumPoints is the number of points that should be generated // for each series. This defaults to 6. NumPoints int // Nulls sets the percentage chance that a null value will // be used in the input. This should be a number between 0 and 1. Nulls float64 // Period contains the distance between each point in a series. // This defaults to 10 seconds. Period time.Duration // GroupBy is a list of tags that, if they have the same value, // will have the same type even if the types ratio becomes // impossible to fulfill. This only does something if Types // has been set. GroupBy []string // Types includes a mapping of the column value type // to the ratio for how frequently it should show up // in the output. If this is left blank, all series // will be generated with a float value. Types map[flux.ColType]int // Seed is the (optional) seed to be used by the random // number generator. If this is null, the current time // will be used. Seed *int64 // Alloc assigns an allocator to use when generating the // tables. If this is not set, an unlimited allocator is // used. Alloc memory.Allocator }
Schema describes the schema to be generated.
type Tag ¶
Tag includes the tag name and the cardinality for that tag in the schema.
Source Files ¶
- Version
- v0.196.1 (latest)
- Published
- Feb 19, 2025
- Platform
- linux/amd64
- Imports
- 14 packages
- Last checked
- 1 day ago –
Tools for package owners.