mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 14:12:43 -04:00
add dht/nat to librespai stats
This commit is contained in:
parent
51c98fdf50
commit
e4bd7f66a0
1 changed files with 12 additions and 1 deletions
|
@ -1,8 +1,8 @@
|
||||||
#include "StatsHandler.h"
|
#include "StatsHandler.h"
|
||||||
#include "Operators.h"
|
#include "Operators.h"
|
||||||
|
|
||||||
#include <retroshare/rspeers.h>
|
|
||||||
#include <retroshare/rsconfig.h>
|
#include <retroshare/rsconfig.h>
|
||||||
|
#include <retroshare/rspeers.h>
|
||||||
#include <pqi/authssl.h>
|
#include <pqi/authssl.h>
|
||||||
|
|
||||||
namespace resource_api
|
namespace resource_api
|
||||||
|
@ -33,6 +33,17 @@ void StatsHandler::handleStatsRequest(Request &/*req*/, Response &resp)
|
||||||
itemStream << makeKeyValue("bandwidth_up_kb", (double)upKb);
|
itemStream << makeKeyValue("bandwidth_up_kb", (double)upKb);
|
||||||
itemStream << makeKeyValue("bandwidth_down_kb", (double)downKb);
|
itemStream << makeKeyValue("bandwidth_down_kb", (double)downKb);
|
||||||
|
|
||||||
|
// DHT/NAT info
|
||||||
|
RsConfigNetStatus config;
|
||||||
|
rsConfig->getConfigNetStatus(config);
|
||||||
|
itemStream << makeKeyValue("dht_active", config.DHTActive);
|
||||||
|
itemStream << makeKeyValue("dht_ok", config.netDhtOk);
|
||||||
|
itemStream << makeKeyValue("dht_size_all", config.netDhtNetSize);
|
||||||
|
itemStream << makeKeyValue("dht_size_rs", config.netDhtRsNetSize);
|
||||||
|
uint32_t netState = rsConfig -> getNetState();
|
||||||
|
itemStream << makeKeyValue("nat_state", netState);
|
||||||
|
|
||||||
|
// ok
|
||||||
resp.setOk();
|
resp.setOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue