Skip to content

Commit

Permalink
Merge pull request #128 from hathitrust/DEV-1203
Browse files Browse the repository at this point in the history
DEV-1203: Additional ingest performance monitoring (collate/storage)
  • Loading branch information
mwarin authored Jul 25, 2024
2 parents 5092d14 + 5bb6762 commit 175ef5b
Show file tree
Hide file tree
Showing 22 changed files with 2,139 additions and 1,620 deletions.
28 changes: 13 additions & 15 deletions bin/metrics_exporter.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,22 @@
# Metrics exporter for prometheus statistics gathered via ingest.
# Usage: plackup -p 9090 ./bin/metrics_exporter.pl

my $metrics = HTFeed::JobMetrics->get_instance();
my $metrics = HTFeed::JobMetrics->new();

my $app = sub {
my $env = shift;
my $env = shift;

my $rendered = $metrics->pretty();
my $rendered = $metrics->pretty();
my $response = Plack::Response->new();
$response->content_type('text/plain');

my $response = Plack::Response->new();
$response->content_type('text/plain');

if ($rendered) {
$response->status(200);
$response->body($rendered);
} else {
$response->status(500);
$response->body("# metrics rendering failed");
}

return $response->finalize;
if ($rendered) {
$response->status(200);
$response->body($rendered);
} else {
$response->status(500);
$response->body("# metrics rendering failed");
}

return $response->finalize;
};
Loading

0 comments on commit 175ef5b

Please sign in to comment.