Documentation ¶
Overview ¶
Package fiofilewriter provides a FileWriter based on FIO.
Index ¶
- Constants
- type FileWriter
- func (fw *FileWriter) Cleanup()
- func (fw *FileWriter) DataDirectory(ctx context.Context) string
- func (fw *FileWriter) DeleteDirectoryContents(ctx context.Context, opts map[string]string) (map[string]string, error)
- func (fw *FileWriter) DeleteEverything(ctx context.Context) error
- func (fw *FileWriter) DeleteRandomSubdirectory(ctx context.Context, opts map[string]string) (map[string]string, error)
- func (fw *FileWriter) WriteRandomFiles(ctx context.Context, opts map[string]string) (map[string]string, error)
Constants ¶
const ( DedupePercentStepField = "dedupe-percent" DeletePercentOfContentsField = "delete-contents-percent" FreeSpaceLimitField = "free-space-limit" IOLimitPerWriteAction = "io-limit-per-write" MaxDedupePercentField = "max-dedupe-percent" MaxDirDepthField = "max-dir-depth" MaxFileSizeField = "max-file-size" MaxNumFilesPerWriteField = "max-num-files-per-write" MinDedupePercentField = "min-dedupe-percent" MinFileSizeField = "min-file-size" MinNumFilesPerWriteField = "min-num-files-per-write" )
Option field names.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileWriter ¶
FileWriter implements a FileWriter over tools/fio.Runner.
func New ¶
func New() (*FileWriter, error)
New returns a FileWriter based on FIO. See tests/tools/fio for configuration details.
func (*FileWriter) DataDirectory ¶
func (fw *FileWriter) DataDirectory(ctx context.Context) string
DataDirectory returns the data directory configured. See tests/tools/fio for details.
func (*FileWriter) DeleteDirectoryContents ¶
func (fw *FileWriter) DeleteDirectoryContents(ctx context.Context, opts map[string]string) (map[string]string, error)
DeleteDirectoryContents deletes some of the contents of random directory up to a specified depth, based on its input options:
- MaxDirDepthField
- DeletePercentOfContentsField
Default values are used for missing options. The method returns the effective options used along with the selected depth and the error if any. ErrNoOp is returned if no directory is found.
func (*FileWriter) DeleteEverything ¶
func (fw *FileWriter) DeleteEverything(ctx context.Context) error
DeleteEverything deletes all content.
func (*FileWriter) DeleteRandomSubdirectory ¶
func (fw *FileWriter) DeleteRandomSubdirectory(ctx context.Context, opts map[string]string) (map[string]string, error)
DeleteRandomSubdirectory deletes a random directory up to a specified depth, based on its input options:
- MaxDirDepthField
Default values are used for missing options. The method returns the effective options used along with the selected depth and the error if any. ErrNoOp is returned if no directory is found.
func (*FileWriter) WriteRandomFiles ¶
func (fw *FileWriter) WriteRandomFiles(ctx context.Context, opts map[string]string) (map[string]string, error)
WriteRandomFiles writes a number of files at some filesystem depth, based on its input options.
- MaxDirDepthField
- MaxFileSizeField
- MinFileSizeField
- MaxNumFilesPerWriteField
- MinNumFilesPerWriteField
- MaxDedupePercentField
- MinDedupePercentField
- DedupePercentStepField
Default values are used for missing options. The method returns the effective options used along with the selected depth and the error if any.