Skip to content

Commit

Permalink
Getters for netsampler metrics
Browse files Browse the repository at this point in the history
Fix automatics

---
Co-authored-by: Nikolai Samokhin <[email protected]>
7a9746e18c74edbdcdd2304f2666a82db7dabc49

Pull Request resolved: #197
  • Loading branch information
seferen authored and robot-piglet committed Sep 6, 2024
1 parent 5797ec2 commit ee3f6ba
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions core/aggregator/netsample/sample.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,38 +90,73 @@ func (s *Sample) SetUserDuration(d time.Duration) {
s.setDuration(keyRTTMicro, d)
}

func (s *Sample) GetUserDurationMicroseconds() int {
return s.get(keyRTTMicro)
}
func (s *Sample) SetUserProto(code int) {
s.set(keyProtoCode, code)
}

func (s *Sample) GetUserProto() int {
return s.get(keyProtoCode)
}

func (s *Sample) SetUserNet(code int) {
s.set(keyErrno, code)
}

func (s *Sample) GetUserNet() int {
return s.get(keyErrno)
}

func (s *Sample) SetConnectTime(d time.Duration) {
s.setDuration(keyConnectMicro, d)
}

func (s *Sample) GetConnectTimeMicroseconds() int {
return s.get(keyConnectMicro)
}

func (s *Sample) SetSendTime(d time.Duration) {
s.setDuration(keySendMicro, d)
}

func (s *Sample) GetSendTimeMicroseconds() int {
return s.get(keySendMicro)
}

func (s *Sample) SetLatency(d time.Duration) {
s.setDuration(keyLatencyMicro, d)
}

func (s *Sample) GetLatencyMicroseconds() int {
return s.get(keyLatencyMicro)
}

func (s *Sample) SetReceiveTime(d time.Duration) {
s.setDuration(keyReceiveMicro, d)
}

func (s *Sample) GetReceiveTimeMicroseconds() int {
return s.get(keyReceiveMicro)
}

func (s *Sample) SetRequestBytes(b int) {
s.set(keyRequestBytes, b)
}

func (s *Sample) GetRequestBytes() int {
return s.get(keyRequestBytes)
}

func (s *Sample) SetResponseBytes(b int) {
s.set(keyResponseBytes, b)
}

func (s *Sample) GetResponseBytes() int {
return s.get(keyResponseBytes)
}

func (s *Sample) String() string {
return string(appendPhout(s, nil, true))
}
Expand Down

0 comments on commit ee3f6ba

Please sign in to comment.