BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
09a31156
Commit
09a31156
authored
Dec 10, 2015
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track object count types as tags
parent
6dc25ad5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
sampler.rb
lib/gitlab/metrics/sampler.rb
+3
-1
sampler_spec.rb
spec/lib/gitlab/metrics/sampler_spec.rb
+2
-1
No files found.
lib/gitlab/metrics/sampler.rb
View file @
09a31156
...
...
@@ -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
...
...
spec/lib/gitlab/metrics/sampler_spec.rb
View file @
09a31156
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment