summaryrefslogtreecommitdiff
path: root/node/Node.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2019-03-19 16:43:43 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2019-03-19 16:43:43 -0700
commit63ec19674c423b3d93185a690cff3f355c8d9c17 (patch)
tree2bbef2c69d0434ca95e9f952debf8aa2e9c6ad6d /node/Node.cpp
parent087c75d5eebea46be5a877dbd22c2362ad0a9051 (diff)
downloadinfinitytier-63ec19674c423b3d93185a690cff3f355c8d9c17.tar.gz
infinitytier-63ec19674c423b3d93185a690cff3f355c8d9c17.zip
.
Diffstat (limited to 'node/Node.cpp')
-rw-r--r--node/Node.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/node/Node.cpp b/node/Node.cpp
index 54cbd503..c96ae8fd 100644
--- a/node/Node.cpp
+++ b/node/Node.cpp
@@ -76,6 +76,7 @@ Node::Node(void *uptr,void *tptr,const struct ZT_Node_Callbacks *callbacks,int64
memset(_expectingRepliesToBucketPtr,0,sizeof(_expectingRepliesToBucketPtr));
memset(_expectingRepliesTo,0,sizeof(_expectingRepliesTo));
memset(_lastIdentityVerification,0,sizeof(_lastIdentityVerification));
+ memset((void *)(&_stats),0,sizeof(_stats));
uint64_t idtmp[2];
idtmp[0] = 0; idtmp[1] = 0;
@@ -268,6 +269,13 @@ ZT_ResultCode Node::processBackgroundTasks(void *tptr,int64_t now,volatile int64
Hashtable< Address,std::vector<InetAddress> > alwaysContact;
RR->topology->getUpstreamsToContact(alwaysContact);
+ // Uncomment to dump stats
+ for(unsigned int i=0;i<32;i++) {
+ if (_stats.inVerbCounts[i] > 0)
+ printf("%.2x\t%12lld %lld\n",i,(unsigned long long)_stats.inVerbCounts[i],(unsigned long long)_stats.inVerbBytes[i]);
+ }
+ printf("\n");
+
// Check last receive time on designated upstreams to see if we seem to be online
int64_t lastReceivedFromUpstream = 0;
{