Documentation ¶
Overview ¶
Package csv implements an output writing metrics in csv format
Index ¶
- func IsStringInSlice(slice []string, str string) bool
- func MakeHeader(tags []string) []string
- func New(params output.Params) (output.Output, error)
- func SampleToRow(sample *metrics.Sample, resTags []string, ignoredTags []string, row []string, ...) []string
- func TimeFormatStrings() []string
- type Config
- type Output
- type TimeFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsStringInSlice ¶
IsStringInSlice returns whether the string is contained within a string slice
func MakeHeader ¶
MakeHeader creates list of column names for csv file
func SampleToRow ¶
func SampleToRow(sample *metrics.Sample, resTags []string, ignoredTags []string, row []string, timeFormat TimeFormat, ) []string
SampleToRow converts sample into array of strings
func TimeFormatStrings ¶ added in v0.44.0
func TimeFormatStrings() []string
TimeFormatStrings returns a slice of all String values of the enum
Types ¶
type Config ¶
type Config struct { // Samples. FileName null.String `json:"file_name" envconfig:"K6_CSV_FILENAME"` SaveInterval types.NullDuration `json:"save_interval" envconfig:"K6_CSV_SAVE_INTERVAL"` TimeFormat null.String `json:"time_format" envconfig:"K6_CSV_TIME_FORMAT"` }
Config is the config for the csv output
func GetConsolidatedConfig ¶
func GetConsolidatedConfig( jsonRawConf json.RawMessage, env map[string]string, arg string, ) (Config, error)
GetConsolidatedConfig combines {default config values + JSON config + environment vars + arg config values}, and returns the final result.
func NewConfig ¶
func NewConfig() Config
NewConfig creates a new Config instance with default values for some fields.
type Output ¶
type Output struct { output.SampleBuffer // contains filtered or unexported fields }
Output implements the lib.Output interface for saving to CSV files.
func (*Output) Description ¶
Description returns a human-readable description of the output.
type TimeFormat ¶ added in v0.39.0
type TimeFormat uint8
TimeFormat custom enum type
const ( TimeFormatUnix TimeFormat = iota TimeFormatUnixMilli TimeFormatUnixMicro TimeFormatUnixNano TimeFormatRFC3339 TimeFormatRFC3339Nano )
valid defined values for TimeFormat
func TimeFormatString ¶ added in v0.39.0
func TimeFormatString(s string) (TimeFormat, error)
TimeFormatString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func TimeFormatValues ¶ added in v0.39.0
func TimeFormatValues() []TimeFormat
TimeFormatValues returns all values of the enum
func (TimeFormat) IsATimeFormat ¶ added in v0.39.0
func (i TimeFormat) IsATimeFormat() bool
IsATimeFormat returns "true" if the value is listed in the enum definition. "false" otherwise
func (TimeFormat) String ¶ added in v0.39.0
func (i TimeFormat) String() string