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
b00b2493
Commit
b00b2493
authored
Feb 05, 2018
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update multi file editor
parent
ca818ab6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
21 deletions
+4
-21
ee/lib/gitlab/metrics/multi_file_editor.rb
ee/lib/gitlab/metrics/multi_file_editor.rb
+4
-21
No files found.
ee/lib/gitlab/metrics/multi_file_editor.rb
View file @
b00b2493
...
@@ -7,14 +7,10 @@ module Gitlab
...
@@ -7,14 +7,10 @@ module Gitlab
@project
,
@current_user
,
@commit
=
project
,
current_user
,
commit
@project
,
@current_user
,
@commit
=
project
,
current_user
,
commit
end
end
def
record
def
log
return
unless
::
License
.
feature_available?
(
:ide
)
return
unless
::
License
.
feature_available?
(
:ide
)
metric
=
WebIdeMetric
.
new
(
metric_params
)
Rails
.
logger
.
info
(
"Web editor usage -
#{
metric_info
}
"
)
unless
metric
.
save
Rails
.
logger
.
error
(
"Error persisting Web IDE metric:
#{
metric
.
as_json
}
-
#{
metric
.
errors
.
full_messages
}
"
)
end
end
end
private
private
...
@@ -23,25 +19,12 @@ module Gitlab
...
@@ -23,25 +19,12 @@ module Gitlab
@commit
.
diffs
.
size
@commit
.
diffs
.
size
end
end
def
hashed_project
Digest
::
SHA256
.
hexdigest
(
"
#{
@project
.
id
}
-
#{
Rails
.
application
.
secrets
.
secret_key_base
}
"
)
end
def
hashed_user
Digest
::
SHA256
.
hexdigest
(
"
#{
@current_user
.
id
}
-
#{
Rails
.
application
.
secrets
.
secret_key_base
}
"
)
end
def
commit_stats
def
commit_stats
@commit
.
stats
@commit
.
stats
end
end
def
metric_params
def
metric_info
{
"ide_usage_project_id:
#{
@project
.
id
}
, ide_usage_user:
#{
@current_user
.
id
}
, ide_usage_line_count:
#{
line_changes_total
}
, ide_usage_file_count:
#{
files_total
}
"
project:
hashed_project
,
user:
hashed_user
,
line_count:
line_changes_total
,
file_count:
files_total
}
end
end
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