Ejemplo n.º 1
0
AutoStatsTracker::~AutoStatsTracker() {
    auto curOp = CurOp::get(_opCtx);
    Top::get(_opCtx->getServiceContext())
        .record(_opCtx,
                curOp->getNS(),
                curOp->getLogicalOp(),
                _lockType,
                durationCount<Microseconds>(curOp->elapsedTimeExcludingPauses()),
                curOp->isCommand(),
                curOp->getReadWriteType());
}
Ejemplo n.º 2
0
AutoGetCollectionForRead::~AutoGetCollectionForRead() {
    // Report time spent in read lock
    auto currentOp = CurOp::get(_txn);
    Top::get(_txn->getClient()->getServiceContext())
        .record(_txn,
                currentOp->getNS(),
                currentOp->getLogicalOp(),
                -1,  // "read locked"
                _timer.micros(),
                currentOp->isCommand(),
                currentOp->getReadWriteType());
}
Ejemplo n.º 3
0
void recordStatsForTopCommand(OperationContext* txn) {
    auto curOp = CurOp::get(txn);
    const int writeLocked = 1;

    Top::get(txn->getClient()->getServiceContext())
        .record(txn,
                curOp->getNS(),
                curOp->getLogicalOp(),
                writeLocked,
                curOp->elapsedMicros(),
                curOp->isCommand(),
                curOp->getReadWriteType());
}
Ejemplo n.º 4
0
OldClientContext::~OldClientContext() {
    // Lock must still be held
    invariant(_txn->lockState()->isLocked());

    auto currentOp = CurOp::get(_txn);
    Top::get(_txn->getClient()->getServiceContext())
        .record(_txn,
                currentOp->getNS(),
                currentOp->getLogicalOp(),
                _txn->lockState()->isWriteLocked() ? 1 : -1,
                _timer.micros(),
                currentOp->isCommand(),
                currentOp->getReadWriteType());
}