2018-07-05 06:18:17 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-05-23 09:42:36 -04:00
|
|
|
require 'prometheus/client/formats/text'
|
|
|
|
|
|
|
|
class MetricsService
|
|
|
|
def prometheus_metrics_text
|
|
|
|
Prometheus::Client::Formats::Text.marshal_multiprocess(multiprocess_metrics_path)
|
|
|
|
end
|
|
|
|
|
2017-05-29 08:19:43 -04:00
|
|
|
def metrics_text
|
2018-07-12 13:37:51 -04:00
|
|
|
prometheus_metrics_text
|
2017-05-23 09:42:36 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def multiprocess_metrics_path
|
2017-07-19 04:54:39 -04:00
|
|
|
::Prometheus::Client.configuration.multiprocess_files_dir
|
2017-05-23 09:42:36 -04:00
|
|
|
end
|
|
|
|
end
|