Ittt #52
3 changed files with 19 additions and 2 deletions
|
@ -118,6 +118,11 @@ var (
|
||||||
Name: "http3_blob_download_total",
|
Name: "http3_blob_download_total",
|
||||||
Help: "Total number of blobs downloaded from reflector through QUIC protocol",
|
Help: "Total number of blobs downloaded from reflector through QUIC protocol",
|
||||||
})
|
})
|
||||||
|
HttpDownloadCount = promauto.NewCounter(prometheus.CounterOpts{
|
||||||
|
Namespace: ns,
|
||||||
|
Name: "http_blob_download_total",
|
||||||
|
Help: "Total number of blobs downloaded from reflector through HTTP protocol",
|
||||||
|
})
|
||||||
|
|
||||||
CacheHitCount = promauto.NewCounterVec(prometheus.CounterOpts{
|
CacheHitCount = promauto.NewCounterVec(prometheus.CounterOpts{
|
||||||
Namespace: ns,
|
Namespace: ns,
|
||||||
|
@ -204,6 +209,11 @@ var (
|
||||||
Name: "udp_out_bytes",
|
Name: "udp_out_bytes",
|
||||||
Help: "Total number of bytes streamed out through UDP",
|
Help: "Total number of bytes streamed out through UDP",
|
||||||
})
|
})
|
||||||
|
MtrOutBytesHttp = promauto.NewCounter(prometheus.CounterOpts{
|
||||||
|
Namespace: ns,
|
||||||
|
Name: "http_out_bytes",
|
||||||
|
Help: "Total number of bytes streamed out through UDP",
|
||||||
|
})
|
||||||
MtrInBytesReflector = promauto.NewCounter(prometheus.CounterOpts{
|
MtrInBytesReflector = promauto.NewCounter(prometheus.CounterOpts{
|
||||||
Namespace: ns,
|
Namespace: ns,
|
||||||
Name: "reflector_in_bytes",
|
Name: "reflector_in_bytes",
|
||||||
|
|
|
@ -5,7 +5,10 @@ import (
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/lbryio/lbry.go/v2/extras/errors"
|
"github.com/lbryio/lbry.go/v2/extras/errors"
|
||||||
|
|
||||||
|
"github.com/lbryio/reflector.go/internal/metrics"
|
||||||
"github.com/lbryio/reflector.go/store"
|
"github.com/lbryio/reflector.go/store"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -33,6 +36,9 @@ func (s *Server) getBlob(c *gin.Context) {
|
||||||
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
_ = c.AbortWithError(http.StatusInternalServerError, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
metrics.MtrOutBytesHttp.Add(float64(len(blob)))
|
||||||
|
metrics.BlobDownloadCount.Inc()
|
||||||
|
metrics.HttpDownloadCount.Inc()
|
||||||
c.Header("Via", serialized)
|
c.Header("Via", serialized)
|
||||||
c.Header("Content-Disposition", "filename="+hash)
|
c.Header("Content-Disposition", "filename="+hash)
|
||||||
c.Data(http.StatusOK, "application/octet-stream", blob)
|
c.Data(http.StatusOK, "application/octet-stream", blob)
|
||||||
|
|
|
@ -8,10 +8,11 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/lbryio/lbry.go/v2/extras/errors"
|
|
||||||
"github.com/lbryio/lbry.go/v2/stream"
|
|
||||||
"github.com/lbryio/reflector.go/internal/metrics"
|
"github.com/lbryio/reflector.go/internal/metrics"
|
||||||
"github.com/lbryio/reflector.go/shared"
|
"github.com/lbryio/reflector.go/shared"
|
||||||
|
|
||||||
|
"github.com/lbryio/lbry.go/v2/extras/errors"
|
||||||
|
"github.com/lbryio/lbry.go/v2/stream"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NoopStore is a store that does nothing
|
// NoopStore is a store that does nothing
|
||||||
|
|
Loading…
Reference in a new issue