v1alpha1

package
v1.11.0-RC1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// Binary represents zfs binary
	Binary = "zfs"
	// StatusOffline ...
	StatusOffline ZVolStatus = "Offline"
	// StatusHealthy ...
	StatusHealthy ZVolStatus = "Healthy"
	// StatusDegraded ...
	StatusDegraded ZVolStatus = "Degraded"
	// StatusRebuilding ...
	StatusRebuilding ZVolStatus = "Rebuilding"
	// NoDataSetAvailable ...
	NoDataSetAvailable ZVolStatus = "no datasets available"
	// InitializeLibuzfsClientErr ...
	InitializeLibuzfsClientErr ZVolStatus = "failed to initialize libuzfs client"
	// RebuildStatusInit ...
	RebuildStatusInit ZVolRebuildStatus = "INIT"
	// RebuildStatusDone ...
	RebuildStatusDone ZVolRebuildStatus = "DONE"
	// RebuildStatusErrored ...
	RebuildStatusErrored ZVolRebuildStatus = "ERRORED  "
	// RebuildStatusFailed ...
	RebuildStatusFailed ZVolRebuildStatus = "FAILED"
	// RebuildStatusUnknown ...
	RebuildStatusUnknown ZVolRebuildStatus = "UNKNOWN"
	// RebuildStatusInProgress ...
	RebuildStatusInProgress ZVolRebuildStatus = "SNAP REBUILD INPROGRESS"
	// RebuildStatusActiveDataSetInProgress ...
	RebuildStatusActiveDataSetInProgress ZVolRebuildStatus = "ACTIVE DATASET REBUILD INPROGRESS"
)

Variables

View Source
var (
	// Status is mapping of the  zvol status with values
	Status = map[ZVolStatus]float64{
		StatusOffline:    0,
		StatusHealthy:    1,
		StatusDegraded:   2,
		StatusRebuilding: 3,
	}
	// RebuildingStatus is mapping of rebuilding status of zvol with values
	RebuildingStatus = map[ZVolRebuildStatus]float64{
		RebuildStatusInit:                    0,
		RebuildStatusDone:                    1,
		RebuildStatusInProgress:              2,
		RebuildStatusActiveDataSetInProgress: 3,
		RebuildStatusErrored:                 4,
		RebuildStatusFailed:                  5,
		RebuildStatusUnknown:                 6,
	}
)

Functions

func IsNoDataSetAvailable

func IsNoDataSetAvailable(str string) bool

IsNoDataSetAvailable check whether dataset available or not

func IsNotInitialized

func IsNotInitialized(str string) bool

IsNotInitialized check whether libuzfs is initialized or not

func Run

func Run(runner exec.Runner) ([]byte, error)

Run is wrapper over RunCommandWithTimeoutContext for zfs commands

func StatsList

func StatsList(v Volume) []float64

StatsList returns the list of stats NOTE: Please donot edit the order, add new stats at the end of the list.

Types

type Stats

type Stats struct {
	Volumes []Volume `json:"stats"`
}

Stats represents list of volume

func StatsParser

func StatsParser(stdout []byte) (Stats, error)

StatsParser parses the json response of zfs stats command.

type Volume

type Volume struct {
	// Name contains name of pool appened with volume name.
	// It's of the form "<pool name>/<volume name>"
	Name          string            `json:"name"`
	Status        ZVolStatus        `json:"status"`        // Status of volume
	RebuildStatus ZVolRebuildStatus `json:"rebuildStatus"` // RebuildStatus of volume

	SyncCount   float64 `json:"syncCount"`   // Total Sync processed on this volume
	ReadCount   float64 `json:"readCount"`   // Total Reads
	WriteCount  float64 `json:"writeCount"`  // Total Writes
	ReadBytes   float64 `json:"readByte"`    // Total Reads in bytes
	WriteBytes  float64 `json:"writeByte"`   // Total Writes in bytes
	SyncLatency float64 `json:"syncLatency"` // Latency involved in processing sync io's

	ReadLatency        float64 `json:"readLatency"`      // Latency involved in processing read io's
	WriteLatency       float64 `json:"writeLatency"`     // Latency involved in processing write io's
	RebuildCount       float64 `json:"rebuildCnt"`       // Total rebuild processed
	RebuildBytes       float64 `json:"rebuildBytes"`     // Total rebuild in bytes
	InflightIOCount    float64 `json:"inflightIOCnt"`    // Total IO's processing currently
	RebuildDoneCount   float64 `json:"rebuildDoneCnt"`   // Total no of rebuilds done
	DispatchedIOCount  float64 `json:"dispatchedIOCnt"`  // Total IO's dispatched to disk
	RebuildFailedCount float64 `json:"rebuildFailedCnt"` // Total no of failed rebuilds
}

Volume represents the volume's various stats

type ZVolRebuildStatus

type ZVolRebuildStatus string

ZVolRebuildingStatus is zvol's rebuilding status

type ZVolStatus

type ZVolStatus string

ZVolStatus is zvol's status

func (ZVolStatus) String

func (z ZVolStatus) String() string

Jump to

Keyboard shortcuts

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