Spectre Datagen Input Properties
The Spectre datagen-input input tag provides data generation capability within Spectre. A datagen-input tag creates a specified number of rows containing integer sequences and random data of various types.
Datagen Attributes
Defines the number of rows to generate. This is a required field.
Defines the seed used to initialize the pseudo-random number generator. Using a seed
allows you to regenerate the same set of numbers, otherwise each script execution generates a new
data set.
If non-zero, the random data is generated based on the number of the seed. When a seed is used, the data generated will always be the same for that particular seed. If the value of the seed is 0 or not set, the seed is
based on the time the script was run.
Datagen Column Attributes
Each column in the datagen tag has access to the following attributes as well as any standard Spectre column attributes. See the Spectre Input Column Tag for a full list of attributes.
Generates a random city name from a list of approximately 550 common city names.
Generates a random date value.
For example:
date min="2023-01-01" max="2023-12-31" format="YYYY-MM-DD"
Options
-
min—The lowest possible date that can be generated.
-
max—The highest possible date that can be generated.
-
format—The date format to apply to the generated date. The default value is YYYY/MM/DD. For more information see Spectre Format Conventions.
Generates a random date and time value.
For example:
datetime min="2023-01-01 12:00 AM" max="2023-12-31 11:59 PM" format="YYYY-MM-DD ii:mm pp"
Options
-
min—The lowest possible date that can be generated.
-
max—The highest possible date that can be generated.
-
format—The date format to apply to the generated date. The default value is YYYY/MM/DD hh:mm:ss. For more information see Spectre Format Conventions.
Generates a random decimal value.
For example:
double min=-1.2 max=3.1415
Options
-
min—The lowest possible number that can be generated.
-
max—The highest possible number that can be generated.
Generates a random integer value.
For example:
integer min=10 max=1200
Options
-
min—The lowest possible number that can be generated.
-
max—The highest possible number that can be generated.
Generates a random first name from a list of approximately 1900 common United States first names.
Generates a random number with two decimal places.
For example:
fixed100 min=1.10 max=20.50
Options
-
min—The lowest possible number that can be generated.
-
max—The highest possible number that can be generated.
Generates a random last name from a list of approximately 1000 common United States last names.
Generates a random name composed of a first name and last name drawn from a list of common United States names.
Defines the seed used to initialize the pseudo-random number generator. Using a seed
allows you to regenerate the same set of numbers. Otherwise each script execution generates a new
data set.
If non-zero, the random data in this column will be generated based on this seed. If 0 or not set, the seed will be
based on the time the script was run.
For example:
column "Units" seed=12345 {
integer
}
For each row in the output, a number is generated from a sequence.
For example:
sequence min=10 max=12
In this example, the first generated value is 10, followed by 11, then 12. If the output has more rows to generate, then the next generated value goes back to 10.
Options
-
start—The first number in the sequence. The default start value of the sequence is 1.
-
end—The last number in the sequence. If there are more rows in the output than the end value, the sequence begins again at the start value.
Generates a random two-letter United States state abbreviation.
Generates a random string selected from a provided list of strings.
For example:
string "A" "B" "C" "D"
NOTE: At least one string value must be provided.
Generates a random pronounceable word.
For example:
word min-length=5 max-length=10
Options
-
min-length—The minimum length of a generated word.
-
max-length—The maximum length of a generated word.