File tree Expand file tree Collapse file tree 1 file changed +39
-2
lines changed Expand file tree Collapse file tree 1 file changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -631,11 +631,48 @@ func (tcpid *TcpID) NewConnectionInfoFlipped() *ConnectionInfo {
631631}
632632
633633type CounterPair struct {
634- Request uint
635- Response uint
634+ request uint
635+ response uint
636636 sync.Mutex
637637}
638638
639+ func (counterPair * CounterPair ) IncrementRequest () uint {
640+ counterPair .Lock ()
641+ defer counterPair .Unlock ()
642+ counterPair .request ++
643+ return counterPair .request
644+ }
645+
646+ func (counterPair * CounterPair ) IncrementResponse () uint {
647+ counterPair .Lock ()
648+ defer counterPair .Unlock ()
649+ counterPair .response ++
650+ return counterPair .response
651+ }
652+
653+ func (counterPair * CounterPair ) ResetRequest () {
654+ counterPair .Lock ()
655+ defer counterPair .Unlock ()
656+ counterPair .request = 0
657+ }
658+
659+ func (counterPair * CounterPair ) ResetResponse () {
660+ counterPair .Lock ()
661+ defer counterPair .Unlock ()
662+ counterPair .response = 0
663+ }
664+
665+ func (counterPair * CounterPair ) Reset () {
666+ counterPair .Lock ()
667+ defer counterPair .Unlock ()
668+ counterPair .request = 0
669+ counterPair .response = 0
670+ }
671+
672+ func NewCounterPair () * CounterPair {
673+ return & CounterPair {}
674+ }
675+
639676type GenericMessage struct {
640677 IsRequest bool
641678 CaptureTime time.Time
You can’t perform that action at this time.
0 commit comments