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
7c11b4e7
Commit
7c11b4e7
authored
Apr 17, 2020
by
lauraMon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds rake task to seed dev metrics
parent
b16d052f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
ee/lib/tasks/gitlab/seed/metrics.rake
ee/lib/tasks/gitlab/seed/metrics.rake
+20
-0
No files found.
ee/lib/tasks/gitlab/seed/metrics.rake
View file @
7c11b4e7
...
...
@@ -27,6 +27,26 @@ namespace :gitlab do
query:
'sum(kube_pod_container_resource_requests_memory_bytes{kubernetes_namespace="gitlab-managed-apps"})/2^30'
,
legend:
'Requested (GiB)'
)
project
=
Project
.
find
(
args
.
project_id
)
content
=
File
.
read
(
Rails
.
root
.
join
(
'spec'
,
'fixtures'
,
'metrics'
,
'dashboard'
,
'development_metrics.yml'
))
project_attributes
=
[
project
.
creator
,
'.gitlab/dashboards/development_metrics.yml'
,
content
,
{
message:
'Seeded development metrics'
,
branch_name:
'master'
}
]
begin
project
.
repository
.
create_file
(
*
project_attributes
)
rescue
Gitlab
::
Git
::
Index
::
IndexError
=>
error
raise
error
unless
error
.
message
==
'A file with this name already exists'
project
.
repository
.
update_file
(
*
project_attributes
)
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