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
bad25752
Commit
bad25752
authored
Dec 09, 2016
by
Tomasz Maczukin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Count git clone/fetch bytes send
parent
be1c3faa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
internal/helper/logging.go
internal/helper/logging.go
+10
-0
No files found.
internal/helper/logging.go
View file @
bad25752
...
...
@@ -36,6 +36,14 @@ var (
},
[]
string
{
"ci"
},
)
cloneFetchBytes
=
prometheus
.
NewCounterVec
(
prometheus
.
CounterOpts
{
Name
:
"gitlab_workhorse_git_clone_fetch_bytes"
,
Help
:
"How many Git clone/fetch bytes for CI have been send by gitlab-workhorse, partitioned by CI yes/no status."
,
},
[]
string
{
"ci"
},
)
)
func
init
()
{
...
...
@@ -51,6 +59,7 @@ func registerPrometheusMetrics() {
prometheus
.
MustRegister
(
sessionsActive
)
prometheus
.
MustRegister
(
requestsTotal
)
prometheus
.
MustRegister
(
cloneFetchRequests
)
prometheus
.
MustRegister
(
cloneFetchBytes
)
}
type
LoggingResponseWriter
struct
{
...
...
@@ -118,4 +127,5 @@ func (l *LoggingResponseWriter) countCloneFetchRequests(r *http.Request) {
}
cloneFetchRequests
.
WithLabelValues
(
forCi
)
.
Inc
()
cloneFetchBytes
.
WithLabelValues
(
forCi
)
.
Add
(
float64
(
l
.
written
))
}
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