1 Star 0 Fork 0

sqos/beats

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
flow.go 565 Bytes
一键复制 编辑 原始数据 按行查看 历史
urso 提交于 2016-01-08 15:03 . Adds flows feature to packetbeat
package flows
import (
"sync/atomic"
"time"
)
type biFlow struct {
id rawFlowID
killed uint32
createTS time.Time
ts time.Time
dir flowDirection
stats [2]*flowStats
prev, next *biFlow
}
type Flow struct {
stats *flowStats
}
func newBiFlow(id rawFlowID, ts time.Time, dir flowDirection) *biFlow {
return &biFlow{
id: id,
ts: ts,
createTS: ts,
dir: dir,
}
}
func (f *biFlow) kill() {
atomic.StoreUint32(&f.killed, 1)
}
func (f *biFlow) isAlive() bool {
return atomic.LoadUint32(&f.killed) == 0
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sqos/beats.git
git@gitee.com:sqos/beats.git
sqos
beats
beats
v5.2.2

搜索帮助