Report stats on evaluation duration per-branch
This commit is contained in:
parent
cdb88316b9
commit
cc464aebfb
|
@ -244,7 +244,9 @@ fn events() -> Vec<MetricType> {
|
||||||
Metric::counter(
|
Metric::counter(
|
||||||
"EvaluationDuration",
|
"EvaluationDuration",
|
||||||
"Amount of time spent running evaluations",
|
"Amount of time spent running evaluations",
|
||||||
None
|
Some(vec![
|
||||||
|
("branch", "String"),
|
||||||
|
]),
|
||||||
),
|
),
|
||||||
Metric::ticker(
|
Metric::ticker(
|
||||||
"JobDecodeSuccess",
|
"JobDecodeSuccess",
|
||||||
|
|
|
@ -11,7 +11,7 @@ use std::path::PathBuf;
|
||||||
use ofborg::checkout;
|
use ofborg::checkout;
|
||||||
use ofborg::message::{massrebuildjob, buildjob};
|
use ofborg::message::{massrebuildjob, buildjob};
|
||||||
use ofborg::nix::Nix;
|
use ofborg::nix::Nix;
|
||||||
|
use std::time::Instant;
|
||||||
use ofborg::acl::ACL;
|
use ofborg::acl::ACL;
|
||||||
use ofborg::stats;
|
use ofborg::stats;
|
||||||
use ofborg::stats::Event;
|
use ofborg::stats::Event;
|
||||||
|
@ -186,6 +186,8 @@ impl<E: stats::SysEvents + 'static> worker::SimpleWorker for MassRebuildWorker<E
|
||||||
hubcaps::statuses::State::Pending,
|
hubcaps::statuses::State::Pending,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let target_branch_rebuild_sniff_start = Instant::now();
|
||||||
|
|
||||||
if let Err(mut output) = rebuildsniff.find_before() {
|
if let Err(mut output) = rebuildsniff.find_before() {
|
||||||
overall_status.set_url(make_gist(
|
overall_status.set_url(make_gist(
|
||||||
&gists,
|
&gists,
|
||||||
|
@ -201,6 +203,12 @@ impl<E: stats::SysEvents + 'static> worker::SimpleWorker for MassRebuildWorker<E
|
||||||
|
|
||||||
return self.actions().skip(&job);
|
return self.actions().skip(&job);
|
||||||
}
|
}
|
||||||
|
self.events.notify(
|
||||||
|
Event::EvaluationDuration(
|
||||||
|
target_branch.clone(),
|
||||||
|
target_branch_rebuild_sniff_start.elapsed().as_secs(),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
overall_status.set_with_description("Fetching PR", hubcaps::statuses::State::Pending);
|
overall_status.set_with_description("Fetching PR", hubcaps::statuses::State::Pending);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue