File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ class HathiTrust < Thor
1212 that Umich is the digitizer of the item.
1313 DESC
1414 def set_digitizer
15+ start_time = Time . now . to_i
16+ AIM ::HathiTrust ::DigitizerSetter . configure
1517 AIM ::HathiTrust ::DigitizerSetter . new . run
18+ AIM ::HathiTrust ::DigitizerSetter . send_metrics ( start_time )
1619 end
1720 end
1821
Original file line number Diff line number Diff line change 11module AIM
22 module HathiTrust
33 class DigitizerSetter
4+ def self . configure
5+ ::Yabeda . configure do
6+ gauge :aim_hathi_trust_set_digitizer_last_success , comment : "Start time of the last Set Digitizer Job that successfully finished."
7+ end
8+ Yabeda . configure!
9+ end
10+
11+ def self . send_metrics ( start_time )
12+ Yabeda . aim_hathi_trust_set_digitizer_last_success . set ( { } , start_time )
13+ begin
14+ Yabeda ::Prometheus . push_gateway . add ( Yabeda ::Prometheus . registry )
15+ rescue
16+ Logger . new ( $stdout) . error ( "Failed to contact the push gateway" )
17+ end
18+ end
19+
420 def initialize ( logger : Logger . new ( $stdout) )
521 @logger = logger
622 end
You can’t perform that action at this time.
0 commit comments