Skip to content

Commit e051335

Browse files
committed
incr -> increment
1 parent c1217cd commit e051335

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
```ruby
2626
# increment a simple counter
27-
Sentry::Metrics.incr('button_click')
27+
Sentry::Metrics.increment('button_click')
2828
# set a value, unit and tags
2929
Sentry::Metrics.incr('time', 5, unit: 'second', tags: { browser:' firefox' })
3030

sentry-ruby/lib/sentry/metrics.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
module Sentry
1111
module Metrics
1212
class << self
13-
def incr(key, value = 1.0, unit: 'none', tags: {}, timestamp: nil)
13+
def increment(key, value = 1.0, unit: 'none', tags: {}, timestamp: nil)
1414
Sentry.metrics_aggregator&.add(:c, key, value, unit: unit, tags: tags, timestamp: timestamp)
1515
end
1616

sentry-ruby/spec/sentry/metrics_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
let(:aggregator) { Sentry.metrics_aggregator }
1111
let(:fake_time) { Time.new(2024, 1, 1, 1, 1, 3) }
1212

13-
describe '.incr' do
13+
describe '.increment' do
1414
it 'passes default value of 1.0 with only key' do
1515
expect(aggregator).to receive(:add).with(
1616
:c,
@@ -21,7 +21,7 @@
2121
timestamp: nil
2222
)
2323

24-
described_class.incr('foo')
24+
described_class.increment('foo')
2525
end
2626

2727
it 'passes through args to aggregator' do
@@ -34,7 +34,7 @@
3434
timestamp: fake_time
3535
)
3636

37-
described_class.incr('foo', 5.0, unit: 'second', tags: { fortytwo: 42 }, timestamp: fake_time)
37+
described_class.increment('foo', 5.0, unit: 'second', tags: { fortytwo: 42 }, timestamp: fake_time)
3838
end
3939
end
4040

0 commit comments

Comments
 (0)