Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gitlab-exporter
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gitlab-org
gitlab-exporter
Commits
36bcca52
Commit
36bcca52
authored
May 02, 2019
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce memory allocations parsing smaps files
parent
05311f6d
Pipeline
#110928
passed with stage
in 50 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
lib/gitlab_monitor/memstats.rb
lib/gitlab_monitor/memstats.rb
+2
-0
lib/gitlab_monitor/memstats/mapping.rb
lib/gitlab_monitor/memstats/mapping.rb
+14
-3
lib/gitlab_monitor/process.rb
lib/gitlab_monitor/process.rb
+2
-0
No files found.
lib/gitlab_monitor/memstats.rb
View file @
36bcca52
# frozen_string_literal: true
require_relative
"memstats/mapping"
# Ported from https://github.com/discourse/discourse/blob/master/script/memstats.rb
...
...
lib/gitlab_monitor/memstats/mapping.rb
View file @
36bcca52
# frozen_string_literal: true
module
GitLab
module
Monitor
module
MemStats
...
...
@@ -56,7 +58,9 @@ module GitLab
end
def
parse_first_line
(
line
)
parts
=
line
.
strip
.
split
line
.
strip!
parts
=
line
.
split
@address_start
,
@address_end
=
parts
[
0
].
split
(
"-"
)
@perms
=
parts
[
1
]
@offset
=
parts
[
2
]
...
...
@@ -66,8 +70,15 @@ module GitLab
end
def
parse_field_line
(
line
)
parts
=
line
.
strip
.
split
field
=
parts
[
0
].
downcase
.
sub
(
":"
,
""
)
line
.
strip!
parts
=
line
.
split
return
unless
parts
parts
[
0
].
downcase!
parts
[
0
].
sub!
(
":"
,
""
)
field
=
parts
[
0
]
return
unless
respond_to?
"
#{
field
}
="
...
...
lib/gitlab_monitor/process.rb
View file @
36bcca52
# frozen_string_literal: true
require_relative
"memstats"
module
GitLab
...
...
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