// LongQueryTime returns the configured threshold for logging/statting
// long running queries.
190099
func (api *API) LongQueryTime() time.Duration {
	if api.cluster == nil {
		return 0
	}
	return api.cluster.longQueryTime
}
868088
public ProxyDataSourceBuilder logSlowQueryToSysOut(long thresholdTime, TimeUnit timeUnit) {
        this.createSysOutSlowQueryListener = true;
        this.slowQueryThreshold = thresholdTime;
        this.slowQueryTimeUnit = timeUnit;
        return this;
    }
99731
func verifyLockTime(txLockTime, threshold, lockTime int64) error {
	// The lockTimes in both the script and transaction must be of the same
	// type.
	if !((txLockTime < threshold && lockTime < threshold) ||
		(txLockTime >= threshold && lockTime >= threshold)) {
		str := fmt.Sprintf("mismatched locktime types -- tx locktime "+
			"%d, stack locktime %d", txLockTime, lockTime)
		return scriptError(ErrUnsatisfiedLockTime, str)
	}

	if lockTime > txLockTime {
		str := fmt.Sprintf("locktime requirement not satisfied -- "+
			"locktime is greater than the transaction locktime: "+
			"%d > %d", lockTime, txLockTime)
		return scriptError(ErrUnsatisfiedLockTime, str)
	}

	return nil
}
356533
func MaxMySQLTime(fsp int) Time {
	return Time{Time: FromDate(0, 0, 0, TimeMaxHour, TimeMaxMinute, TimeMaxSecond, 0), Type: mysql.TypeDuration, Fsp: fsp}
}
1168790
func (h *Timing) ContentLoadTime(contentLoadTime int64) *Timing {
	h.contentLoadTime = contentLoadTime
	h.contentLoadTimeSet = true
	return h
}
460734
func (do *Domain) LogSlowQuery(query *SlowQueryInfo) {
	do.slowQuery.mu.RLock()
	defer do.slowQuery.mu.RUnlock()
	if do.slowQuery.mu.closed {
		return
	}

	select {
	case do.slowQuery.ch <- query:
	default:
	}
}
506005
func FiletimeToDuration(ft *syscall.Filetime) time.Duration {
	n := int64(ft.HighDateTime)<<32 + int64(ft.LowDateTime) // in 100-nanosecond intervals
	return time.Duration(n * 100)
}
255558
func (q *Query) log(start time.Time, execute bool) {
	if q.LogFunc == nil && q.PerfFunc == nil {
		return
	}
	ns := time.Now().Sub(start).Nanoseconds()
	s := q.logSQL()
	if q.LogFunc != nil {
		if execute {
			q.LogFunc("[%.2fms] Execute SQL: %v", float64(ns)/1e6, s)
		} else {
			q.LogFunc("[%.2fms] Query SQL: %v", float64(ns)/1e6, s)
		}
	}
	if q.PerfFunc != nil {
		q.PerfFunc(ns, s, execute)
	}
}
608253
func (p *Peer) LastPingTime() time.Time {
	p.statsMtx.RLock()
	lastPingTime := p.lastPingTime
	p.statsMtx.RUnlock()

	return lastPingTime
}
819031
func DefaultLogger(query string, duration time.Duration, err error) {
	if err != nil {
		log.Print("[", duration, "] ", err, " - ", query)
	} else {
		log.Print("[", duration, "] OK - ", query)
	}
}
183418
func ParseTime(s string) (time.Time, error) {
	t, err := time.Parse(logutil.SlowLogTimeFormat, s)
	if err != nil {
		// This is for compatibility.
		t, err = time.Parse(logutil.OldSlowLogTimeFormat, s)
		if err != nil {
			err = errors.Errorf("string \"%v\" doesn't has a prefix that matches format \"%v\", err: %v", s, logutil.SlowLogTimeFormat, err)
		}
	}
	return t, err
}
240829
func (stats *LogStats) TotalTime() time.Duration {
	return stats.EndTime.Sub(stats.StartTime)
}
1372820
func (h *Histogram) RecordDuration(v time.Duration) error {
	return h.RecordIntScale(int64(v), -9)
}
413784
public ProxyDataSourceBuilder logSlowQueryByCommons(long thresholdTime, TimeUnit timeUnit) {
        return logSlowQueryByCommons(thresholdTime, timeUnit, null, null);
    }
387489
func LongRunningTask() error {
	log.INFO.Print("Long running task started")
	for i := 0; i < 10; i++ {
		log.INFO.Print(10 - i)
		time.Sleep(1 * time.Second)
	}
	log.INFO.Print("Long running task finished")
	return nil
}
1224530
func PdhCollectQueryDataWithTime(hQuery PDH_HQUERY) (uint32, time.Time) {
	var localFileTime FILETIME
	ret, _, _ := pdh_CollectQueryDataWithTime.Call(uintptr(hQuery), uintptr(unsafe.Pointer(&localFileTime)))

	if ret == ERROR_SUCCESS {
		var utcFileTime FILETIME
		ret, _, _ := krn_LocalFileTimeToFileTime.Call(
			uintptr(unsafe.Pointer(&localFileTime)),
			uintptr(unsafe.Pointer(&utcFileTime)))

		if ret == 0 {
			return uint32(ERROR_FAILURE), time.Now()
		}

		// First convert 100-ns intervals to microseconds, then adjust for the
		// epoch difference
		var totalMicroSeconds int64
		totalMicroSeconds = ((int64(utcFileTime.dwHighDateTime) << 32) | int64(utcFileTime.dwLowDateTime)) / 10
		totalMicroSeconds -= EPOCH_DIFFERENCE_MICROS

		retTime := time.Unix(0, totalMicroSeconds*1000)

		return uint32(ERROR_SUCCESS), retTime
	}

	return uint32(ret), time.Now()
}
903954
public ProxyDataSourceBuilder logSlowQueryByCommons(long thresholdTime, TimeUnit timeUnit, CommonsLogLevel logLevel) {
        return logSlowQueryByCommons(thresholdTime, timeUnit, logLevel, null);
    }