代码拉取完成,页面将自动刷新
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package chaincode
import "github.com/hyperledger/fabric/common/metrics"
var (
launchDuration = metrics.HistogramOpts{
Namespace: "chaincode",
Name: "launch_duration",
Help: "The time to launch a chaincode.",
LabelNames: []string{"chaincode", "success"},
StatsdFormat: "%{#fqname}.%{chaincode}.%{success}",
}
launchFailures = metrics.CounterOpts{
Namespace: "chaincode",
Name: "launch_failures",
Help: "The number of chaincode launches that have failed.",
LabelNames: []string{"chaincode"},
StatsdFormat: "%{#fqname}.%{chaincode}",
}
launchTimeouts = metrics.CounterOpts{
Namespace: "chaincode",
Name: "launch_timeouts",
Help: "The number of chaincode launches that have timed out.",
LabelNames: []string{"chaincode"},
StatsdFormat: "%{#fqname}.%{chaincode}",
}
shimRequestsReceived = metrics.CounterOpts{
Namespace: "chaincode",
Name: "shim_requests_received",
Help: "The number of chaincode shim requests received.",
LabelNames: []string{"type", "channel", "chaincode"},
StatsdFormat: "%{#fqname}.%{type}.%{channel}.%{chaincode}",
}
shimRequestsCompleted = metrics.CounterOpts{
Namespace: "chaincode",
Name: "shim_requests_completed",
Help: "The number of chaincode shim requests completed.",
LabelNames: []string{"type", "channel", "chaincode", "success"},
StatsdFormat: "%{#fqname}.%{type}.%{channel}.%{chaincode}.%{success}",
}
shimRequestDuration = metrics.HistogramOpts{
Namespace: "chaincode",
Name: "shim_request_duration",
Help: "The time to complete chaincode shim requests.",
LabelNames: []string{"type", "channel", "chaincode", "success"},
StatsdFormat: "%{#fqname}.%{type}.%{channel}.%{chaincode}.%{success}",
}
executeTimeouts = metrics.CounterOpts{
Namespace: "chaincode",
Name: "execute_timeouts",
Help: "The number of chaincode executions (Init or Invoke) that have timed out.",
LabelNames: []string{"chaincode"},
StatsdFormat: "%{#fqname}.%{chaincode}",
}
)
type HandlerMetrics struct {
ShimRequestsReceived metrics.Counter
ShimRequestsCompleted metrics.Counter
ShimRequestDuration metrics.Histogram
ExecuteTimeouts metrics.Counter
}
func NewHandlerMetrics(p metrics.Provider) *HandlerMetrics {
return &HandlerMetrics{
ShimRequestsReceived: p.NewCounter(shimRequestsReceived),
ShimRequestsCompleted: p.NewCounter(shimRequestsCompleted),
ShimRequestDuration: p.NewHistogram(shimRequestDuration),
ExecuteTimeouts: p.NewCounter(executeTimeouts),
}
}
type LaunchMetrics struct {
LaunchDuration metrics.Histogram
LaunchFailures metrics.Counter
LaunchTimeouts metrics.Counter
}
func NewLaunchMetrics(p metrics.Provider) *LaunchMetrics {
return &LaunchMetrics{
LaunchDuration: p.NewHistogram(launchDuration),
LaunchFailures: p.NewCounter(launchFailures),
LaunchTimeouts: p.NewCounter(launchTimeouts),
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。