iometrics

package
v0.0.0-...-9994f1b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package iometrics manages I/O metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IOMetrics

type IOMetrics struct {
	// contains filtered or unexported fields
}

IOMetrics holds I/O metrics.

func New

func New(name string) *IOMetrics

New returns new iometrics for name.

func (*IOMetrics) Name

func (m *IOMetrics) Name() string

Name returns the name of the iometrics.

func (*IOMetrics) OpsDone

func (m *IOMetrics) OpsDone(err error)

OpsDone counts when a non read/write I/O operation is done. err is an I/O operation error. e.g. stats, mkdir, readlink etc

func (*IOMetrics) ReadDone

func (m *IOMetrics) ReadDone(n int, err error)

ReadDone counts when a read operation is done. n is the number of bytes, and err is a read error.

func (*IOMetrics) Stats

func (m *IOMetrics) Stats() Stats

Stats returns the snapshopt of the iometrics.

func (*IOMetrics) WriteDone

func (m *IOMetrics) WriteDone(n int, err error)

WriteDone counts when a write operation is done. n is the number of bytes, and err is a write error.

type Stats

type Stats struct {
	// Number of I/O operations other than reads and writes.
	Ops int64
	// Number of I/O operation errors other than read and write errors.
	OpsErrs int64

	// Number of read operations.
	ROps int64
	// Number of read bytes.
	RBytes int64
	// Number of read errors.
	RErrs int64

	// Number of write operations.
	WOps int64
	// Number of write bytes.
	WBytes int64
	// Number of write errors.
	WErrs int64
}

Stats holds iometrics.

Jump to

Keyboard shortcuts

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