Search in sources :

Example 1 with CostTimeProvider

use of com.actiontech.dble.btrace.provider.CostTimeProvider in project dble by actiontech.

the class NonBlockingSession method setRequestTime.

public void setRequestTime() {
    if (DbleServer.getInstance().getConfig().getSystem().getCostTimeStat() == 0) {
        return;
    }
    timeCost = false;
    if (ThreadLocalRandom.current().nextInt(100) >= DbleServer.getInstance().getConfig().getSystem().getCostSamplePercent()) {
        return;
    }
    timeCost = true;
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("clear");
    }
    queryTimeCost = new QueryTimeCost();
    provider = new CostTimeProvider();
    provider.beginRequest(source.getId());
    long requestTime = System.nanoTime();
    if (LOGGER.isDebugEnabled()) {
        LOGGER.debug("frontend connection setRequestTime:" + requestTime);
    }
    queryTimeCost.setRequestTime(requestTime);
}
Also used : CostTimeProvider(com.actiontech.dble.btrace.provider.CostTimeProvider) QueryTimeCost(com.actiontech.dble.statistic.stat.QueryTimeCost)

Aggregations

CostTimeProvider (com.actiontech.dble.btrace.provider.CostTimeProvider)1 QueryTimeCost (com.actiontech.dble.statistic.stat.QueryTimeCost)1