Skip to content

Commit

Permalink
pool: tests
Browse files Browse the repository at this point in the history
Signed-off-by: Evgenii Baidakov <[email protected]>
  • Loading branch information
smallhive committed Jul 3, 2023
1 parent 5e489f7 commit 4310255
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stat/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package stat

import (
"encoding/hex"
"fmt"
"sync"
"time"
)
Expand All @@ -26,10 +27,12 @@ func NewPoolStatistic() *PoolStat {
func (s *PoolStat) OperationCallback(nodeKey []byte, endpoint string, method Method, duration time.Duration, err error) {
if len(nodeKey) == 0 {
// situation when we initialize the client connection and make first EndpointInfo call.
fmt.Println("1111")
return
}

if !IsMethodValid(method) {
fmt.Println("2222")
return
}

Expand All @@ -55,10 +58,12 @@ func (s *PoolStat) OperationCallback(nodeKey []byte, endpoint string, method Met
s.mu.Unlock()

if duration > 0 {
fmt.Println("3333")
mon.methods[method].incRequests(duration)
}

if err != nil {
fmt.Println("4444")
mon.incErrorRate()
}
}
Expand Down

0 comments on commit 4310255

Please sign in to comment.