| 242 | |
| 243 | template <typename ParamT> |
| 244 | bool RecordController::forward_and_record(RecordType type, const ParamT& param, std::function<bool()> action_fn) |
| 245 | { |
| 246 | auto start = std::chrono::steady_clock::now(); |
| 247 | bool success = action_fn(); |
| 248 | auto end = std::chrono::steady_clock::now(); |
| 249 | |
| 250 | auto timestamp = std::chrono::duration_cast<std::chrono::milliseconds>(start - recording_start_).count(); |
| 251 | auto cost = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count(); |
| 252 | |
| 253 | write_record(make_record_json(make_line(type, success, timestamp, static_cast<int>(cost)), param)); |
| 254 | return success; |
| 255 | } |
| 256 | |
| 257 | RecordLine RecordController::make_line(RecordType type, bool success, int64_t timestamp, int cost) |
| 258 | { |
nothing calls this directly
no outgoing calls
no test coverage detected