Documentation ¶
Index ¶
- Constants
- func CobraFullCommandPathMetricName(cmd *cobra.Command) string
- func DurationMetricSuffix(cmdName string) string
- func UsageMetricSuffix(cmdName string) string
- type Client
- type ClientOption
- type DurationMetric
- type GraphQLError
- type GraphQLResponse
- type Metric
- type MetricClientInfo
- type MetricRequest
Constants ¶
View Source
const (
DefaultTimeout = 5
)
Variables ¶
This section is empty.
Functions ¶
func DurationMetricSuffix ¶
func UsageMetricSuffix ¶
Types ¶
type Client ¶
func NewClient ¶
func NewClient(address string, clientInfo MetricClientInfo, opts ...ClientOption) Client
type ClientOption ¶
type ClientOption func(*client)
func WithDebug ¶
func WithDebug(debug bool) ClientOption
func WithLogger ¶
func WithLogger(logger *zap.Logger) ClientOption
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
type DurationMetric ¶
type DurationMetric func() Metric
func NewDurationMetric ¶
func NewDurationMetric(name string) DurationMetric
NewDurationMetric starts a duration metric. The duration will be stop when PrepareBatch is called.
type GraphQLError ¶
type GraphQLError struct {
Message string `json:"message"`
}
type GraphQLResponse ¶
type GraphQLResponse struct { Data interface{} `json:"data"` Errors []GraphQLError }
type Metric ¶
func NewUsageMetric ¶
NewUsageMetric creates a simple metric. The value will be 1.
type MetricClientInfo ¶
type MetricRequest ¶
type MetricRequest struct { Metrics []Metric `json:"metrics"` ClientInfo MetricClientInfo `json:"clientInfo"` }
Click to show internal directories.
Click to hide internal directories.