Documentation ¶
Index ¶
- Constants
- func WrapAggregator(a Aggregator) core.Aggregator
- type Aggregator
- type PhoutConfig
- type Sample
- func (s *Sample) AddTag(tag string)
- func (s *Sample) Err() error
- func (s *Sample) ID() int
- func (s *Sample) ProtoCode() int
- func (s *Sample) SetConnectTime(d time.Duration)
- func (s *Sample) SetErr(err error)
- func (s *Sample) SetID(id int)
- func (s *Sample) SetLatency(d time.Duration)
- func (s *Sample) SetProtoCode(code int)
- func (s *Sample) SetReceiveTime(d time.Duration)
- func (s *Sample) SetRequestBytes(b int)
- func (s *Sample) SetResponseBytes(b int)
- func (s *Sample) SetSendTime(d time.Duration)
- func (s *Sample) SetUserDuration(d time.Duration)
- func (s *Sample) SetUserNet(code int)
- func (s *Sample) SetUserProto(code int)
- func (s *Sample) String() string
- func (s *Sample) Tags() string
- type TestAggregator
Constants ¶
View Source
const ( ProtoCodeError = 999 DiscardedShootCodeError = 777 DiscardedShootTag = "discarded" )
Variables ¶
This section is empty.
Functions ¶
func WrapAggregator ¶
func WrapAggregator(a Aggregator) core.Aggregator
Types ¶
type Aggregator ¶
type Aggregator interface { Run(ctx context.Context, deps core.AggregatorDeps) error Report(sample *Sample) }
func NewPhout ¶
func NewPhout(fs afero.Fs, conf PhoutConfig) (a Aggregator, err error)
func UnwrapAggregator ¶
func UnwrapAggregator(a core.Aggregator) Aggregator
type PhoutConfig ¶
type PhoutConfig struct { Destination string // Destination file name ID bool // Print ammo ids if true. FlushTime time.Duration `config:"flush-time"` SampleQueueSize int `config:"sample-queue-size"` Buffer coreutil.BufferSizeConfig `config:",squash"` }
func DefaultPhoutConfig ¶
func DefaultPhoutConfig() PhoutConfig
type Sample ¶
type Sample struct {
// contains filtered or unexported fields
}
func DiscardedShootSample ¶ added in v0.4.0
func DiscardedShootSample() *Sample
func (*Sample) SetConnectTime ¶ added in v0.5.0
func (*Sample) SetLatency ¶ added in v0.3.2
func (*Sample) SetProtoCode ¶
func (*Sample) SetReceiveTime ¶ added in v0.5.0
func (*Sample) SetRequestBytes ¶ added in v0.3.2
func (*Sample) SetResponseBytes ¶ added in v0.5.0
func (*Sample) SetSendTime ¶ added in v0.5.0
func (*Sample) SetUserDuration ¶ added in v0.3.2
func (*Sample) SetUserNet ¶ added in v0.3.2
func (*Sample) SetUserProto ¶ added in v0.3.2
type TestAggregator ¶
type TestAggregator struct {
Samples []*Sample
}
func (*TestAggregator) Report ¶
func (t *TestAggregator) Report(s *Sample)
func (*TestAggregator) Run ¶
func (t *TestAggregator) Run(ctx context.Context, _ core.AggregatorDeps) error
Click to show internal directories.
Click to hide internal directories.