fiofilewriter

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package fiofilewriter provides a FileWriter based on FIO.

Index

Constants

View Source
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

type FileWriter struct {
	Runner *fio.Runner
}

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) Cleanup

func (fw *FileWriter) Cleanup()

Cleanup is part of FileWriter.

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.

Jump to

Keyboard shortcuts

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