1 Star 0 Fork 0

dcharles / fabric-ca

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
metrics.go 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package metrics
import "github.com/hyperledger/fabric/common/metrics"
var (
// APICounterOpts define the counter opts for server APIs
APICounterOpts = metrics.CounterOpts{
Namespace: "api_request",
Subsystem: "",
Name: "count",
Help: "Number of requests made to an API",
LabelNames: []string{"ca_name", "api_name", "status_code"},
StatsdFormat: "%{#fqname}.%{ca_name}.%{api_name}.%{status_code}",
}
// APIDurationOpts define the duration opts for server APIs
APIDurationOpts = metrics.HistogramOpts{
Namespace: "api_request",
Subsystem: "",
Name: "duration",
Help: "Time taken in seconds for the request to an API to be completed",
LabelNames: []string{"ca_name", "api_name", "status_code"},
StatsdFormat: "%{#fqname}.%{ca_name}.%{api_name}.%{status_code}",
}
)
// Metrics are the metrics tracked by server
type Metrics struct {
// APICounter keeps track of number of times an API endpoint is called
APICounter metrics.Counter
// APIDuration keeps track of time taken for request to complete for an API
APIDuration metrics.Histogram
}
1
https://gitee.com/dcharles/fabric-ca-official.git
git@gitee.com:dcharles/fabric-ca-official.git
dcharles
fabric-ca-official
fabric-ca
v1.4.7

搜索帮助