Documentation ¶
Overview ¶
Package fio wraps calls to the fio tool. It assumes the tool is executable by "fio", but gives the option to specify another executable path by setting environment variable FIO_EXE.
Index ¶
- Constants
- Variables
- type Config
- type Job
- type Options
- func (o Options) Merge(other Options) Options
- func (o Options) WithBlockSize(blockSizeB int64) Options
- func (o Options) WithDedupePercentage(dPcnt int) Options
- func (o Options) WithDirectory(dir string) Options
- func (o Options) WithFileSize(fileSizeB int64) Options
- func (o Options) WithFileSizeRange(fileSizeMinB, fileSizeMaxB int64) Options
- func (o Options) WithIOLimit(ioSizeB int64) Options
- func (o Options) WithIOSize(sizeB int64) Options
- func (o Options) WithNoFallocate() Options
- func (o Options) WithNumFiles(numFiles int) Options
- func (o Options) WithRandRepeat(set bool) Options
- func (o Options) WithSize(sizeB int64) Options
- func (o Options) WithSizeRange(sizeMinB, sizeMaxB int64) Options
- type Runner
- func (fr *Runner) Cleanup()
- func (fr *Runner) DeleteRelDir(relDirPath string) error
- func (fr *Runner) Run(args ...string) (stdout, stderr string, err error)
- func (fr *Runner) RunConfigs(cfgs ...Config) (stdout, stderr string, err error)
- func (fr *Runner) WriteFiles(relPath string, opt Options) error
Constants ¶
const ( // FioExeEnvKey gives the path to the fio executable to use in testing FioExeEnvKey = "FIO_EXE" // FioDockerImageEnvKey specifies the docker image tag to use. If // FioExeEnvKey is set, the local executable will be used instead of // docker, even if this variable is also set. FioDockerImageEnvKey = "FIO_DOCKER_IMAGE" // LocalFioDataPathEnvKey is the local path where fio data will be // accessible. If not specified, defaults to the default temp directory (os.TempDir) LocalFioDataPathEnvKey = "LOCAL_FIO_DATA_PATH" // HostFioDataPathEnvKey specifies the path where fio data will be written, // relative to the docker host. If left blank, defaults to local fio data path // (works unless running via docker from within a container, e.g. for development) HostFioDataPathEnvKey = "HOST_FIO_DATA_PATH" )
Environment variable keys
const ( BlockSizeFioArg = "blocksize" DedupePercentageFioArg = "dedupe_percentage" DirectoryFioArg = "directory" FallocateFioArg = "fallocate" FileSizeFioArg = "filesize" IOLimitFioArg = "io_limit" IOSizeFioArg = "io_size" NumFilesFioArg = "nrfiles" RandRepeatFioArg = "randrepeat" SizeFioArg = "size" )
List of FIO argument strings
const ( NoneFio = "none" RandWriteFio = "randwrite" RangeDelimFio = "-" )
List of FIO specific fields and delimiters
const (
JobNameFlag = "--name"
)
List of fio flags
Variables ¶
var (
ErrEnvNotSet = fmt.Errorf("must set either %v or %v", FioExeEnvKey, FioDockerImageEnvKey)
)
Known error messages
Functions ¶
This section is empty.
Types ¶
type Options ¶
Options are flags to be set when running fio
func (Options) Merge ¶
Merge will merge two Options, overwriting common option keys with the incoming option values. Returns the merged result
func (Options) WithBlockSize ¶
WithBlockSize sets the fio block size option
func (Options) WithDedupePercentage ¶
WithDedupePercentage sets the fio dedupe percentage
func (Options) WithDirectory ¶
WithDirectory sets the fio option for the directory to write in
func (Options) WithFileSize ¶
WithFileSize sets the fio file size
func (Options) WithFileSizeRange ¶
WithFileSizeRange sets the fio file size range
func (Options) WithIOLimit ¶
WithIOLimit sets the fio io limit
func (Options) WithIOSize ¶
WithIOSize sets the fio io size
func (Options) WithNoFallocate ¶
WithNoFallocate sets the fio option fallocate to "none"
func (Options) WithNumFiles ¶
WithNumFiles sets the fio number of files
func (Options) WithRandRepeat ¶
WithRandRepeat sets the fio option rand repeat
func (Options) WithSizeRange ¶
WithSizeRange sets the fio size range
type Runner ¶
type Runner struct { Exe string ExecArgs []string LocalDataDir string FioWriteBaseDir string Global Config }
Runner is a helper for running fio commands
func (*Runner) DeleteRelDir ¶
DeleteRelDir deletes a relative directory in the runner's data directory
func (*Runner) RunConfigs ¶
RunConfigs runs fio using the provided Configs