diff options
author | Scott Ellis <sje397@gmail.com> | 2013-08-23 02:09:32 +1000 |
---|---|---|
committer | Scott Ellis <sje397@gmail.com> | 2013-10-14 19:02:03 +1100 |
commit | ce14345a89dfa05992f8d2c7c9fe36315d4a67e6 (patch) | |
tree | 997e08222a82558e8720fa0ce0ba82438f161664 /src/rpcnet.cpp | |
parent | 9269d0e96e621a6e02da8074785ac310ce64db73 (diff) |
Add network traffic graph
Diffstat (limited to 'src/rpcnet.cpp')
-rw-r--r-- | src/rpcnet.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index 7df86cc2db..f78f034e32 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -223,3 +223,17 @@ Value getaddednodeinfo(const Array& params, bool fHelp) return ret; } +Value getnettotals(const Array& params, bool fHelp) +{ + if (fHelp || params.size() > 0) + throw runtime_error( + "getnettotals\n" + "Returns information about network traffic, including bytes in, bytes out,\n" + "and current time."); + + Object obj; + obj.push_back(Pair("totalbytesrecv", static_cast< boost::uint64_t>(CNode::GetTotalBytesRecv()))); + obj.push_back(Pair("totalbytessent", static_cast<boost::uint64_t>(CNode::GetTotalBytesSent()))); + obj.push_back(Pair("timemillis", static_cast<boost::int64_t>(GetTimeMillis()))); + return obj; +} |