func (n *IOMetrics) Size(size int64, operation string) {
	if size == 0 {
		return
	}
	Int64(n.IOSize, size, n.tags(operation))
}
Size records the size of some IO operation. Zero sizes are not recorded.
package metrics
import (
	"time"
	"go.opencensus.io/stats"
)
type FilesMetrics struct {
	FileCount *stats.Int64Measure `metric:"fileCount" description:"number of files" extraviews:"sum" tags:"kind,operation"`
	FileSize  *stats.Int64Measure `metric:"fileSize" unit:"bytes" description:"size of files" extraviews:"sum" tags:"kind,operation"`
}
func (f *FilesMetrics) tags(operation string) map[string]string {
	return map[string]string{"kind": "dataset", "operation": operation}
}
func (f *FilesMetrics) Inc(operation string) {
	Inc(f.FileCount, f.tags(operation))
}
func (f *FilesMetrics) Size(size int64, operation string) {
	Int64(f.FileSize, size, f.tags(operation))
}
type IOMetrics struct {
	Count        *stats.Int64Measure   `metric:"ioCount" description:"number of IO requests" tags:"kind,operation"`
	Timing       *stats.Float64Measure `metric:"timing" unit:"milliseconds" description:"response time in milliseconds" tags:"kind,operation"`
	Failures     *stats.Int64Measure   `metric:"ioFailures" description:"number of failed IOs" tags:"kind,operation"`
	IOSize       *stats.Int64Measure   `metric:"ioSize" unit:"bytes" description:"IO chunk size in bytes" extraviews:"sum" tags:"kind,operation"`
	IOThroughput *stats.Float64Measure `metric:"throughput" unit:"bytespersec" description:"distribution of throughput of an unitary operation in bytes per second" tags:"kind,operation"`
}
func (n *IOMetrics) tags(operation string) map[string]string {
	return map[string]string{"kind": "io", "operation": operation}
}
func (n *IOMetrics) IO(start time.Time, operation string) {
	now := time.Now()
	Duration(start, now, n.Timing, n.tags(operation))
	Inc(n.Count)
}