func (s *Stats) IncrementCounterBy(key string, value int64) {
	s.countersLock.Lock()
	s.counters[key] += value
	s.countersLock.Unlock()
}
IncrementCounterBy increments the counter associated with the key by the given value
package stats
import (
	"encoding/csv"
	"flag"
	"fmt"
	"io"
	"os"
	"sync"
	"time"
	"github.com/facebookincubator/flog"
)
type Stats struct {
	OutputFile   string
	LogToStderr  bool
	counters     map[string]int64
	countersLock sync.RWMutex
	values       map[string]float64
	valuesLock   sync.RWMutex
}
func New() *Stats {
	s := Stats{}
	s.Clear()  
	return &s
}
func (s *Stats) AreLogged() bool {
	return s.LogToStderr || s.OutputFile != ""
}
func (s *Stats) AddFlags() {
	flag.StringVar(&s.OutputFile, "output_stats", "", "output stats to this file")
	flag.BoolVar(&s.LogToStderr, "log_stats", false, "log stats to stderr")
}
func (s *Stats) IncrementCounter(key string) {
	s.IncrementCounterBy(key, 1)
}