mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 10:35:22 -04:00
Added Bandwidth Monitoring service to libretroshare to help debug Lag.
- p3bwctrl.h/.cc & rsbwctrlitems.h/.cc - New Interface in pqihandler to extract the data. - New Interface in rsconfig to display in GUI. - Added extra debugging in pqistreamer for catching big outqueues. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5241 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
0d3d1ebc18
commit
48a1c66c60
16 changed files with 880 additions and 31 deletions
|
@ -24,6 +24,7 @@
|
|||
*/
|
||||
|
||||
#include "rsserver/p3serverconfig.h"
|
||||
#include "services/p3bwctrl.h"
|
||||
|
||||
RsServerConfig *rsConfig = NULL;
|
||||
|
||||
|
@ -107,10 +108,33 @@ int p3ServerConfig::getConfigStartup(RsConfigStartup &/*params*/)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
int p3ServerConfig::getConfigDataRates(RsConfigDataRates &/*params*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/***** for RsConfig -> p3BandwidthControl ****/
|
||||
|
||||
int p3ServerConfig::getTotalBandwidthRates(RsConfigDataRates &rates)
|
||||
{
|
||||
if (rsBandwidthControl)
|
||||
{
|
||||
return rsBandwidthControl->getTotalBandwidthRates(rates);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int p3ServerConfig::getAllBandwidthRates(std::map<std::string, RsConfigDataRates> &ratemap)
|
||||
{
|
||||
if (rsBandwidthControl)
|
||||
{
|
||||
return rsBandwidthControl->getAllBandwidthRates(ratemap);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* From RsInit */
|
||||
|
|
|
@ -49,7 +49,12 @@ virtual ~p3ServerConfig();
|
|||
|
||||
virtual int getConfigNetStatus(RsConfigNetStatus &status);
|
||||
virtual int getConfigStartup(RsConfigStartup ¶ms);
|
||||
virtual int getConfigDataRates(RsConfigDataRates ¶ms);
|
||||
//virtual int getConfigDataRates(RsConfigDataRates ¶ms);
|
||||
|
||||
/***** for RsConfig -> p3BandwidthControl ****/
|
||||
|
||||
virtual int getTotalBandwidthRates(RsConfigDataRates &rates);
|
||||
virtual int getAllBandwidthRates(std::map<std::string, RsConfigDataRates> &ratemap);
|
||||
|
||||
/* From RsInit */
|
||||
|
||||
|
|
|
@ -1828,6 +1828,7 @@ RsTurtle *rsTurtle = NULL ;
|
|||
#define RS_RELEASE 1
|
||||
|
||||
#include "services/p3banlist.h"
|
||||
#include "services/p3bwctrl.h"
|
||||
#include "services/p3dsdv.h"
|
||||
|
||||
|
||||
|
@ -2241,6 +2242,8 @@ int RsServer::StartupRetroShare()
|
|||
pqih -> addService(mBanList);
|
||||
mBitDht->setupPeerSharer(mBanList);
|
||||
|
||||
p3BandwidthControl *mBwCtrl = new p3BandwidthControl(pqih);
|
||||
|
||||
#ifdef RS_DSDVTEST
|
||||
p3Dsdv *mDsdv = new p3Dsdv(mLinkMgr);
|
||||
pqih -> addService(mDsdv);
|
||||
|
@ -2283,6 +2286,7 @@ int RsServer::StartupRetroShare()
|
|||
mLinkMgr->addMonitor(msgSrv);
|
||||
mLinkMgr->addMonitor(mStatusSrv);
|
||||
mLinkMgr->addMonitor(chatSrv);
|
||||
mLinkMgr->addMonitor(mBwCtrl);
|
||||
|
||||
/* must also add the controller as a Monitor...
|
||||
* a little hack to get it to work.
|
||||
|
@ -2470,6 +2474,7 @@ int RsServer::StartupRetroShare()
|
|||
/* Setup GUI Interfaces. */
|
||||
|
||||
rsDisc = new p3Discovery(ad);
|
||||
rsBandwidthControl = mBwCtrl;
|
||||
rsConfig = new p3ServerConfig(mPeerMgr, mLinkMgr, mNetMgr, mGeneralConfig);
|
||||
|
||||
rsMsgs = new p3Msgs(msgSrv, chatSrv);
|
||||
|
@ -2489,6 +2494,7 @@ int RsServer::StartupRetroShare()
|
|||
rsPhoto = NULL;
|
||||
#endif
|
||||
|
||||
|
||||
/* put a welcome message in! */
|
||||
if (RsInitConfig::firsttime_run)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue