Skip to content

Commit

Permalink
Use Rails.env.test? in README (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersGM authored May 5, 2023
1 parent 4281f75 commit 9ea664f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9ea664f

Please sign in to comment.