Documentation ¶
Index ¶
- Constants
- func MustEncode(enc ReportEncoder, trs TargetReports) string
- func NewMessage(size uint) []byte
- type AppendMetrics
- type AppendReport
- type Benchmark
- type EndToEndReport
- type JsonEncoder
- type Loader
- type LoaderMetrics
- type Metrics
- type Option
- func WithClusterID(cid types.ClusterID) Option
- func WithDuration(duration time.Duration) Option
- func WithMetadataRepository(addrs []string) Option
- func WithReportEncoder(enc ReportEncoder) Option
- func WithReportInterval(reportInterval time.Duration) Option
- func WithSingleConnPerTarget() Option
- func WithTargets(targets ...Target) Option
- type Report
- type ReportEncoder
- type StringEncoder
- type SubscribeMetrics
- type SubscribeReport
- type Target
- type TargetReport
- type TargetReports
Constants ¶
View Source
const ( DefaultMessageSize = 0 DefaultBatchSize = 1 DefaultConcurrency = 0 DefaultDuration = 1 * time.Minute DefaultReportInterval = 3 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func MustEncode ¶ added in v0.9.0
func MustEncode(enc ReportEncoder, trs TargetReports) string
func NewMessage ¶
Types ¶
type AppendMetrics ¶
type AppendMetrics struct {
// contains filtered or unexported fields
}
type AppendReport ¶ added in v0.8.0
type AppendReport struct { RequestsPerSecond float64 `json:"requestsPerSecond"` BytesPerSecond float64 `json:"bytesPerSecond"` Duration float64 `json:"duration"` }
func NewAppendReportFromMetrics ¶ added in v0.8.0
func NewAppendReportFromMetrics(metrics AppendMetrics, interval time.Duration) AppendReport
type Benchmark ¶
type Benchmark struct {
// contains filtered or unexported fields
}
func New ¶
New creates a new Benchmark and returns it. Users must call Close to release resources if it returns successfully.
type EndToEndReport ¶ added in v0.8.0
type EndToEndReport struct {
Latency float64 `json:"latency"`
}
type JsonEncoder ¶ added in v0.9.0
type JsonEncoder struct{}
func (JsonEncoder) Encode ¶ added in v0.9.0
func (je JsonEncoder) Encode(trs TargetReports) ([]byte, error)
type LoaderMetrics ¶
type LoaderMetrics struct {
// contains filtered or unexported fields
}
func (*LoaderMetrics) Flush ¶
func (lm *LoaderMetrics) Flush() TargetReport
func (*LoaderMetrics) ReportAppendMetrics ¶
func (lm *LoaderMetrics) ReportAppendMetrics(m AppendMetrics) bool
func (*LoaderMetrics) ReportSubscribeMetrics ¶
func (lm *LoaderMetrics) ReportSubscribeMetrics(m SubscribeMetrics) bool
func (*LoaderMetrics) Reset ¶
func (lm *LoaderMetrics) Reset(now time.Time)
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func (Metrics) Flush ¶ added in v0.9.0
func (m Metrics) Flush() TargetReports
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithClusterID ¶
func WithDuration ¶
func WithMetadataRepository ¶
func WithReportEncoder ¶ added in v0.9.0
func WithReportEncoder(enc ReportEncoder) Option
func WithReportInterval ¶
func WithSingleConnPerTarget ¶ added in v0.15.0
func WithSingleConnPerTarget() Option
func WithTargets ¶
type Report ¶ added in v0.8.0
type Report struct { AppendReport `json:"append"` SubscribeReport `json:"subscribe"` EndToEndReport `json:"endToEnd"` }
type ReportEncoder ¶ added in v0.9.0
type ReportEncoder interface {
Encode(trs TargetReports) ([]byte, error)
}
type StringEncoder ¶ added in v0.9.0
type StringEncoder struct{}
func (StringEncoder) Encode ¶ added in v0.9.0
func (se StringEncoder) Encode(trs TargetReports) ([]byte, error)
type SubscribeMetrics ¶
type SubscribeMetrics struct {
// contains filtered or unexported fields
}
type SubscribeReport ¶ added in v0.8.0
type SubscribeReport struct { LogsPerSecond float64 `json:"logsPerSecond"` BytesPerSecond float64 `json:"bytesPerSecond"` }
func NewSubscribeReportFromMetrics ¶ added in v0.8.0
func NewSubscribeReportFromMetrics(metrics SubscribeMetrics, interval time.Duration) SubscribeReport
type Target ¶
type TargetReport ¶ added in v0.9.0
type TargetReports ¶ added in v0.9.0
type TargetReports struct {
Reports []TargetReport `json:"reports"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.