Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat(Rad): Include retrievals' response time within RadonReports #2414

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion rad/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ async fn http_response(
})
})?;

let start_ts = std::time::SystemTime::now();
let response = client
.send(request)
.await
Expand All @@ -306,7 +307,21 @@ async fn http_response(
message: x.to_string(),
})?;

let result = run_retrieval_with_data_report(retrieve, &response_string, context, settings);
let result = run_retrieval_with_data_report(retrieve, &response_string, context, settings).map(
|report| {
let completion_ts = std::time::SystemTime::now();

RadonReport {
aesedepece marked this conversation as resolved.
Show resolved Hide resolved
context: ReportContext {
start_time: Some(start_ts),
completion_time: Some(completion_ts),
..report.context
},
running_time: completion_ts.duration_since(start_ts).unwrap_or_default(),
..report
}
},
);

match &result {
Ok(report) => {
Expand Down
Loading