| 468 | } |
| 469 | |
| 470 | Status LogAndCount(const Status& status, const uint64 start_microseconds, |
| 471 | const std::unordered_set<string>& tags, |
| 472 | const string& export_dir) { |
| 473 | auto log_and_count = [&](const string& status_str) { |
| 474 | LOG(INFO) << "SavedModel load for tags { " << absl::StrJoin(tags, " ") |
| 475 | << " }; Status: " << status_str << ". Took " |
| 476 | << GetLatencyMicroseconds(start_microseconds) << " microseconds."; |
| 477 | load_attempt_count->GetCell(export_dir, status_str)->IncrementBy(1); |
| 478 | }; |
| 479 | if (status.ok()) { |
| 480 | log_and_count(kLoadAttemptSuccess); |
| 481 | } else { |
| 482 | log_and_count(kLoadAttemptFail); |
| 483 | } |
| 484 | load_latency->GetCell(export_dir) |
| 485 | ->IncrementBy(GetLatencyMicroseconds(start_microseconds)); |
| 486 | return status; |
| 487 | } |
| 488 | |
| 489 | } // namespace |
| 490 |
no test coverage detected