MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / LogAndCount

Function LogAndCount

tensorflow/contrib/session_bundle/session_bundle.cc:314–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314Status LogAndCount(const Status& status,
315 const uint64 start_microseconds,
316 const StringPiece export_dir) {
317 const uint64 load_latency_microsecs = [&]() -> uint64 {
318 const uint64 end_microseconds = Env::Default()->NowMicros();
319 // Avoid clock skew.
320 if (end_microseconds < start_microseconds) return 0;
321 return end_microseconds - start_microseconds;
322 }();
323 auto log_and_count = [&](const string& status_str) {
324 LOG(INFO) << "Loading SessionBundle: " << status_str << ". Took "
325 << load_latency_microsecs << " microseconds.";
326 load_attempt_count->GetCell(string(export_dir), status_str)->IncrementBy(1);
327 };
328 if (status.ok()) {
329 log_and_count(kLoadAttemptSuccess);
330 } else {
331 log_and_count(kLoadAttemptFail);
332 }
333 load_latency->GetCell(string(export_dir))
334 ->IncrementBy(load_latency_microsecs);
335 return status;
336}
337
338} // namespace
339

Calls 5

DefaultFunction · 0.85
NowMicrosMethod · 0.45
IncrementByMethod · 0.45
GetCellMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected