1 Star 0 Fork 0

sqos/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
observer.go 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
urso 提交于 2017-11-16 01:25 . Add godocs
package outputs
// Observer provides an interface used by outputs to report common events on
// documents/events being published and I/O workload.
type Observer interface {
NewBatch(int) // report new batch being processed with number of events
Acked(int) // report number of acked events
Failed(int) // report number of failed events
Dropped(int) // report number of dropped events
Cancelled(int) // report number of cancelled events
WriteError(error) // report an I/O error on write
WriteBytes(int) // report number of bytes being written
ReadError(error) // report an I/O error on read
ReadBytes(int) // report number of bytes being read
}
type emptyObserver struct{}
var nilObserver = (*emptyObserver)(nil)
// NewNilObserver returns an oberserver implementation, ignoring all events.
func NewNilObserver() Observer {
return nilObserver
}
func (*emptyObserver) NewBatch(int) {}
func (*emptyObserver) Acked(int) {}
func (*emptyObserver) Failed(int) {}
func (*emptyObserver) Dropped(int) {}
func (*emptyObserver) Cancelled(int) {}
func (*emptyObserver) WriteError(error) {}
func (*emptyObserver) WriteBytes(int) {}
func (*emptyObserver) ReadError(error) {}
func (*emptyObserver) ReadBytes(int) {}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sqos/beats.git
git@gitee.com:sqos/beats.git
sqos
beats
beats
v6.1.4

搜索帮助