Skip to content

Commit 9ea664f

Browse files
authored
Use Rails.env.test? in README (#273)
1 parent 4281f75 commit 9ea664f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ gem 'prometheus_exporter'
188188
In an initializer:
189189

190190
```ruby
191-
unless Rails.env == "test"
191+
unless Rails.env.test?
192192
require 'prometheus_exporter/middleware'
193193

194194
# 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
341341

342342
```ruby
343343
# in an initializer
344-
unless Rails.env == "test"
344+
unless Rails.env.test?
345345
require 'prometheus_exporter/instrumentation'
346346

347347
# this reports basic process stats like RSS and GC info
@@ -522,7 +522,7 @@ All metrics have labels for `job_name` and `queue_name`.
522522
In an initializer:
523523

524524
```ruby
525-
unless Rails.env == "test"
525+
unless Rails.env.test?
526526
require 'prometheus_exporter/instrumentation'
527527
PrometheusExporter::Instrumentation::DelayedJob.register_plugin
528528
end
@@ -548,7 +548,7 @@ All metrics have labels for `job_name` and `queue_name`.
548548
Capture [Hutch](https://github.com/gocardless/hutch) metrics (how many jobs ran? how many failed? how long did they take?)
549549

550550
```ruby
551-
unless Rails.env == "test"
551+
unless Rails.env.test?
552552
require 'prometheus_exporter/instrumentation'
553553
Hutch::Config.set(:tracer, PrometheusExporter::Instrumentation::Hutch)
554554
end

0 commit comments

Comments
 (0)