diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2020-09-29 09:44:16 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2020-09-30 07:33:27 +0300 |
commit | 8dcfd518cf1a1a5f570fe43718a3cff8d8cd5ca0 (patch) | |
tree | 3834b69d2ceceb7c6ab71375e542b0f6ec96b0c6 /internal/vfs/zip/archive.go | |
parent | 2e9bd40bd61de95cbb8c7e598c71753d3f7475cb (diff) |
Add more metrics for zip serving
Adds a bunch of new metrics related to
https://gitlab.com/gitlab-org/gitlab-pages/-/issues/423.
It uses [httptrace.ClienTrace](https://golang.org/src/net/http/httptrace/trace.go)
to add a bunch of very granular metrics that happen when an http connection is established.
Diffstat (limited to 'internal/vfs/zip/archive.go')
-rw-r--r-- | internal/vfs/zip/archive.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/vfs/zip/archive.go b/internal/vfs/zip/archive.go index ce7d2ec8..cfcdee76 100644 --- a/internal/vfs/zip/archive.go +++ b/internal/vfs/zip/archive.go @@ -16,6 +16,7 @@ import ( "gitlab.com/gitlab-org/gitlab-pages/internal/httprange" "gitlab.com/gitlab-org/gitlab-pages/internal/vfs" + "gitlab.com/gitlab-org/gitlab-pages/metrics" ) const ( @@ -127,6 +128,9 @@ func (a *zipArchive) readArchive() { // recycle memory a.archive.File = nil + + metrics.ZipServingFilesPerArchiveCount.Observe(float64(len(a.files))) + metrics.ZipServingOpenArchivesTotal.Inc() } func (a *zipArchive) findFile(name string) *zip.File { |