stats

package
v0.0.0-...-c8ec3b5 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package stats contains an in-memory StatReceiver that only stores sizes of received blobs but not their contents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Receiver

type Receiver struct {
	sync.Mutex // guards Have
	Have       map[blob.Ref]int64
}

Receiver is a dummy blobserver.StatReceiver that doesn't store anything; it just collects statistics.

TODO: we have another copy of this same type in camput/files.go. move them to a common place? well, the camput one is probably going away at some point.

func (*Receiver) NumBlobs

func (sr *Receiver) NumBlobs() int

func (*Receiver) ReceiveBlob

func (sr *Receiver) ReceiveBlob(br blob.Ref, source io.Reader) (sb blob.SizedRef, err error)

func (*Receiver) Sizes

func (sr *Receiver) Sizes() []int

Sizes returns the sorted blob sizes.

func (*Receiver) StatBlobs

func (sr *Receiver) StatBlobs(dest chan<- blob.SizedRef, blobs []blob.Ref) error

func (*Receiver) SumBlobSize

func (sr *Receiver) SumBlobSize() int64

Jump to

Keyboard shortcuts

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