summaryrefslogtreecommitdiff
path: root/spec/initializers/lograge_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/initializers/lograge_spec.rb')
-rw-r--r--spec/initializers/lograge_spec.rb24
1 files changed, 22 insertions, 2 deletions
diff --git a/spec/initializers/lograge_spec.rb b/spec/initializers/lograge_spec.rb
index d5f9ef569c7..abb1673bb88 100644
--- a/spec/initializers/lograge_spec.rb
+++ b/spec/initializers/lograge_spec.rb
@@ -64,11 +64,11 @@ RSpec.describe 'lograge', type: :request do
)
expect(Lograge.formatter).to receive(:call)
- .with(a_hash_including(cpu_s: 0.11))
+ .with(a_hash_including(cpu_s: 0.111112))
.and_call_original
expect(Lograge.logger).to receive(:send)
- .with(anything, include('"cpu_s":0.11'))
+ .with(anything, include('"cpu_s":0.111112'))
.and_call_original
subject
@@ -89,6 +89,26 @@ RSpec.describe 'lograge', type: :request do
subject
end
+ context 'when logging memory allocations' do
+ include MemoryInstrumentationHelper
+
+ before do
+ skip_memory_instrumentation!
+ end
+
+ it 'logs memory usage metrics' do
+ expect(Lograge.formatter).to receive(:call)
+ .with(a_hash_including(:mem_objects))
+ .and_call_original
+
+ expect(Lograge.logger).to receive(:send)
+ .with(anything, include('"mem_objects":'))
+ .and_call_original
+
+ subject
+ end
+ end
+
it 'limits param size' do
expect(Lograge.formatter).to receive(:call)
.with(a_hash_including(params: limited_params))