Documentation ¶
Index ¶
- func DurMs(start time.Time) int64
- type CopyByteTrackingReader
- type ListByteTrackingWriter
- type PulseStats
- type TimingReader
- type Tracker
- func (t *Tracker) AccumulatedPulseStats() *PulseStats
- func (t *Tracker) NewCopyByteTrackingReader(r io.Reader) io.Reader
- func (t *Tracker) NewListByteTrackingWriter(w io.Writer, file bool) io.Writer
- func (t *Tracker) RecordBWLimit(agentBW int64)
- func (t *Tracker) RecordCtrlMsg(time time.Time)
- func (t *Tracker) RecordPulseStats(ps *PulseStats)
- func (t *Tracker) RecordTaskResp(resp *taskpb.TaskRespMsg)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.
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.
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 ¶
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 ¶
NewCopyByteTrackingReader returns a CopyByteTrackingReader. Returns the passed in reader for a nil receiver.
func (*Tracker) NewListByteTrackingWriter ¶
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 ¶
RecordBWLimit tracks the current bandwidth limit. Takes no action for a nil receiver.
func (*Tracker) RecordCtrlMsg ¶
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.