Commit 27278244 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'fix/gb/fix-trace-rate-metric' into 'master'

Fix trace rate metric by using a correct interface

See merge request gitlab-org/gitlab!43587
parents 0e526c9d 15b8a375
......@@ -19,7 +19,7 @@ module Gitlab
end
def increment_trace_bytes(size)
self.class.trace_bytes.increment(by: size.to_i)
self.class.trace_bytes.increment({}, size.to_i)
end
def self.trace_operations
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Gitlab::Ci::Trace::Metrics do
describe '#increment_trace_bytes' do
context 'when incrementing by more than one' do
it 'increments a single counter' do
subject.increment_trace_bytes(10)
subject.increment_trace_bytes(20)
subject.increment_trace_bytes(30)
expect(described_class.trace_bytes.get).to eq 60
expect(described_class.trace_bytes.values.count).to eq 1
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment