Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2020-09-21 09:05:11 +0300
committerJaime Martinez <jmartinez@gitlab.com>2020-09-24 03:22:45 +0300
commitec0553079f31cd244298353589a9c84ccf8c82d2 (patch)
treeae417c05f634be568bdc8fc056d47e8a4897e9c1 /internal/serving
parenta451e2b0683d46e2ce2d7a92181eb4379dddf866 (diff)
Use same metric but with labels
Diffstat (limited to 'internal/serving')
-rw-r--r--internal/serving/disk/local/serving.go3
-rw-r--r--internal/serving/disk/serving.go7
-rw-r--r--internal/serving/disk/zip/serving.go3
3 files changed, 5 insertions, 8 deletions
diff --git a/internal/serving/disk/local/serving.go b/internal/serving/disk/local/serving.go
index 2882a301..95aebd10 100644
--- a/internal/serving/disk/local/serving.go
+++ b/internal/serving/disk/local/serving.go
@@ -5,10 +5,9 @@ import (
"gitlab.com/gitlab-org/gitlab-pages/internal/serving/disk"
"gitlab.com/gitlab-org/gitlab-pages/internal/vfs"
"gitlab.com/gitlab-org/gitlab-pages/internal/vfs/local"
- "gitlab.com/gitlab-org/gitlab-pages/metrics"
)
-var instance = disk.New(vfs.Instrumented(local.New("local")), metrics.VFSServingFileSize)
+var instance = disk.New(vfs.Instrumented(local.New("local")))
// Instance returns a serving instance that is capable of reading files
// from the disk
diff --git a/internal/serving/disk/serving.go b/internal/serving/disk/serving.go
index 312ed093..cb3f2187 100644
--- a/internal/serving/disk/serving.go
+++ b/internal/serving/disk/serving.go
@@ -3,11 +3,10 @@ package disk
import (
"os"
- "github.com/prometheus/client_golang/prometheus"
-
"gitlab.com/gitlab-org/gitlab-pages/internal/httperrors"
"gitlab.com/gitlab-org/gitlab-pages/internal/serving"
"gitlab.com/gitlab-org/gitlab-pages/internal/vfs"
+ "gitlab.com/gitlab-org/gitlab-pages/metrics"
)
// Disk describes a disk access serving
@@ -43,10 +42,10 @@ func (s *Disk) ServeNotFoundHTTP(h serving.Handler) {
// New returns a serving instance that is capable of reading files
// from the VFS
-func New(vfs vfs.VFS, fileSizeMetric *prometheus.HistogramVec) serving.Serving {
+func New(vfs vfs.VFS) serving.Serving {
return &Disk{
reader: Reader{
- fileSizeMetric: fileSizeMetric,
+ fileSizeMetric: metrics.VFSServingFileSize,
vfs: vfs,
},
}
diff --git a/internal/serving/disk/zip/serving.go b/internal/serving/disk/zip/serving.go
index 63578379..e9a5f1fa 100644
--- a/internal/serving/disk/zip/serving.go
+++ b/internal/serving/disk/zip/serving.go
@@ -5,10 +5,9 @@ import (
"gitlab.com/gitlab-org/gitlab-pages/internal/serving/disk"
"gitlab.com/gitlab-org/gitlab-pages/internal/vfs"
"gitlab.com/gitlab-org/gitlab-pages/internal/vfs/zip"
- "gitlab.com/gitlab-org/gitlab-pages/metrics"
)
-var instance = disk.New(vfs.Instrumented(zip.New("zip")), metrics.VFSServingFileSize)
+var instance = disk.New(vfs.Instrumented(zip.New("zip")))
// Instance returns a serving instance that is capable of reading files
// from a zip archives opened from a URL, most likely stored in object storage