Skip to content
Snippets Groups Projects
Commit c3ae5e65 authored by benjamin's avatar benjamin
Browse files

added a print denoting the number of registered nodes and made node...

added a print denoting the number of registered nodes and made node registeration time prints trace to make it less noisy
parent 7c632193
No related branches found
No related tags found
4 merge requests!510Release,!419rewrote the health tracker to both consider if there are waiting rounds and...,!418instrumented node registration and made only 4 paralelell node registrations,!340Project/channels
...@@ -27,6 +27,7 @@ import ( ...@@ -27,6 +27,7 @@ import (
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"gitlab.com/elixxir/client/cmix/identity/receptionID" "gitlab.com/elixxir/client/cmix/identity/receptionID"
"math/rand"
"sync" "sync"
"sync/atomic" "sync/atomic"
"time" "time"
...@@ -88,6 +89,10 @@ func (c *client) followNetwork(report ClientErrorReport, ...@@ -88,6 +89,10 @@ func (c *client) followNetwork(report ClientErrorReport,
return return
case <-ticker.C: case <-ticker.C:
if rand.Int()%6 == 0 {
jww.INFO.Printf("Registered with %d nodes", c.NumRegisteredNodes())
}
operator := func(toTrack []receptionID.IdentityUse) error { operator := func(toTrack []receptionID.IdentityUse) error {
// set up tracking tools // set up tracking tools
......
...@@ -134,6 +134,8 @@ func registerWithNode(sender gateway.Sender, comms RegisterNodeCommsInterface, ...@@ -134,6 +134,8 @@ func registerWithNode(sender gateway.Sender, comms RegisterNodeCommsInterface,
var transmissionKey *cyclic.Int var transmissionKey *cyclic.Int
var validUntil uint64 var validUntil uint64
var keyId []byte var keyId []byte
start := time.Now()
// TODO: should move this to a pre-canned user initialization // TODO: should move this to a pre-canned user initialization
if s.IsPrecanned() { if s.IsPrecanned() {
userNum := int(s.GetTransmissionID().Bytes()[7]) userNum := int(s.GetTransmissionID().Bytes()[7])
...@@ -156,7 +158,8 @@ func registerWithNode(sender gateway.Sender, comms RegisterNodeCommsInterface, ...@@ -156,7 +158,8 @@ func registerWithNode(sender gateway.Sender, comms RegisterNodeCommsInterface,
r.add(nodeID, transmissionKey, validUntil, keyId) r.add(nodeID, transmissionKey, validUntil, keyId)
jww.INFO.Printf("Completed registration with node %s", nodeID) jww.INFO.Printf("Completed registration with node %s,"+
" took %d", nodeID, time.Since(start))
return nil return nil
} }
...@@ -81,11 +81,11 @@ func requestKey(sender gateway.Sender, comms RegisterNodeCommsInterface, ...@@ -81,11 +81,11 @@ func requestKey(sender gateway.Sender, comms RegisterNodeCommsInterface,
return nil, errors.WithMessage(err2, return nil, errors.WithMessage(err2,
"requestKey: clientKeyResponse error") "requestKey: clientKeyResponse error")
} }
jww.INFO.Printf("just comm reg request took %s", time.Since(startInternal)) jww.TRACE.Printf("just comm reg request took %s", time.Since(startInternal))
return keyResponse, nil return keyResponse, nil
}, stop) }, stop)
jww.INFO.Printf("full reg request took %s", time.Since(start)) jww.TRACE.Printf("full reg request took %s", time.Since(start))
if err != nil { if err != nil {
return nil, nil, 0, err return nil, nil, 0, err
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment