提交 846b6b5d 作者: whyrusleeping 提交者: Steven Allen

add unixfs get metric

License: MIT
Signed-off-by: 's avatarwhyrusleeping <why@ipfs.io>
上级 5311ac0b
......@@ -123,6 +123,7 @@ func (i *gatewayHandler) optionsHandler(w http.ResponseWriter, r *http.Request)
}
func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request) {
begin := time.Now()
urlPath := r.URL.Path
escapedURLPath := r.URL.EscapedPath()
......@@ -172,6 +173,7 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request
webError(w, "ipfs cat "+escapedURLPath, err, http.StatusNotFound)
return
}
unixfsGetMetric.Observe(time.Since(begin).Seconds())
defer dr.Close()
......
......@@ -97,6 +97,9 @@ var (
peersTotalMetric = prometheus.NewDesc(
prometheus.BuildFQName("ipfs", "p2p", "peers_total"),
"Number of connected peers", []string{"transport"}, nil)
unixfsGetMetric = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "unixfsGet",
})
)
type IpfsNodeCollector struct {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论