Search in sources :

Example 1 with QueryObs

use of com.hedera.services.bdd.spec.stats.QueryObs in project hedera-services by hashgraph.

the class HapiQueryOp method timedCostLookupWith.

private long timedCostLookupWith(HapiApiSpec spec, Transaction payment) throws Throwable {
    if (suppressStats) {
        return lookupCostWith(spec, payment);
    } else {
        long before = System.currentTimeMillis();
        long cost = lookupCostWith(spec, payment);
        long after = System.currentTimeMillis();
        QueryObs stats = new QueryObs(ResponseType.COST_ANSWER, type());
        stats.setAccepted(expectedCostAnswerPrecheck() == OK);
        stats.setResponseLatency(after - before);
        considerRecording(spec, stats);
        return cost;
    }
}
Also used : QueryObs(com.hedera.services.bdd.spec.stats.QueryObs)

Example 2 with QueryObs

use of com.hedera.services.bdd.spec.stats.QueryObs in project hedera-services by hashgraph.

the class HapiQueryOp method timedSubmitWith.

private void timedSubmitWith(HapiApiSpec spec, Transaction payment) throws Throwable {
    if (suppressStats) {
        submitWith(spec, payment);
    } else {
        long before = System.currentTimeMillis();
        submitWith(spec, payment);
        long after = System.currentTimeMillis();
        QueryObs stats = new QueryObs(ResponseType.ANSWER_ONLY, type());
        stats.setAccepted(reflectForPrecheck(response) == OK);
        stats.setResponseLatency(after - before);
        considerRecording(spec, stats);
    }
}
Also used : QueryObs(com.hedera.services.bdd.spec.stats.QueryObs)

Example 3 with QueryObs

use of com.hedera.services.bdd.spec.stats.QueryObs in project hedera-services by hashgraph.

the class HapiTxnOp method considerRecordingAdHocReceiptQueryStats.

private void considerRecordingAdHocReceiptQueryStats(HapiSpecRegistry registry, long responseLatency) {
    if (!suppressStats && !deferStatusResolution) {
        QueryObs adhocStats = new QueryObs(ANSWER_ONLY, TransactionGetReceipt);
        adhocStats.setAccepted(true);
        adhocStats.setResponseLatency(responseLatency);
        registry.record(adhocStats);
    }
}
Also used : QueryObs(com.hedera.services.bdd.spec.stats.QueryObs)

Aggregations

QueryObs (com.hedera.services.bdd.spec.stats.QueryObs)3