func Measure(op string, lan time.Duration) {
	if IsWarmUpFinished() {
		globalMeasure.measure(op, lan)
	}
}
Measure measures the operation.
package measurement
import (
	"fmt"
	"sort"
	"sync"
	"sync/atomic"
	"time"
	"github.com/magiconair/properties"
	"github.com/pingcap/go-ycsb/pkg/prop"
	"github.com/pingcap/go-ycsb/pkg/ycsb"
)
type measurement struct {
	sync.RWMutex
	p *properties.Properties
	opMeasurement map[string]ycsb.Measurement
}
func (m *measurement) measure(op string, lan time.Duration) {
	m.RLock()
	opM, ok := m.opMeasurement[op]
	m.RUnlock()
	if !ok {
		opM = newHistogram(m.p)
		m.Lock()
		m.opMeasurement[op] = opM
		m.Unlock()
	}
	opM.Measure(lan)
}
func (m *measurement) output() {
	m.RLock()
	defer m.RUnlock()
	keys := make([]string, len(m.opMeasurement))
	var i = 0
	for k := range m.opMeasurement {
		keys[i] = k
		i += 1
	}
	sort.Strings(keys)
	for _, op := range keys {
		fmt.Printf("%-6s - %s\n", op, m.opMeasurement[op].Summary())
	}
}
func (m *measurement) info() map[string]ycsb.MeasurementInfo {
	m.RLock()
	defer m.RUnlock()
	opMeasurementInfo := make(map[string]ycsb.MeasurementInfo, len(m.opMeasurement))
	for op, opM := range m.opMeasurement {
		opMeasurementInfo[op] = opM.Info()
	}
	return opMeasurementInfo
}
func (m *measurement) getOpName() []string {
	m.RLock()
	defer m.RUnlock()
	res := make([]string, 0, len(m.opMeasurement))
	for op := range m.opMeasurement {
		res = append(res, op)
	}
	return res
}
func InitMeasure(p *properties.Properties) {
	globalMeasure = new(measurement)
	globalMeasure.p = p
	globalMeasure.opMeasurement = make(map[string]ycsb.Measurement, 16)
	EnableWarmUp(p.GetInt64(prop.WarmUpTime, 0) > 0)
}
func Output() {
	globalMeasure.output()
}
func EnableWarmUp(b bool) {
	if b {
		atomic.StoreInt32(&warmUp, 1)
	} else {
		atomic.StoreInt32(&warmUp, 0)
	}
}
func IsWarmUpFinished() bool {
	return atomic.LoadInt32(&warmUp) == 0
}