func (mw *Stats) MeasureSince(key string, start time.Time) {
	mw.MeasureSinceWithLabels(key, start, nil)
}
MeasureSince method for execution time recording
package stats
import (
	"fmt"
	"net/http"
	"os"
	"sync"
	"time"
)
type Stats struct {
	mu                  sync.RWMutex
	closed              chan struct{}
	Hostname            string
	Uptime              time.Time
	Pid                 int
	ResponseCounts      map[string]int
	TotalResponseCounts map[string]int
	TotalResponseTime   time.Time
	TotalResponseSize   int64
	MetricsCounts       map[string]int
	MetricsTimers       map[string]time.Time
}
type Label struct {
	Name  string
	Value string
}
func New() *Stats {
	name, _ := os.Hostname()
	stats := &Stats{
		closed:              make(chan struct{}, 1),
		Uptime:              time.Now(),
		Pid:                 os.Getpid(),
		ResponseCounts:      map[string]int{},
		TotalResponseCounts: map[string]int{},
		TotalResponseTime:   time.Time{},
		Hostname:            name,
	}
	go func() {
		for {
			select {
			case <-stats.closed:
				return
			default:
				stats.ResetResponseCounts()
				time.Sleep(time.Second * 1)
			}
		}
	}()
	return stats
}
func (mw *Stats) Close() {
	close(mw.closed)
}
func (mw *Stats) ResetResponseCounts() {
	mw.mu.Lock()
	defer mw.mu.Unlock()
	mw.ResponseCounts = map[string]int{}
}
func (mw *Stats) Handler(h http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		beginning, recorder := mw.Begin(w)
		h.ServeHTTP(recorder, r)
		mw.End(beginning, WithRecorder(recorder))
	})
}
func (mw *Stats) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
	beginning, recorder := mw.Begin(w)
	next(recorder, r)
	mw.End(beginning, WithRecorder(recorder))
}
func (mw *Stats) Begin(w http.ResponseWriter) (time.Time, ResponseWriter) {
	start := time.Now()
	writer := NewRecorderResponseWriter(w, 200)
	return start, writer
}
func (mw *Stats) End(start time.Time, opts ...Option) {
	options := newOptions(opts...)
	responseTime := time.Since(start)
	mw.mu.Lock()
	defer mw.mu.Unlock()
	if options.StatusCode() != 0 {
		statusCode := fmt.Sprintf("%d", options.StatusCode())
		mw.ResponseCounts[statusCode]++
		mw.TotalResponseCounts[statusCode]++
		mw.TotalResponseTime = mw.TotalResponseTime.Add(responseTime)
		mw.TotalResponseSize += int64(options.Size())
	}
}