Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
lib/gitlab/metrics/sampler.rb
lib/gitlab/metrics/sampler.rb
+3
-1
spec/lib/gitlab/metrics/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
...
@@ -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
...
...
spec/lib/gitlab/metrics/sampler_spec.rb
View file @
09a31156
...
@@ -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
...
...
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