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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
15b8a375
Commit
15b8a375
authored
Sep 28, 2020
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Increment only a single trace bytes counter
parent
911ff9eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
lib/gitlab/ci/trace/metrics.rb
lib/gitlab/ci/trace/metrics.rb
+1
-1
spec/lib/gitlab/ci/trace/metrics_spec.rb
spec/lib/gitlab/ci/trace/metrics_spec.rb
+18
-0
No files found.
lib/gitlab/ci/trace/metrics.rb
View file @
15b8a375
...
...
@@ -18,7 +18,7 @@ module Gitlab
end
def
increment_trace_bytes
(
size
)
self
.
class
.
trace_bytes
.
increment
(
by:
size
.
to_i
)
self
.
class
.
trace_bytes
.
increment
(
{},
size
.
to_i
)
end
def
self
.
trace_operations
...
...
spec/lib/gitlab/ci/trace/metrics_spec.rb
0 → 100644
View file @
15b8a375
# 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
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