Commit 09a31156 authored by Yorick Peterse's avatar Yorick Peterse

Track object count types as tags

parent 6dc25ad5
...@@ -53,7 +53,9 @@ module Gitlab ...@@ -53,7 +53,9 @@ module Gitlab
end end
def sample_objects def sample_objects
@metrics << Metric.new('object_counts', ObjectSpace.count_objects) ObjectSpace.count_objects.each do |type, count|
@metrics << Metric.new('object_counts', { count: count }, type: type)
end
end end
def sample_gc def sample_gc
......
...@@ -71,7 +71,8 @@ describe Gitlab::Metrics::Sampler do ...@@ -71,7 +71,8 @@ describe Gitlab::Metrics::Sampler do
describe '#sample_objects' do describe '#sample_objects' do
it 'adds a metric containing the amount of allocated objects' do it 'adds a metric containing the amount of allocated objects' do
expect(Gitlab::Metrics::Metric).to receive(:new). expect(Gitlab::Metrics::Metric).to receive(:new).
with('object_counts', an_instance_of(Hash)). with('object_counts', an_instance_of(Hash), an_instance_of(Hash)).
at_least(:once).
and_call_original and_call_original
sampler.sample_objects sampler.sample_objects
......
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