stats

package
v0.0.0-...-c28e036 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DurMs

func DurMs(start time.Time) int64

DurMs returns the duration in millis between time.Now() and 'start'.

Types

type CopyByteTrackingReader

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

CopyByteTrackingReader is an io.Reader that wraps another io.Reader and performs byte tracking during the Read function.

func (*CopyByteTrackingReader) Read

func (cbtr *CopyByteTrackingReader) Read(buf []byte) (n int, err error)

Read implements the io.Reader interface.

type ListByteTrackingWriter

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

ListByteTrackingWriter is an io.Writer that wraps another io.Writer and performs byte tracking during the Write function.

func (*ListByteTrackingWriter) Write

func (lbtw *ListByteTrackingWriter) Write(p []byte) (n int, err error)

Write implements the io.Writer interface.

type PulseStats

type PulseStats struct {
	CopyBytes             int64
	ListBytes             int64
	CopyOpenMs            int64
	CopyStatMs            int64
	CopySeekMs            int64
	CopyReadMs            int64
	CopyWriteMs           int64
	CopyInternalRetries   int64
	DeleteInternalRetries int64
	ListDirOpenMs         int64
	ListDirReadMs         int64
	ListFileWriteMs       int64
	ListDirWriteMs        int64
}

PulseStats contains stats which are sent with each Agent pulse message.

type TimingReader

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

TimingReader is an io.Reader that wraps another io.Reader and tracks the total duration of the Read calls.

func NewTimingReader

func NewTimingReader(r io.Reader) *TimingReader

NewTimingReader returns a TimingReader.

func (*TimingReader) Read

func (tr *TimingReader) Read(buf []byte) (n int, err error)

Read implements the io.Reader interface.

func (*TimingReader) ReadDur

func (tr *TimingReader) ReadDur() time.Duration

ReadDur returns the total duration of this reader's Read calls.

type Tracker

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

Tracker collects stats about the Agent and provides a display to STDOUT. Stats are collected by calling the various Record* functions as appropriate.

func NewTracker

func NewTracker(ctx context.Context) *Tracker

NewTracker returns a new Tracker, which can then be used to record stats.

func (*Tracker) AccumulatedPulseStats

func (t *Tracker) AccumulatedPulseStats() *PulseStats

AccumulatedPulseStats returns the PulseStats since the last time this function was called. This function is *NOT* idempotent, as calling it resets the underlying PulseStats.

func (*Tracker) NewCopyByteTrackingReader

func (t *Tracker) NewCopyByteTrackingReader(r io.Reader) io.Reader

NewCopyByteTrackingReader returns a CopyByteTrackingReader. Returns the passed in reader for a nil receiver.

func (*Tracker) NewListByteTrackingWriter

func (t *Tracker) NewListByteTrackingWriter(w io.Writer, file bool) io.Writer

NewListByteTrackingWriter returns a ListByteTrackingWriter. If 'file' is true, timing stats will be written for ListFileWriteMs. If false, timing stats will be written for ListDirWriteMs. Returns the passed in writer for a nil receiver.

func (*Tracker) RecordBWLimit

func (t *Tracker) RecordBWLimit(agentBW int64)

RecordBWLimit tracks the current bandwidth limit. Takes no action for a nil receiver.

func (*Tracker) RecordCtrlMsg

func (t *Tracker) RecordCtrlMsg(time time.Time)

RecordCtrlMsg tracks received control messages. Takes no action for a nil receiver.

func (*Tracker) RecordPulseStats

func (t *Tracker) RecordPulseStats(ps *PulseStats)

RecordPulseStats tracks stats contained within 'ps'. Takes no action for a nil receiver.

func (*Tracker) RecordTaskResp

func (t *Tracker) RecordTaskResp(resp *taskpb.TaskRespMsg)

RecordTaskResp tracks the count of completed tasks. Takes no action for a nil receiver.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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