mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-25 17:21:27 -05:00
add dht/nat to librespai stats
This commit is contained in:
parent
51c98fdf50
commit
e4bd7f66a0
@ -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…
x
Reference in New Issue
Block a user