func (n *IOMetrics) IO(start time.Time, operation string) {
	now := time.Now()
	Duration(start, now, n.Timing, n.tags(operation))
	Inc(n.Count)
}
IO records some metrics for an IO operation.

Example:
var myIOMetrics = &IOMetrics{}

func (m *myType) MyInstrumentedFunc() {
var size int, err error

defer myIOMetrics.IO(time.Now(), "read")
...
size,err := doSomeWork()
if err != nil {
myIOMetrics.Failed("read")
return err
}
myIOMetrics.IOSize(size, "read")
}
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}
}