mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
Profiling added
This commit is contained in:
parent
3f4bd13091
commit
a6f78134c0
19
Profiling.cpp
Normal file
19
Profiling.cpp
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#include <boost/property_tree/ptree.hpp>
|
||||||
|
#include <boost/property_tree/ini_parser.hpp>
|
||||||
|
#include "Profiling.h"
|
||||||
|
|
||||||
|
namespace i2p
|
||||||
|
{
|
||||||
|
namespace data
|
||||||
|
{
|
||||||
|
RouterProfile::RouterProfile (const IdentHash& identHash):
|
||||||
|
m_IdentHash (identHash), m_NumTunnelsAgreed (0), m_NumTunnelsDeclined (0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<RouterProfile> GetProfile (const IdentHash& identHash)
|
||||||
|
{
|
||||||
|
return std::make_shared<RouterProfile> (identHash);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
29
Profiling.h
Normal file
29
Profiling.h
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
#ifndef PROFILING_H__
|
||||||
|
#define PROFILING_H__
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include "Identity.h"
|
||||||
|
|
||||||
|
namespace i2p
|
||||||
|
{
|
||||||
|
namespace data
|
||||||
|
{
|
||||||
|
class RouterProfile
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
RouterProfile (const IdentHash& identHash);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
IdentHash m_IdentHash;
|
||||||
|
// participation
|
||||||
|
uint32_t m_NumTunnelsAgreed;
|
||||||
|
uint32_t m_NumTunnelsDeclined;
|
||||||
|
};
|
||||||
|
|
||||||
|
std::shared_ptr<RouterProfile> GetProfile (const IdentHash& identHash);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -8,6 +8,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/asio.hpp>
|
#include <boost/asio.hpp>
|
||||||
#include "Identity.h"
|
#include "Identity.h"
|
||||||
|
#include "Profiling.h"
|
||||||
|
|
||||||
namespace i2p
|
namespace i2p
|
||||||
{
|
{
|
||||||
|
@ -170,6 +171,7 @@ namespace data
|
||||||
std::map<std::string, std::string> m_Properties;
|
std::map<std::string, std::string> m_Properties;
|
||||||
bool m_IsUpdated, m_IsUnreachable;
|
bool m_IsUpdated, m_IsUnreachable;
|
||||||
uint8_t m_SupportedTransports, m_Caps;
|
uint8_t m_SupportedTransports, m_Caps;
|
||||||
|
std::shared_ptr<RouterProfile> m_Profile;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
<ClCompile Include="..\Log.cpp" />
|
<ClCompile Include="..\Log.cpp" />
|
||||||
<ClCompile Include="..\NetDb.cpp" />
|
<ClCompile Include="..\NetDb.cpp" />
|
||||||
<ClCompile Include="..\NTCPSession.cpp" />
|
<ClCompile Include="..\NTCPSession.cpp" />
|
||||||
|
<ClCompile Include="..\Profiling.cpp" />
|
||||||
<ClCompile Include="..\Reseed.cpp" />
|
<ClCompile Include="..\Reseed.cpp" />
|
||||||
<ClCompile Include="..\RouterContext.cpp" />
|
<ClCompile Include="..\RouterContext.cpp" />
|
||||||
<ClCompile Include="..\RouterInfo.cpp" />
|
<ClCompile Include="..\RouterInfo.cpp" />
|
||||||
|
@ -82,6 +83,7 @@
|
||||||
<ClInclude Include="..\NetDb.h" />
|
<ClInclude Include="..\NetDb.h" />
|
||||||
<ClInclude Include="..\NTCPSession.h" />
|
<ClInclude Include="..\NTCPSession.h" />
|
||||||
<ClInclude Include="..\Queue.h" />
|
<ClInclude Include="..\Queue.h" />
|
||||||
|
<ClInclude Include="..\Profiling.h" />
|
||||||
<ClInclude Include="..\Reseed.h" />
|
<ClInclude Include="..\Reseed.h" />
|
||||||
<ClInclude Include="..\RouterContext.h" />
|
<ClInclude Include="..\RouterContext.h" />
|
||||||
<ClInclude Include="..\RouterInfo.h" />
|
<ClInclude Include="..\RouterInfo.h" />
|
||||||
|
@ -284,4 +286,4 @@
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -22,6 +22,7 @@ set (COMMON_SRC
|
||||||
"${CMAKE_SOURCE_DIR}/Log.cpp"
|
"${CMAKE_SOURCE_DIR}/Log.cpp"
|
||||||
"${CMAKE_SOURCE_DIR}/NTCPSession.cpp"
|
"${CMAKE_SOURCE_DIR}/NTCPSession.cpp"
|
||||||
"${CMAKE_SOURCE_DIR}/NetDb.cpp"
|
"${CMAKE_SOURCE_DIR}/NetDb.cpp"
|
||||||
|
"${CMAKE_SOURCE_DIR}/Profiling.cpp"
|
||||||
"${CMAKE_SOURCE_DIR}/Reseed.cpp"
|
"${CMAKE_SOURCE_DIR}/Reseed.cpp"
|
||||||
"${CMAKE_SOURCE_DIR}/RouterContext.cpp"
|
"${CMAKE_SOURCE_DIR}/RouterContext.cpp"
|
||||||
"${CMAKE_SOURCE_DIR}/RouterInfo.cpp"
|
"${CMAKE_SOURCE_DIR}/RouterInfo.cpp"
|
||||||
|
|
|
@ -116,7 +116,7 @@ am_i2p_OBJECTS = AddressBook.$(OBJEXT) CryptoConst.$(OBJEXT) \
|
||||||
aes.$(OBJEXT) base64.$(OBJEXT) i2p.$(OBJEXT) util.$(OBJEXT) \
|
aes.$(OBJEXT) base64.$(OBJEXT) i2p.$(OBJEXT) util.$(OBJEXT) \
|
||||||
SAM.$(OBJEXT) Destination.$(OBJEXT) ClientContext.$(OBJEXT) \
|
SAM.$(OBJEXT) Destination.$(OBJEXT) ClientContext.$(OBJEXT) \
|
||||||
Datagram.$(OBJEXT) SSUSession.$(OBJEXT) BOB.$(OBJEXT) \
|
Datagram.$(OBJEXT) SSUSession.$(OBJEXT) BOB.$(OBJEXT) \
|
||||||
I2PControl.$(OBJEXT)
|
I2PControl.$(OBJEXT) Profiling.$(OBJEXT)
|
||||||
i2p_OBJECTS = $(am_i2p_OBJECTS)
|
i2p_OBJECTS = $(am_i2p_OBJECTS)
|
||||||
i2p_LDADD = $(LDADD)
|
i2p_LDADD = $(LDADD)
|
||||||
AM_V_P = $(am__v_P_@AM_V@)
|
AM_V_P = $(am__v_P_@AM_V@)
|
||||||
|
@ -328,7 +328,7 @@ i2p_SOURCES = AddressBook.cpp CryptoConst.cpp Daemon.cpp \
|
||||||
TunnelGateway.cpp TunnelPool.cpp UPnP.cpp aes.cpp \
|
TunnelGateway.cpp TunnelPool.cpp UPnP.cpp aes.cpp \
|
||||||
base64.cpp i2p.cpp util.cpp SAM.cpp Destination.cpp \
|
base64.cpp i2p.cpp util.cpp SAM.cpp Destination.cpp \
|
||||||
ClientContext.cpp DataFram.cpp SSUSession.cpp BOB.cpp \
|
ClientContext.cpp DataFram.cpp SSUSession.cpp BOB.cpp \
|
||||||
I2PControl.cpp \
|
I2PControl.cpp Profiling.cpp \
|
||||||
\
|
\
|
||||||
AddressBook.h CryptoConst.h Daemon.h ElGamal.h \
|
AddressBook.h CryptoConst.h Daemon.h ElGamal.h \
|
||||||
Garlic.h HTTPProxy.h HTTPServer.h I2NPProtocol.h \
|
Garlic.h HTTPProxy.h HTTPServer.h I2NPProtocol.h \
|
||||||
|
@ -341,7 +341,7 @@ i2p_SOURCES = AddressBook.cpp CryptoConst.cpp Daemon.cpp \
|
||||||
TunnelPool.h UPnP.h aes.h base64.h config.h hmac.h \
|
TunnelPool.h UPnP.h aes.h base64.h config.h hmac.h \
|
||||||
util.h version.h Destination.h ClientContext.h \
|
util.h version.h Destination.h ClientContext.h \
|
||||||
TransportSession.h Datagram.h SSUSession.h BOB.h \
|
TransportSession.h Datagram.h SSUSession.h BOB.h \
|
||||||
I2PControl.h
|
I2PControl.h Profiling.h
|
||||||
|
|
||||||
AM_LDFLAGS = @BOOST_DATE_TIME_LIB@ @BOOST_FILESYSTEM_LIB@ \
|
AM_LDFLAGS = @BOOST_DATE_TIME_LIB@ @BOOST_FILESYSTEM_LIB@ \
|
||||||
@BOOST_PROGRAM_OPTIONS_LIB@ @BOOST_REGEX_LIB@ \
|
@BOOST_PROGRAM_OPTIONS_LIB@ @BOOST_REGEX_LIB@ \
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
COMMON_SRC = \
|
COMMON_SRC = \
|
||||||
CryptoConst.cpp Datagram.cpp Garlic.cpp I2NPProtocol.cpp \
|
CryptoConst.cpp Datagram.cpp Garlic.cpp I2NPProtocol.cpp LeaseSet.cpp \
|
||||||
LeaseSet.cpp Log.cpp NTCPSession.cpp NetDb.cpp Reseed.cpp RouterContext.cpp \
|
Log.cpp NTCPSession.cpp NetDb.cpp Profiling.cpp Reseed.cpp RouterContext.cpp \
|
||||||
RouterInfo.cpp SSU.cpp SSUSession.cpp SSUData.cpp Streaming.cpp Identity.cpp \
|
RouterInfo.cpp SSU.cpp SSUSession.cpp SSUData.cpp Streaming.cpp Identity.cpp \
|
||||||
TransitTunnel.cpp Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp \
|
TransitTunnel.cpp Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp \
|
||||||
TunnelGateway.cpp Destination.cpp UPnP.cpp util.cpp aes.cpp base64.cpp
|
TunnelGateway.cpp Destination.cpp UPnP.cpp util.cpp aes.cpp base64.cpp
|
||||||
|
|
Loading…
Reference in a new issue