/go-writer-stats

Wrap an io.Writer for metrics.

Primary LanguageGo

writer

Wrap an io.Writer for metrics.

Usage

type Writer

type Writer struct {}

Writer implements an io.Writer which wraps another in order to provide write and byte-size metrics.

func New

func New(w io.Writer) *Writer

New writer wrapping w.

func (*Writer) Bytes

func (w *Writer) Bytes() uint64

Bytes returns the number of total bytes written.

func (*Writer) Write

func (w *Writer) Write(b []byte) (int, error)

Write implements io.Writer.

func (*Writer) Writes

func (w *Writer) Writes() uint64

Writes returns the total number of writes.