Currently only shows per-machine build times
TF5HAPRDV6USGRKEEDIV263YZRUWGC4SKP3RXCBBVT7FEBGT5XFQC
JLQN6QYHNPQJOOY2CCV5WDIKNCISQ5A65FO6IHSHTSZZ54IJLBQAC
ICYJNJWHY6KBNLM2EMSW7VJ35OIOHN26JO3FG32VYTKNLFNZAREQC
HPGWVEFKM3DYLNLPMWLZI5VZXURUSVJ4FM2DPJCPR5HBOEQPASQQC
T4LLYESZ2HUXSLKZ6GNBLVWUVG7R5IDFHYHYO773QIZ6QTOOXR2AC
LBNVQXUBEZ45SOTGVXK5UEZXIAIZTJLWZNUYFI4JZ6J65N3KPDVQC
SZYDW2DG5Z7BR3ICKWDXVUNSMCDSXMYZUB6FQ4W2B2FVZJD6PULQC
J5UVLXOK6EDIL5I7VKWH4V2QDS4DPD7FHRK6XBWSXFRQS4JKXFZQC
SMM4HQTPAY45254O7GQOJVLHP5LZ6BXDKGNE7IKUJHB5XKH244ZAC
my $client = Net::Prometheus->new;
my $duration = $client->new_histogram(
name => "hydra_machine_build_duration",
help => "How long builds are taking per server. Note: counts are gauges, NOT counters.",
labels => [ "machine" ],
buckets => [
60,
600,
1800,
3600,
7200,
21600,
43200,
86400,
172800,
259200,
345600,
518400,
604800,
691200
]
);
my $steps = dbh($c)->selectall_arrayref(
"select machine, s.starttime as starttime " .
"from BuildSteps s join Builds b on s.build = b.id " .
"where busy != 0 order by machine, stepnr",
{ Slice => {} });
foreach my $step (@$steps) {
my $name = $step->{machine} ? Hydra::View::TT->stripSSHUser(undef, $step->{machine}) : "";
$name = "localhost" unless $name;
$duration->labels($name)->observe(time - $step->{starttime});
}
$c->stash->{'plain'} = { data => $client->render };
$c->forward('Hydra::View::Plain');
}