BigW Consortium Gitlab

Commit 09a31156 by Yorick Peterse

Track object count types as tags

parent 6dc25ad5
......@@ -53,7 +53,9 @@ module Gitlab
end
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
def sample_gc
......
......@@ -71,7 +71,8 @@ describe Gitlab::Metrics::Sampler do
describe '#sample_objects' do
it 'adds a metric containing the amount of allocated objects' do
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
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