storage

package
v0.0.0-...-683b059 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package storage reports information retrieved from storage-info-common.sh on behalf of tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// Name of the storage device.
	Name string
	// Device contains the underlying hardware device type.
	Device Type
	// Failing contains a final assessment that the device failed or will fail soon.
	Status LifeStatus
	// PercentageUsed contains the percentage of SSD life that has been used.
	// For NVMe and SATA devices, an exact value is returned. For eMMC devices,
	// the value is reported in 10's of percents (10, 20, 30, etc.).
	// In case of any error reading SSD usage data, value will be -1.
	PercentageUsed int64
	// TotalBytesWritten corresponds to total amount of data (in bytes) written
	// to the disk.
	TotalBytesWritten int64
}

Info contains information about a storage device.

func Get

func Get(ctx context.Context) (*Info, error)

Get runs the storage info shell script and returns its info.

type LifeStatus

type LifeStatus int

LifeStatus stands for a simplified overview of device health.

const (
	// Healthy means that the device does not indicate failure or limited remaining life time.
	Healthy LifeStatus = iota
	// Failing indicates the storage device failed or will soon.
	Failing
)

type Type

type Type int

Type stands for various Chromebook storage devices.

const (
	// EMMC (Embedded Multi-Media Controller) devices are a single package flash storage and controller.
	EMMC Type = iota
	// NVMe (Non-Volatile Memory Express) interface. PCIe cards, but more commonly M.2 in Chromebooks.
	NVMe
	// SSD (Solid State Drive) devices connected through a SATA interface.
	SSD
)

Directories

Path Synopsis
Package files contains the utilities for testing file based storage.
Package files contains the utilities for testing file based storage.

Jump to

Keyboard shortcuts

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