From 9ea664f91c19fe8f2d0cb5ed41b655d02ed0794c Mon Sep 17 00:00:00 2001 From: Anders Mikkelsen Date: Fri, 5 May 2023 02:13:45 +0200 Subject: [PATCH] Use Rails.env.test? in README (#273) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f54862b..e7b57ce 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,7 @@ gem 'prometheus_exporter' In an initializer: ```ruby -unless Rails.env == "test" +unless Rails.env.test? require 'prometheus_exporter/middleware' # This reports stats per request like HTTP status and timings @@ -341,7 +341,7 @@ You may also be interested in per-process stats. This collects memory and GC sta ```ruby # in an initializer -unless Rails.env == "test" +unless Rails.env.test? require 'prometheus_exporter/instrumentation' # this reports basic process stats like RSS and GC info @@ -522,7 +522,7 @@ All metrics have labels for `job_name` and `queue_name`. In an initializer: ```ruby -unless Rails.env == "test" +unless Rails.env.test? require 'prometheus_exporter/instrumentation' PrometheusExporter::Instrumentation::DelayedJob.register_plugin end @@ -548,7 +548,7 @@ All metrics have labels for `job_name` and `queue_name`. Capture [Hutch](https://github.com/gocardless/hutch) metrics (how many jobs ran? how many failed? how long did they take?) ```ruby -unless Rails.env == "test" +unless Rails.env.test? require 'prometheus_exporter/instrumentation' Hutch::Config.set(:tracer, PrometheusExporter::Instrumentation::Hutch) end