| 198 | } |
| 199 | |
| 200 | void SessionMgr::RetrieveLogs(tensorflow::int64 step_id, |
| 201 | LoggingResponse* response) { |
| 202 | mutex_lock l(mu_); |
| 203 | // Legacy Session |
| 204 | if (legacy_session_) { |
| 205 | auto* worker_cache = legacy_session_->worker_cache.get(); |
| 206 | if (worker_cache) { |
| 207 | auto step_stats = StepStats(); |
| 208 | if (worker_cache->RetrieveLogs(step_id, &step_stats)) { |
| 209 | auto* labeled_step_stats = response->add_step(); |
| 210 | labeled_step_stats->set_step_id(step_id); |
| 211 | labeled_step_stats->mutable_step_stats()->Swap(&step_stats); |
| 212 | } |
| 213 | } |
| 214 | } |
| 215 | for (const auto& session_kv : sessions_) { |
| 216 | auto session = session_kv.second.get(); |
| 217 | if (session) { |
| 218 | auto* worker_cache = session->worker_cache.get(); |
| 219 | if (worker_cache) { |
| 220 | auto step_stats = StepStats(); |
| 221 | if (worker_cache->RetrieveLogs(step_id, &step_stats)) { |
| 222 | auto* labeled_step_stats = response->add_step(); |
| 223 | labeled_step_stats->set_step_id(step_id); |
| 224 | labeled_step_stats->mutable_step_stats()->Swap(&step_stats); |
| 225 | } |
| 226 | } |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | |
| 231 | void SessionMgr::ClearLogs() { |
| 232 | mutex_lock l(mu_); |
nothing calls this directly
no test coverage detected