mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
Add network traffic graph
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user