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
46bfd85d
Commit
46bfd85d
authored
Jan 12, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into ce_upstream
parents
d92f4de1
9cbdc2d8
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
64 additions
and
54 deletions
+64
-54
CHANGELOG
CHANGELOG
+1
-0
GITLAB_WORKHORSE_VERSION
GITLAB_WORKHORSE_VERSION
+1
-1
app/helpers/notes_helper.rb
app/helpers/notes_helper.rb
+1
-1
app/views/admin/users/show.html.haml
app/views/admin/users/show.html.haml
+16
-0
app/views/projects/notes/_edit_form.html.haml
app/views/projects/notes/_edit_form.html.haml
+2
-2
app/views/projects/notes/_form.html.haml
app/views/projects/notes/_form.html.haml
+1
-1
doc/install/installation.md
doc/install/installation.md
+1
-1
doc/update/8.2-to-8.3.md
doc/update/8.2-to-8.3.md
+1
-1
doc/update/patch_versions.md
doc/update/patch_versions.md
+1
-0
lib/gitlab/metrics.rb
lib/gitlab/metrics.rb
+0
-14
lib/gitlab/metrics/subscribers/action_view.rb
lib/gitlab/metrics/subscribers/action_view.rb
+1
-9
lib/gitlab/metrics/transaction.rb
lib/gitlab/metrics/transaction.rb
+12
-3
spec/lib/gitlab/metrics/subscribers/action_view_spec.rb
spec/lib/gitlab/metrics/subscribers/action_view_spec.rb
+1
-8
spec/lib/gitlab/metrics/transaction_spec.rb
spec/lib/gitlab/metrics/transaction_spec.rb
+25
-4
spec/lib/gitlab/metrics_spec.rb
spec/lib/gitlab/metrics_spec.rb
+0
-9
No files found.
CHANGELOG
View file @
46bfd85d
...
...
@@ -7,6 +7,7 @@ v 8.4.0 (unreleased)
- Improved performance of finding issues for an entire group (Yorick Peterse)
- Added custom application performance measuring system powered by InfluxDB (Yorick Peterse)
- Bump fog to 1.36.0 (Stan Hu)
- Add user's last used IP addresses to admin page (Stan Hu)
- Add housekeeping function to project settings page
- The default GitLab logo now acts as a loading indicator
- Fix caching issue where build status was not updating in project dashboard (Stan Hu)
...
...
GITLAB_WORKHORSE_VERSION
View file @
46bfd85d
0.5.
3
0.5.
4
app/helpers/notes_helper.rb
View file @
46bfd85d
...
...
@@ -67,7 +67,7 @@ module NotesHelper
line_type:
line_type
}
button_tag
class:
'btn reply-btn js-discussion-reply-button'
,
button_tag
class:
'btn
btn-nr
reply-btn js-discussion-reply-button'
,
data:
data
,
title:
'Add a reply'
do
link_text
=
icon
(
'comment'
)
link_text
<<
' Reply'
...
...
app/views/admin/users/show.html.haml
View file @
46bfd85d
...
...
@@ -70,6 +70,14 @@
%strong
.cred
No
%li
%span
.light
Current sign-in IP:
%strong
-
if
@user
.
current_sign_in_ip
=
@user
.
current_sign_in_ip
-
else
never
%li
%span
.light
Current sign-in at:
%strong
...
...
@@ -78,6 +86,14 @@
-
else
never
%li
%span
.light
Last sign-in IP:
%strong
-
if
@user
.
last_sign_in_ip
=
@user
.
last_sign_in_ip
-
else
never
%li
%span
.light
Last sign-in at:
%strong
...
...
app/views/projects/notes/_edit_form.html.haml
View file @
46bfd85d
...
...
@@ -6,5 +6,5 @@
=
render
'projects/notes/hints'
.note-form-actions
=
f
.
submit
'Save Comment'
,
class:
'btn btn-
primary
btn-save btn-grouped js-comment-button'
=
link_to
'Cancel'
,
'#'
,
class:
'btn btn-cancel note-edit-cancel'
=
f
.
submit
'Save Comment'
,
class:
'btn btn-
nr
btn-save btn-grouped js-comment-button'
=
link_to
'Cancel'
,
'#'
,
class:
'btn btn-
nr btn-
cancel note-edit-cancel'
app/views/projects/notes/_form.html.haml
View file @
46bfd85d
...
...
@@ -15,4 +15,4 @@
.note-form-actions.clearfix
=
f
.
submit
'Add Comment'
,
class:
"btn btn-nr btn-create comment-btn btn-grouped js-comment-button"
=
yield
(
:note_actions
)
%a
.btn.btn-cancel.js-close-discussion-note-form
Cancel
%a
.btn.btn-
nr.btn-
cancel.js-close-discussion-note-form
Cancel
doc/install/installation.md
View file @
46bfd85d
...
...
@@ -351,7 +351,7 @@ GitLab Shell is an SSH access and repository management software developed speci
cd /home/git
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-workhorse.git
cd gitlab-workhorse
sudo -u git -H git checkout 0.5.
3
sudo -u git -H git checkout 0.5.
4
sudo -u git -H make
### Initialize Database and Activate Advanced Features
...
...
doc/update/8.2-to-8.3.md
View file @
46bfd85d
...
...
@@ -78,7 +78,7 @@ which should already be on your system from GitLab 8.1.
```
bash
cd
/home/git/gitlab-workhorse
sudo
-u
git
-H
git fetch
--all
sudo
-u
git
-H
git checkout 0.5.
3
sudo
-u
git
-H
git checkout 0.5.
4
sudo
-u
git
-H
make
```
...
...
doc/update/patch_versions.md
View file @
46bfd85d
...
...
@@ -48,6 +48,7 @@ sudo -u git -H git checkout v`cat /home/git/gitlab/GITLAB_SHELL_VERSION` -b v`ca
cd
/home/git/gitlab-workhorse
sudo
-u
git
-H
git fetch
sudo
-u
git
-H
git checkout
`
cat
/home/git/gitlab/GITLAB_WORKHORSE_VERSION
`
-b
`
cat
/home/git/gitlab/GITLAB_WORKHORSE_VERSION
`
sudo
-u
git
-H
make
```
### 5. Install libs, migrations, etc.
...
...
lib/gitlab/metrics.rb
View file @
46bfd85d
...
...
@@ -36,20 +36,6 @@ module Gitlab
@pool
end
# Returns a relative path and line number based on the last application call
# frame.
def
self
.
last_relative_application_frame
frame
=
caller_locations
.
find
do
|
l
|
l
.
path
.
start_with?
(
RAILS_ROOT
)
&&
!
l
.
path
.
start_with?
(
METRICS_ROOT
)
end
if
frame
return
frame
.
path
.
sub
(
PATH_REGEX
,
''
),
frame
.
lineno
else
return
nil
,
nil
end
end
def
self
.
submit_metrics
(
metrics
)
prepared
=
prepare_metrics
(
metrics
)
...
...
lib/gitlab/metrics/subscribers/action_view.rb
View file @
46bfd85d
...
...
@@ -33,16 +33,8 @@ module Gitlab
def
tags_for
(
event
)
path
=
relative_path
(
event
.
payload
[
:identifier
])
tags
=
{
view:
path
}
file
,
line
=
Metrics
.
last_relative_application_frame
if
file
and
line
tags
[
:file
]
=
file
tags
[
:line
]
=
line
end
tags
{
view:
path
}
end
def
current_transaction
...
...
lib/gitlab/metrics/transaction.rb
View file @
46bfd85d
...
...
@@ -23,20 +23,29 @@ module Gitlab
@values
=
Hash
.
new
(
0
)
@tags
=
{}
@action
=
action
@memory_before
=
0
@memory_after
=
0
end
def
duration
@finished_at
?
(
@finished_at
-
@started_at
)
*
1000.0
:
0.0
end
def
allocated_memory
@memory_after
-
@memory_before
end
def
run
Thread
.
current
[
THREAD_KEY
]
=
self
@started_at
=
Time
.
now
@memory_before
=
System
.
memory_usage
@started_at
=
Time
.
now
yield
ensure
@finished_at
=
Time
.
now
@memory_after
=
System
.
memory_usage
@finished_at
=
Time
.
now
Thread
.
current
[
THREAD_KEY
]
=
nil
end
...
...
@@ -65,7 +74,7 @@ module Gitlab
end
def
track_self
values
=
{
duration:
duration
}
values
=
{
duration:
duration
,
allocated_memory:
allocated_memory
}
@values
.
each
do
|
name
,
value
|
values
[
name
]
=
value
...
...
spec/lib/gitlab/metrics/subscribers/action_view_spec.rb
View file @
46bfd85d
...
...
@@ -14,19 +14,12 @@ describe Gitlab::Metrics::Subscribers::ActionView do
before
do
allow
(
subscriber
).
to
receive
(
:current_transaction
).
and_return
(
transaction
)
allow
(
Gitlab
::
Metrics
).
to
receive
(
:last_relative_application_frame
).
and_return
([
'app/views/x.html.haml'
,
4
])
end
describe
'#render_template'
do
it
'tracks rendering of a template'
do
values
=
{
duration:
2.1
}
tags
=
{
view:
'app/views/x.html.haml'
,
file:
'app/views/x.html.haml'
,
line:
4
}
tags
=
{
view:
'app/views/x.html.haml'
}
expect
(
transaction
).
to
receive
(
:increment
).
with
(
:view_duration
,
2.1
)
...
...
spec/lib/gitlab/metrics/transaction_spec.rb
View file @
46bfd85d
...
...
@@ -11,6 +11,14 @@ describe Gitlab::Metrics::Transaction do
end
end
describe
'#allocated_memory'
do
it
'returns the allocated memory in bytes'
do
transaction
.
run
{
'a'
*
32
}
expect
(
transaction
.
allocated_memory
).
to
be_a_kind_of
(
Numeric
)
end
end
describe
'#run'
do
it
'yields the supplied block'
do
expect
{
|
b
|
transaction
.
run
(
&
b
)
}.
to
yield_control
...
...
@@ -43,8 +51,10 @@ describe Gitlab::Metrics::Transaction do
transaction
.
increment
(
:time
,
1
)
transaction
.
increment
(
:time
,
2
)
values
=
{
duration:
0.0
,
time:
3
,
allocated_memory:
a_kind_of
(
Numeric
)
}
expect
(
transaction
).
to
receive
(
:add_metric
).
with
(
'transactions'
,
{
duration:
0.0
,
time:
3
}
,
{})
with
(
'transactions'
,
values
,
{})
transaction
.
track_self
end
...
...
@@ -54,8 +64,14 @@ describe Gitlab::Metrics::Transaction do
it
'sets a value'
do
transaction
.
set
(
:number
,
10
)
values
=
{
duration:
0.0
,
number:
10
,
allocated_memory:
a_kind_of
(
Numeric
)
}
expect
(
transaction
).
to
receive
(
:add_metric
).
with
(
'transactions'
,
{
duration:
0.0
,
number:
10
}
,
{})
with
(
'transactions'
,
values
,
{})
transaction
.
track_self
end
...
...
@@ -80,8 +96,13 @@ describe Gitlab::Metrics::Transaction do
describe
'#track_self'
do
it
'adds a metric for the transaction itself'
do
values
=
{
duration:
transaction
.
duration
,
allocated_memory:
a_kind_of
(
Numeric
)
}
expect
(
transaction
).
to
receive
(
:add_metric
).
with
(
'transactions'
,
{
duration:
transaction
.
duration
}
,
{})
with
(
'transactions'
,
values
,
{})
transaction
.
track_self
end
...
...
@@ -104,7 +125,7 @@ describe Gitlab::Metrics::Transaction do
hash
=
{
series:
'rails_transactions'
,
tags:
{
action:
'Foo#bar'
},
values:
{
duration:
0.0
},
values:
{
duration:
0.0
,
allocated_memory:
a_kind_of
(
Numeric
)
},
timestamp:
an_instance_of
(
Fixnum
)
}
...
...
spec/lib/gitlab/metrics_spec.rb
View file @
46bfd85d
...
...
@@ -13,15 +13,6 @@ describe Gitlab::Metrics do
end
end
describe
'.last_relative_application_frame'
do
it
'returns an Array containing a file path and line number'
do
file
,
line
=
described_class
.
last_relative_application_frame
expect
(
line
).
to
eq
(
__LINE__
-
2
)
expect
(
file
).
to
eq
(
'spec/lib/gitlab/metrics_spec.rb'
)
end
end
describe
'#submit_metrics'
do
it
'prepares and writes the metrics to InfluxDB'
do
connection
=
double
(
:connection
)
...
...
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