Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-workhorse
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-workhorse
Commits
304bc473
Commit
304bc473
authored
Feb 10, 2017
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace Summary with Histogram
parent
69184863
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
internal/queueing/queue.go
internal/queueing/queue.go
+6
-10
No files found.
internal/queueing/queue.go
View file @
304bc473
...
...
@@ -34,14 +34,10 @@ var (
Help
:
"How many requests are now queued"
,
})
queueingWaitingTime
=
prometheus
.
New
Summary
(
prometheus
.
Summary
Opts
{
queueingWaitingTime
=
prometheus
.
New
Histogram
(
prometheus
.
Histogram
Opts
{
Name
:
"gitlab_workhorse_queueing_waiting_time"
,
Help
:
"How many time a request spent in queue (0.5 and 0.95 percentile)"
,
Objectives
:
map
[
float64
]
float64
{
0.50
:
0.05
,
0.95
:
0.005
,
0.99
:
0.001
,
},
Help
:
"How many time a request spent in queue"
,
Buckets
:
[]
float64
{
0.01
,
0.02
,
0.05
,
0.10
,
0.20
,
0.50
,
1.00
,
2.00
,
5.00
,
10.00
,
30.00
,
60.00
},
})
queueingErrors
=
prometheus
.
NewCounterVec
(
...
...
@@ -100,7 +96,7 @@ func (s *Queue) Acquire(timeout time.Duration) (err error) {
if
err
!=
nil
{
waitStarted
:=
<-
s
.
waitingCh
queueingWaiting
.
Dec
()
queueingWaitingTime
.
Observe
(
float64
(
time
.
Since
(
waitStarted
)))
queueingWaitingTime
.
Observe
(
float64
(
time
.
Since
(
waitStarted
)
.
Seconds
()
))
}
}()
...
...
@@ -134,7 +130,7 @@ func (s *Queue) Release() {
// dequeue from queue to allow next request to be processed
waitStarted
:=
<-
s
.
waitingCh
queueingWaiting
.
Dec
()
queueingWaitingTime
.
Observe
(
float64
(
time
.
Since
(
waitStarted
)))
queueingWaitingTime
.
Observe
(
float64
(
time
.
Since
(
waitStarted
)
.
Seconds
()
))
<-
s
.
busyCh
queueingBusy
.
Dec
()
...
...
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