MCPcopy Create free account
hub / github.com/bytedance/bolt / recordBlockingTime

Method recordBlockingTime

bolt/exec/Operator.cpp:547–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545}
546
547void Operator::recordBlockingTime(uint64_t start, BlockingReason reason) {
548 uint64_t now =
549 std::chrono::duration_cast<std::chrono::microseconds>(
550 std::chrono::high_resolution_clock::now().time_since_epoch())
551 .count();
552 const auto wallNanos = (now - start) * 1000;
553 const auto blockReason = blockingReasonToString(reason).substr(1);
554
555 auto lockedStats = stats_.wlock();
556 lockedStats->blockedWallNanos += wallNanos;
557 lockedStats->addRuntimeStat(
558 fmt::format("blocked{}WallNanos", blockReason),
559 RuntimeCounter(wallNanos, RuntimeCounter::Unit::kNanos));
560 lockedStats->addRuntimeStat(
561 fmt::format("blocked{}Times", blockReason), RuntimeCounter(1));
562}
563
564void Operator::recordSpillStats(const common::SpillStats& spillStats) {
565 BOLT_CHECK(noMoreInput_);

Callers 1

setResumeMethod · 0.80

Calls 4

blockingReasonToStringFunction · 0.85
RuntimeCounterClass · 0.85
countMethod · 0.45
addRuntimeStatMethod · 0.45

Tested by

no test coverage detected