diff options
| author | Wladimir J. van der Laan <[email protected]> | 2013-10-15 03:48:22 -0700 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2013-10-15 03:48:22 -0700 |
| commit | f0c25cf6ecb226d2a82d04d73af44ca6bc0f3efa (patch) | |
| tree | 0883a42d7dda4a59858d62c8b03b6f019f3c7d8c /src/rpcnet.cpp | |
| parent | Merge pull request #3091 from Diapolo/misc (diff) | |
| parent | Add network traffic graph (diff) | |
| download | discoin-f0c25cf6ecb226d2a82d04d73af44ca6bc0f3efa.tar.xz discoin-f0c25cf6ecb226d2a82d04d73af44ca6bc0f3efa.zip | |
Merge pull request #2924 from sje397/TrafficGraph
[QT] Add network traffic graph to debug window
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 7df86cc2d..f78f034e3 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; +} |