benchexport

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadCSV

func LoadCSV[T any](reader io.Reader) ([]T, error)

LoadCSV loads a slice of any struct type from a CSV file, using JSON tags for fields. - gets the header from the first line of the CSV file, maps the header to the struct fields - reads the CSV file and converts each row to a JSON string. - unmarshals the JSON string to a struct. - returns the slice of structs.

func SaveAsMarkdown

func SaveAsMarkdown(input SaveAsMarkdownInput) error

func SaveOrAppendToCSV

func SaveOrAppendToCSV[T any](data []T, filePath string) error

SaveOrAppendToCSV saves a slice of any struct type to a CSV file, using JSON tags for headers. - appends the data to the file if it already exists, or creates it if it doesn't exist. - writes the header based on the struct tags if the file is empty. - uses reflection to get the struct tags and write the header and data to the file.

Types

type SaveAsMarkdownInput

type SaveAsMarkdownInput struct {
	Results      []SavedResults
	CurrentDate  time.Time
	InstanceType string
	FilePath     string
}

type SavedResults

type SavedResults struct {
	Procedure       string `json:"procedure"`
	BranchingFactor int    `json:"branching_factor"`
	QtyStreams      int    `json:"qty_streams"`
	Days            int    `json:"days"`
	DurationMs      int64  `json:"duration_ms"`
	Visibility      string `json:"visibility"`
	Samples         int    `json:"samples"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL