Commit 15b8a375 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Increment only a single trace bytes counter

parent 911ff9eb
...@@ -18,7 +18,7 @@ module Gitlab ...@@ -18,7 +18,7 @@ module Gitlab
end end
def increment_trace_bytes(size) def increment_trace_bytes(size)
self.class.trace_bytes.increment(by: size.to_i) self.class.trace_bytes.increment({}, size.to_i)
end end
def self.trace_operations 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