mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Remove unused code & refactor and simplify event load timing
This commit is contained in:
@@ -1558,11 +1558,6 @@
|
|||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\src\ripple\beast\core\PlatformConfig.h">
|
<ClInclude Include="..\..\src\ripple\beast\core\PlatformConfig.h">
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClCompile Include="..\..\src\ripple\beast\core\RelativeTime.cpp">
|
|
||||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClInclude Include="..\..\src\ripple\beast\core\RelativeTime.h">
|
|
||||||
</ClInclude>
|
|
||||||
<ClCompile Include="..\..\src\ripple\beast\core\SemanticVersion.cpp">
|
<ClCompile Include="..\..\src\ripple\beast\core\SemanticVersion.cpp">
|
||||||
<ExcludedFromBuild>True</ExcludedFromBuild>
|
<ExcludedFromBuild>True</ExcludedFromBuild>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|||||||
@@ -2100,12 +2100,6 @@
|
|||||||
<ClInclude Include="..\..\src\ripple\beast\core\PlatformConfig.h">
|
<ClInclude Include="..\..\src\ripple\beast\core\PlatformConfig.h">
|
||||||
<Filter>ripple\beast\core</Filter>
|
<Filter>ripple\beast\core</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClCompile Include="..\..\src\ripple\beast\core\RelativeTime.cpp">
|
|
||||||
<Filter>ripple\beast\core</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClInclude Include="..\..\src\ripple\beast\core\RelativeTime.h">
|
|
||||||
<Filter>ripple\beast\core</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClCompile Include="..\..\src\ripple\beast\core\SemanticVersion.cpp">
|
<ClCompile Include="..\..\src\ripple\beast\core\SemanticVersion.cpp">
|
||||||
<Filter>ripple\beast\core</Filter>
|
<Filter>ripple\beast\core</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
|||||||
@@ -401,7 +401,8 @@ private:
|
|||||||
|
|
||||||
void doWrite ()
|
void doWrite ()
|
||||||
{
|
{
|
||||||
LoadEvent::autoptr event (app_.getJobQueue ().getLoadEventAP (jtDISK, "ValidationWrite"));
|
auto event = app_.getJobQueue ().getLoadEventAP (jtDISK, "ValidationWrite");
|
||||||
|
|
||||||
std::string insVal ("INSERT INTO Validations "
|
std::string insVal ("INSERT INTO Validations "
|
||||||
"(InitialSeq, LedgerSeq, LedgerHash,NodePubKey,SignTime,RawData) "
|
"(InitialSeq, LedgerSeq, LedgerHash,NodePubKey,SignTime,RawData) "
|
||||||
"VALUES (:initialSeq, :ledgerSeq, :ledgerHash,:nodePubKey,:signTime,:rawData);");
|
"VALUES (:initialSeq, :ledgerSeq, :ledgerHash,:nodePubKey,:signTime,:rawData);");
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ private:
|
|||||||
bool convert_all_;
|
bool convert_all_;
|
||||||
|
|
||||||
std::shared_ptr <ReadView const> mLedger;
|
std::shared_ptr <ReadView const> mLedger;
|
||||||
LoadEvent::pointer m_loadEvent;
|
std::shared_ptr<LoadEvent> m_loadEvent;
|
||||||
std::shared_ptr<RippleLineCache> mRLCache;
|
std::shared_ptr<RippleLineCache> mRLCache;
|
||||||
|
|
||||||
STPathElement mSource;
|
STPathElement mSource;
|
||||||
|
|||||||
@@ -130,8 +130,8 @@ std::string DoSustain ()
|
|||||||
while (checkChild (pChild, 0))
|
while (checkChild (pChild, 0))
|
||||||
sleep(sleepBetweenWaits);
|
sleep(sleepBetweenWaits);
|
||||||
|
|
||||||
auto pc = std::to_string (pChild);
|
(void)rename ("core",
|
||||||
rename ("core", ("core." + pc).c_str ());
|
("core." + std::to_string(pChild)).c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,291 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
/*
|
|
||||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
|
||||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
|
||||||
|
|
||||||
Portions of this file are from JUCE.
|
|
||||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
|
||||||
Please visit http://www.juce.com
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#include <ripple/beast/core/RelativeTime.h>
|
|
||||||
|
|
||||||
namespace beast {
|
|
||||||
|
|
||||||
RelativeTime::RelativeTime (const RelativeTime::value_type secs) noexcept
|
|
||||||
: numSeconds (secs)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime::RelativeTime (const RelativeTime& other) noexcept
|
|
||||||
: numSeconds (other.numSeconds)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime::~RelativeTime() noexcept {}
|
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
RelativeTime RelativeTime::milliseconds (const int milliseconds) noexcept
|
|
||||||
{
|
|
||||||
return RelativeTime (milliseconds * 0.001);
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime RelativeTime::milliseconds (const std::int64_t milliseconds) noexcept
|
|
||||||
{
|
|
||||||
return RelativeTime (milliseconds * 0.001);
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime RelativeTime::seconds (RelativeTime::value_type s) noexcept
|
|
||||||
{
|
|
||||||
return RelativeTime (s);
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime RelativeTime::minutes (const RelativeTime::value_type numberOfMinutes) noexcept
|
|
||||||
{
|
|
||||||
return RelativeTime (numberOfMinutes * 60.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime RelativeTime::hours (const RelativeTime::value_type numberOfHours) noexcept
|
|
||||||
{
|
|
||||||
return RelativeTime (numberOfHours * (60.0 * 60.0));
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime RelativeTime::days (const RelativeTime::value_type numberOfDays) noexcept
|
|
||||||
{
|
|
||||||
return RelativeTime (numberOfDays * (60.0 * 60.0 * 24.0));
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime RelativeTime::weeks (const RelativeTime::value_type numberOfWeeks) noexcept
|
|
||||||
{
|
|
||||||
return RelativeTime (numberOfWeeks * (60.0 * 60.0 * 24.0 * 7.0));
|
|
||||||
}
|
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
std::int64_t RelativeTime::inMilliseconds() const noexcept
|
|
||||||
{
|
|
||||||
return (std::int64_t) (numSeconds * 1000.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime::value_type RelativeTime::inMinutes() const noexcept
|
|
||||||
{
|
|
||||||
return numSeconds / 60.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime::value_type RelativeTime::inHours() const noexcept
|
|
||||||
{
|
|
||||||
return numSeconds / (60.0 * 60.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime::value_type RelativeTime::inDays() const noexcept
|
|
||||||
{
|
|
||||||
return numSeconds / (60.0 * 60.0 * 24.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime::value_type RelativeTime::inWeeks() const noexcept
|
|
||||||
{
|
|
||||||
return numSeconds / (60.0 * 60.0 * 24.0 * 7.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
RelativeTime& RelativeTime::operator= (const RelativeTime& other) noexcept { numSeconds = other.numSeconds; return *this; }
|
|
||||||
|
|
||||||
RelativeTime RelativeTime::operator+= (RelativeTime t) noexcept
|
|
||||||
{
|
|
||||||
numSeconds += t.numSeconds; return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime RelativeTime::operator-= (RelativeTime t) noexcept
|
|
||||||
{
|
|
||||||
numSeconds -= t.numSeconds; return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime RelativeTime::operator+= (const RelativeTime::value_type secs) noexcept
|
|
||||||
{
|
|
||||||
numSeconds += secs; return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime RelativeTime::operator-= (const RelativeTime::value_type secs) noexcept
|
|
||||||
{
|
|
||||||
numSeconds -= secs; return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime operator+ (RelativeTime t1, RelativeTime t2) noexcept
|
|
||||||
{
|
|
||||||
return t1 += t2;
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime operator- (RelativeTime t1, RelativeTime t2) noexcept
|
|
||||||
{
|
|
||||||
return t1 -= t2;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator== (RelativeTime t1, RelativeTime t2) noexcept
|
|
||||||
{
|
|
||||||
return t1.inSeconds() == t2.inSeconds();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator!= (RelativeTime t1, RelativeTime t2) noexcept
|
|
||||||
{
|
|
||||||
return t1.inSeconds() != t2.inSeconds();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator> (RelativeTime t1, RelativeTime t2) noexcept
|
|
||||||
{
|
|
||||||
return t1.inSeconds() > t2.inSeconds();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator< (RelativeTime t1, RelativeTime t2) noexcept
|
|
||||||
{
|
|
||||||
return t1.inSeconds() < t2.inSeconds();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator>= (RelativeTime t1, RelativeTime t2) noexcept
|
|
||||||
{
|
|
||||||
return t1.inSeconds() >= t2.inSeconds();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator<= (RelativeTime t1, RelativeTime t2) noexcept
|
|
||||||
{
|
|
||||||
return t1.inSeconds() <= t2.inSeconds();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#if BEAST_WINDOWS
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
namespace beast {
|
|
||||||
namespace detail {
|
|
||||||
|
|
||||||
static double monotonicCurrentTimeInSeconds()
|
|
||||||
{
|
|
||||||
return GetTickCount64() / 1000.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif BEAST_MAC || BEAST_IOS
|
|
||||||
|
|
||||||
#include <mach/mach_time.h>
|
|
||||||
#include <mach/mach.h>
|
|
||||||
|
|
||||||
namespace beast {
|
|
||||||
namespace detail {
|
|
||||||
|
|
||||||
static double monotonicCurrentTimeInSeconds()
|
|
||||||
{
|
|
||||||
struct StaticInitializer
|
|
||||||
{
|
|
||||||
StaticInitializer ()
|
|
||||||
{
|
|
||||||
double numerator;
|
|
||||||
double denominator;
|
|
||||||
|
|
||||||
mach_timebase_info_data_t timebase;
|
|
||||||
(void) mach_timebase_info (&timebase);
|
|
||||||
|
|
||||||
if (timebase.numer % 1000000 == 0)
|
|
||||||
{
|
|
||||||
numerator = timebase.numer / 1000000.0;
|
|
||||||
denominator = timebase.denom * 1000.0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
numerator = timebase.numer;
|
|
||||||
// VFALCO NOTE I don't understand this code
|
|
||||||
//denominator = timebase.denom * (std::uint64_t) 1000000 * 1000.0;
|
|
||||||
denominator = timebase.denom * 1000000000.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ratio = numerator / denominator;
|
|
||||||
}
|
|
||||||
|
|
||||||
double ratio;
|
|
||||||
};
|
|
||||||
|
|
||||||
static StaticInitializer const data;
|
|
||||||
|
|
||||||
return mach_absolute_time() * data.ratio;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
namespace beast {
|
|
||||||
namespace detail {
|
|
||||||
|
|
||||||
static double monotonicCurrentTimeInSeconds()
|
|
||||||
{
|
|
||||||
timespec t;
|
|
||||||
clock_gettime (CLOCK_MONOTONIC, &t);
|
|
||||||
return t.tv_sec + t.tv_nsec / 1000000000.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace beast {
|
|
||||||
namespace detail {
|
|
||||||
|
|
||||||
// Records and returns the time from process startup
|
|
||||||
static double getStartupTime()
|
|
||||||
{
|
|
||||||
struct StaticInitializer
|
|
||||||
{
|
|
||||||
StaticInitializer ()
|
|
||||||
{
|
|
||||||
when = beast::detail::monotonicCurrentTimeInSeconds();
|
|
||||||
}
|
|
||||||
|
|
||||||
double when;
|
|
||||||
};
|
|
||||||
|
|
||||||
static StaticInitializer const data;
|
|
||||||
|
|
||||||
return data.when;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Used to call getStartupTime as early as possible
|
|
||||||
struct StartupTimeStaticInitializer
|
|
||||||
{
|
|
||||||
StartupTimeStaticInitializer ()
|
|
||||||
{
|
|
||||||
getStartupTime();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static StartupTimeStaticInitializer startupTimeStaticInitializer;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
RelativeTime RelativeTime::fromStartup ()
|
|
||||||
{
|
|
||||||
return RelativeTime (
|
|
||||||
detail::monotonicCurrentTimeInSeconds() - detail::getStartupTime());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,190 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
/*
|
|
||||||
This file is part of Beast: https://github.com/vinniefalco/Beast
|
|
||||||
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
|
||||||
|
|
||||||
Portions of this file are from JUCE.
|
|
||||||
Copyright (c) 2013 - Raw Material Software Ltd.
|
|
||||||
Please visit http://www.juce.com
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
*/
|
|
||||||
//==============================================================================
|
|
||||||
|
|
||||||
#ifndef BEAST_CHRONO_RELATIVETIME_H_INCLUDED
|
|
||||||
#define BEAST_CHRONO_RELATIVETIME_H_INCLUDED
|
|
||||||
|
|
||||||
#include <ripple/beast/core/Config.h>
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
namespace beast {
|
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
/** A relative measure of time.
|
|
||||||
|
|
||||||
The time is stored as a number of seconds, at double-precision floating
|
|
||||||
point accuracy, and may be positive or negative.
|
|
||||||
|
|
||||||
If you need an absolute time, (i.e. a date + time), see the Time class.
|
|
||||||
*/
|
|
||||||
class RelativeTime
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
//==============================================================================
|
|
||||||
/** The underlying data type used by RelativeTime.
|
|
||||||
|
|
||||||
If you need to get to the underlying time and manipulate it
|
|
||||||
you can use this to declare a type that is guaranteed to
|
|
||||||
work cleanly.
|
|
||||||
*/
|
|
||||||
using value_type = double;
|
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
/** Creates a RelativeTime.
|
|
||||||
|
|
||||||
@param seconds the number of seconds, which may be +ve or -ve.
|
|
||||||
@see milliseconds, minutes, hours, days, weeks
|
|
||||||
*/
|
|
||||||
explicit RelativeTime (value_type seconds = 0.0) noexcept;
|
|
||||||
|
|
||||||
/** Copies another relative time. */
|
|
||||||
RelativeTime (const RelativeTime& other) noexcept;
|
|
||||||
|
|
||||||
/** Copies another relative time. */
|
|
||||||
RelativeTime& operator= (const RelativeTime& other) noexcept;
|
|
||||||
|
|
||||||
/** Destructor. */
|
|
||||||
~RelativeTime() noexcept;
|
|
||||||
|
|
||||||
bool isZero() const
|
|
||||||
{ return numSeconds == 0; }
|
|
||||||
|
|
||||||
bool isNotZero() const
|
|
||||||
{ return numSeconds != 0; }
|
|
||||||
|
|
||||||
/** Returns the amount of time since the process was started. */
|
|
||||||
static RelativeTime fromStartup ();
|
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
/** Creates a new RelativeTime object representing a number of milliseconds.
|
|
||||||
@see seconds, minutes, hours, days, weeks
|
|
||||||
*/
|
|
||||||
static RelativeTime milliseconds (int milliseconds) noexcept;
|
|
||||||
|
|
||||||
/** Creates a new RelativeTime object representing a number of milliseconds.
|
|
||||||
@see seconds, minutes, hours, days, weeks
|
|
||||||
*/
|
|
||||||
static RelativeTime milliseconds (std::int64_t milliseconds) noexcept;
|
|
||||||
|
|
||||||
/** Creates a new RelativeTime object representing a number of seconds.
|
|
||||||
@see milliseconds, minutes, hours, days, weeks
|
|
||||||
*/
|
|
||||||
static RelativeTime seconds (value_type seconds) noexcept;
|
|
||||||
|
|
||||||
/** Creates a new RelativeTime object representing a number of minutes.
|
|
||||||
@see milliseconds, hours, days, weeks
|
|
||||||
*/
|
|
||||||
static RelativeTime minutes (value_type numberOfMinutes) noexcept;
|
|
||||||
|
|
||||||
/** Creates a new RelativeTime object representing a number of hours.
|
|
||||||
@see milliseconds, minutes, days, weeks
|
|
||||||
*/
|
|
||||||
static RelativeTime hours (value_type numberOfHours) noexcept;
|
|
||||||
|
|
||||||
/** Creates a new RelativeTime object representing a number of days.
|
|
||||||
@see milliseconds, minutes, hours, weeks
|
|
||||||
*/
|
|
||||||
static RelativeTime days (value_type numberOfDays) noexcept;
|
|
||||||
|
|
||||||
/** Creates a new RelativeTime object representing a number of weeks.
|
|
||||||
@see milliseconds, minutes, hours, days
|
|
||||||
*/
|
|
||||||
static RelativeTime weeks (value_type numberOfWeeks) noexcept;
|
|
||||||
|
|
||||||
//==============================================================================
|
|
||||||
/** Returns the number of milliseconds this time represents.
|
|
||||||
@see milliseconds, inSeconds, inMinutes, inHours, inDays, inWeeks
|
|
||||||
*/
|
|
||||||
std::int64_t inMilliseconds() const noexcept;
|
|
||||||
|
|
||||||
/** Returns the number of seconds this time represents.
|
|
||||||
@see inMilliseconds, inMinutes, inHours, inDays, inWeeks
|
|
||||||
*/
|
|
||||||
value_type inSeconds() const noexcept { return numSeconds; }
|
|
||||||
|
|
||||||
/** Returns the number of minutes this time represents.
|
|
||||||
@see inMilliseconds, inSeconds, inHours, inDays, inWeeks
|
|
||||||
*/
|
|
||||||
value_type inMinutes() const noexcept;
|
|
||||||
|
|
||||||
/** Returns the number of hours this time represents.
|
|
||||||
@see inMilliseconds, inSeconds, inMinutes, inDays, inWeeks
|
|
||||||
*/
|
|
||||||
value_type inHours() const noexcept;
|
|
||||||
|
|
||||||
/** Returns the number of days this time represents.
|
|
||||||
@see inMilliseconds, inSeconds, inMinutes, inHours, inWeeks
|
|
||||||
*/
|
|
||||||
value_type inDays() const noexcept;
|
|
||||||
|
|
||||||
/** Returns the number of weeks this time represents.
|
|
||||||
@see inMilliseconds, inSeconds, inMinutes, inHours, inDays
|
|
||||||
*/
|
|
||||||
value_type inWeeks() const noexcept;
|
|
||||||
|
|
||||||
template <typename Number>
|
|
||||||
RelativeTime operator+ (Number seconds) const noexcept
|
|
||||||
{ return RelativeTime (numSeconds + seconds); }
|
|
||||||
|
|
||||||
template <typename Number>
|
|
||||||
RelativeTime operator- (Number seconds) const noexcept
|
|
||||||
{ return RelativeTime (numSeconds - seconds); }
|
|
||||||
|
|
||||||
/** Adds another RelativeTime to this one. */
|
|
||||||
RelativeTime operator+= (RelativeTime timeToAdd) noexcept;
|
|
||||||
|
|
||||||
/** Subtracts another RelativeTime from this one. */
|
|
||||||
RelativeTime operator-= (RelativeTime timeToSubtract) noexcept;
|
|
||||||
|
|
||||||
/** Adds a number of seconds to this time. */
|
|
||||||
RelativeTime operator+= (value_type secondsToAdd) noexcept;
|
|
||||||
|
|
||||||
/** Subtracts a number of seconds from this time. */
|
|
||||||
RelativeTime operator-= (value_type secondsToSubtract) noexcept;
|
|
||||||
|
|
||||||
private:
|
|
||||||
value_type numSeconds;
|
|
||||||
};
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
bool operator== (RelativeTime t1, RelativeTime t2) noexcept;
|
|
||||||
bool operator!= (RelativeTime t1, RelativeTime t2) noexcept;
|
|
||||||
bool operator> (RelativeTime t1, RelativeTime t2) noexcept;
|
|
||||||
bool operator< (RelativeTime t1, RelativeTime t2) noexcept;
|
|
||||||
bool operator>= (RelativeTime t1, RelativeTime t2) noexcept;
|
|
||||||
bool operator<= (RelativeTime t1, RelativeTime t2) noexcept;
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
/** Adds two RelativeTimes together. */
|
|
||||||
RelativeTime operator+ (RelativeTime t1, RelativeTime t2) noexcept;
|
|
||||||
|
|
||||||
/** Subtracts two RelativeTimes. */
|
|
||||||
RelativeTime operator- (RelativeTime t1, RelativeTime t2) noexcept;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -192,7 +192,6 @@
|
|||||||
|
|
||||||
#include <ripple/beast/core/SemanticVersion.cpp>
|
#include <ripple/beast/core/SemanticVersion.cpp>
|
||||||
#include <ripple/beast/core/SystemStats.cpp>
|
#include <ripple/beast/core/SystemStats.cpp>
|
||||||
#include <ripple/beast/core/RelativeTime.cpp>
|
|
||||||
#include <ripple/beast/core/Thread.cpp>
|
#include <ripple/beast/core/Thread.cpp>
|
||||||
#include <ripple/beast/core/Time.cpp>
|
#include <ripple/beast/core/Time.cpp>
|
||||||
#include <ripple/beast/core/WaitableEvent.cpp>
|
#include <ripple/beast/core/WaitableEvent.cpp>
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ private:
|
|||||||
JobType mType;
|
JobType mType;
|
||||||
std::uint64_t mJobIndex;
|
std::uint64_t mJobIndex;
|
||||||
std::function <void (Job&)> mJob;
|
std::function <void (Job&)> mJob;
|
||||||
LoadEvent::pointer m_loadEvent;
|
std::shared_ptr<LoadEvent> m_loadEvent;
|
||||||
std::string mName;
|
std::string mName;
|
||||||
clock_type::time_point m_queue_time;
|
clock_type::time_point m_queue_time;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -150,11 +150,13 @@ public:
|
|||||||
|
|
||||||
// VFALCO TODO Rename these to newLoadEventMeasurement or something similar
|
// VFALCO TODO Rename these to newLoadEventMeasurement or something similar
|
||||||
// since they create the object.
|
// since they create the object.
|
||||||
LoadEvent::pointer getLoadEvent (JobType t, std::string const& name);
|
std::shared_ptr<LoadEvent>
|
||||||
|
getLoadEvent (JobType t, std::string const& name);
|
||||||
|
|
||||||
// VFALCO TODO Why do we need two versions, one which returns a shared
|
// VFALCO TODO Why do we need two versions, one which returns a shared
|
||||||
// pointer and the other which returns an autoptr?
|
// pointer and the other which returns an autoptr?
|
||||||
LoadEvent::autoptr getLoadEventAP (JobType t, std::string const& name);
|
std::unique_ptr <LoadEvent>
|
||||||
|
getLoadEventAP (JobType t, std::string const& name);
|
||||||
|
|
||||||
/** Add multiple load events.
|
/** Add multiple load events.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -20,8 +20,9 @@
|
|||||||
#ifndef RIPPLE_CORE_LOADEVENT_H_INCLUDED
|
#ifndef RIPPLE_CORE_LOADEVENT_H_INCLUDED
|
||||||
#define RIPPLE_CORE_LOADEVENT_H_INCLUDED
|
#define RIPPLE_CORE_LOADEVENT_H_INCLUDED
|
||||||
|
|
||||||
#include <ripple/beast/core/RelativeTime.h>
|
#include <chrono>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
@@ -34,52 +35,54 @@ class LoadMonitor;
|
|||||||
//
|
//
|
||||||
class LoadEvent
|
class LoadEvent
|
||||||
{
|
{
|
||||||
public:
|
|
||||||
// VFALCO NOTE Why are these shared pointers? Wouldn't there be a
|
|
||||||
// piece of lifetime-managed calling code that can simply own
|
|
||||||
// the object?
|
|
||||||
//
|
|
||||||
// Why both kinds of containers?
|
|
||||||
//
|
|
||||||
using pointer = std::shared_ptr <LoadEvent>;
|
|
||||||
using autoptr = std::unique_ptr <LoadEvent>;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// VFALCO TODO remove the dependency on LoadMonitor. Is that possible?
|
// VFALCO TODO remove the dependency on LoadMonitor. Is that possible?
|
||||||
LoadEvent (LoadMonitor& monitor,
|
LoadEvent (LoadMonitor& monitor,
|
||||||
std::string const& name,
|
std::string const& name,
|
||||||
bool shouldStart);
|
bool shouldStart);
|
||||||
|
LoadEvent(LoadEvent const&) = delete;
|
||||||
|
|
||||||
~LoadEvent ();
|
~LoadEvent ();
|
||||||
|
|
||||||
std::string const& name () const;
|
std::string const&
|
||||||
double getSecondsWaiting() const;
|
name () const;
|
||||||
double getSecondsRunning() const;
|
|
||||||
double getSecondsTotal() const;
|
// The time spent waiting.
|
||||||
|
std::chrono::steady_clock::duration
|
||||||
|
waitTime() const;
|
||||||
|
|
||||||
|
// The time spent running.
|
||||||
|
std::chrono::steady_clock::duration
|
||||||
|
runTime() const;
|
||||||
|
|
||||||
// VFALCO TODO rename this to setName () or setLabel ()
|
// VFALCO TODO rename this to setName () or setLabel ()
|
||||||
void reName (std::string const& name);
|
void reName (std::string const& name);
|
||||||
|
|
||||||
// Start the measurement. The constructor calls this automatically if
|
// Start the measurement. If already started, then
|
||||||
// shouldStart is true. If the operation is aborted, start() can be
|
// restart, assigning the elapsed time to the "waiting"
|
||||||
// called again later.
|
// state.
|
||||||
//
|
|
||||||
void start ();
|
void start ();
|
||||||
|
|
||||||
// Stops the measurement and reports the results. The time reported is
|
// Stop the measurement and report the results. The
|
||||||
// measured from the last call to start.
|
// time reported is measured from the last call to
|
||||||
//
|
// start.
|
||||||
void stop ();
|
void stop ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LoadMonitor& m_loadMonitor;
|
LoadMonitor& monitor_;
|
||||||
bool m_isRunning;
|
|
||||||
std::string m_name;
|
// Represents our current state
|
||||||
// VFALCO TODO Replace these with chrono
|
bool running_;
|
||||||
beast::RelativeTime m_timeStopped;
|
|
||||||
beast::RelativeTime m_timeStarted;
|
// The name associated with this event, if any.
|
||||||
double m_secondsWaiting;
|
std::string name_;
|
||||||
double m_secondsRunning;
|
|
||||||
|
// Represents the time we last transitioned states
|
||||||
|
std::chrono::steady_clock::time_point mark_;
|
||||||
|
|
||||||
|
// The time we spent waiting and running respectively
|
||||||
|
std::chrono::steady_clock::duration timeWaiting_;
|
||||||
|
std::chrono::steady_clock::duration timeRunning_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // ripple
|
} // ripple
|
||||||
|
|||||||
@@ -37,10 +37,6 @@ public:
|
|||||||
explicit
|
explicit
|
||||||
LoadMonitor (beast::Journal j);
|
LoadMonitor (beast::Journal j);
|
||||||
|
|
||||||
void addCount ();
|
|
||||||
|
|
||||||
void addLatency (int latency);
|
|
||||||
|
|
||||||
void addLoadSample (LoadEvent const& sample);
|
void addLoadSample (LoadEvent const& sample);
|
||||||
|
|
||||||
void addSamples (int count, std::chrono::milliseconds latency);
|
void addSamples (int count, std::chrono::milliseconds latency);
|
||||||
@@ -65,13 +61,9 @@ public:
|
|||||||
bool isOver ();
|
bool isOver ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static std::string printElapsed (double seconds);
|
|
||||||
|
|
||||||
void update ();
|
void update ();
|
||||||
|
|
||||||
using LockType = std::mutex;
|
std::mutex mutex_;
|
||||||
using ScopedLockType = std::lock_guard <LockType>;
|
|
||||||
LockType mLock;
|
|
||||||
|
|
||||||
std::uint64_t mCounts;
|
std::uint64_t mCounts;
|
||||||
int mLatencyEvents;
|
int mLatencyEvents;
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ JobQueue::setThreadCount (int c, bool const standaloneMode)
|
|||||||
m_workers.setNumberOfThreads (c);
|
m_workers.setNumberOfThreads (c);
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadEvent::pointer
|
std::shared_ptr<LoadEvent>
|
||||||
JobQueue::getLoadEvent (JobType t, std::string const& name)
|
JobQueue::getLoadEvent (JobType t, std::string const& name)
|
||||||
{
|
{
|
||||||
JobDataMap::iterator iter (m_jobData.find (t));
|
JobDataMap::iterator iter (m_jobData.find (t));
|
||||||
@@ -202,7 +202,7 @@ JobQueue::getLoadEvent (JobType t, std::string const& name)
|
|||||||
std::ref (iter-> second.load ()), name, true);
|
std::ref (iter-> second.load ()), name, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadEvent::autoptr
|
std::unique_ptr<LoadEvent>
|
||||||
JobQueue::getLoadEventAP (JobType t, std::string const& name)
|
JobQueue::getLoadEventAP (JobType t, std::string const& name)
|
||||||
{
|
{
|
||||||
JobDataMap::iterator iter (m_jobData.find (t));
|
JobDataMap::iterator iter (m_jobData.find (t));
|
||||||
|
|||||||
@@ -21,79 +21,74 @@
|
|||||||
#include <ripple/core/LoadEvent.h>
|
#include <ripple/core/LoadEvent.h>
|
||||||
#include <ripple/core/LoadMonitor.h>
|
#include <ripple/core/LoadMonitor.h>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
|
|
||||||
LoadEvent::LoadEvent (LoadMonitor& monitor, std::string const& name, bool shouldStart)
|
LoadEvent::LoadEvent (
|
||||||
: m_loadMonitor (monitor)
|
LoadMonitor& monitor,
|
||||||
, m_isRunning (false)
|
std::string const& name,
|
||||||
, m_name (name)
|
bool shouldStart)
|
||||||
, m_timeStopped (beast::RelativeTime::fromStartup())
|
: monitor_ (monitor)
|
||||||
, m_secondsWaiting (0)
|
, running_ (shouldStart)
|
||||||
, m_secondsRunning (0)
|
, name_ (name)
|
||||||
|
, mark_ { std::chrono::steady_clock::now() }
|
||||||
|
, timeWaiting_ {}
|
||||||
|
, timeRunning_ {}
|
||||||
{
|
{
|
||||||
if (shouldStart)
|
|
||||||
start ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadEvent::~LoadEvent ()
|
LoadEvent::~LoadEvent ()
|
||||||
{
|
{
|
||||||
if (m_isRunning)
|
if (running_)
|
||||||
stop ();
|
stop ();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string const& LoadEvent::name () const
|
std::string const& LoadEvent::name () const
|
||||||
{
|
{
|
||||||
return m_name;
|
return name_;
|
||||||
}
|
}
|
||||||
|
|
||||||
double LoadEvent::getSecondsWaiting() const
|
std::chrono::steady_clock::duration
|
||||||
|
LoadEvent::waitTime() const
|
||||||
{
|
{
|
||||||
return m_secondsWaiting;
|
return timeWaiting_;
|
||||||
}
|
}
|
||||||
|
|
||||||
double LoadEvent::getSecondsRunning() const
|
std::chrono::steady_clock::duration
|
||||||
|
LoadEvent::runTime() const
|
||||||
{
|
{
|
||||||
return m_secondsRunning;
|
return timeRunning_;
|
||||||
}
|
|
||||||
|
|
||||||
double LoadEvent::getSecondsTotal() const
|
|
||||||
{
|
|
||||||
return m_secondsWaiting + m_secondsRunning;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadEvent::reName (std::string const& name)
|
void LoadEvent::reName (std::string const& name)
|
||||||
{
|
{
|
||||||
m_name = name;
|
name_ = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadEvent::start ()
|
void LoadEvent::start ()
|
||||||
{
|
{
|
||||||
beast::RelativeTime const currentTime (beast::RelativeTime::fromStartup());
|
auto const now = std::chrono::steady_clock::now();
|
||||||
|
|
||||||
// If we already called start, this call will replace the previous one.
|
// If we had already called start, this call will
|
||||||
if (m_isRunning)
|
// replace the previous one. Any time accumulated will
|
||||||
{
|
// be counted as "waiting".
|
||||||
m_secondsWaiting += (currentTime - m_timeStarted).inSeconds();
|
timeWaiting_ += now - mark_;
|
||||||
}
|
mark_ = now;
|
||||||
else
|
running_ = true;
|
||||||
{
|
|
||||||
m_secondsWaiting += (currentTime - m_timeStopped).inSeconds();
|
|
||||||
m_isRunning = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_timeStarted = currentTime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadEvent::stop ()
|
void LoadEvent::stop ()
|
||||||
{
|
{
|
||||||
assert (m_isRunning);
|
assert (running_);
|
||||||
|
|
||||||
m_timeStopped = beast::RelativeTime::fromStartup();
|
auto const now = std::chrono::steady_clock::now();
|
||||||
m_secondsRunning += (m_timeStopped - m_timeStarted).inSeconds();
|
|
||||||
|
|
||||||
m_isRunning = false;
|
timeRunning_ += now - mark_;
|
||||||
m_loadMonitor.addLoadSample (*this);
|
mark_ = now;
|
||||||
|
running_ = false;
|
||||||
|
|
||||||
|
monitor_.addLoadSample (*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // ripple
|
} // ripple
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include <BeastConfig.h>
|
#include <BeastConfig.h>
|
||||||
#include <ripple/basics/Log.h>
|
#include <ripple/basics/Log.h>
|
||||||
#include <ripple/basics/UptimeTimer.h>
|
#include <ripple/basics/UptimeTimer.h>
|
||||||
|
#include <ripple/beast/clock/chrono_util.h>
|
||||||
#include <ripple/core/LoadMonitor.h>
|
#include <ripple/core/LoadMonitor.h>
|
||||||
|
|
||||||
namespace ripple {
|
namespace ripple {
|
||||||
@@ -66,9 +67,6 @@ LoadMonitor::LoadMonitor (beast::Journal j)
|
|||||||
void LoadMonitor::update ()
|
void LoadMonitor::update ()
|
||||||
{
|
{
|
||||||
int now = UptimeTimer::getInstance ().getElapsedSeconds ();
|
int now = UptimeTimer::getInstance ().getElapsedSeconds ();
|
||||||
|
|
||||||
// VFALCO TODO stop returning from the middle of functions.
|
|
||||||
|
|
||||||
if (now == mLastUpdate) // current
|
if (now == mLastUpdate) // current
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -104,73 +102,23 @@ void LoadMonitor::update ()
|
|||||||
while (mLastUpdate < now);
|
while (mLastUpdate < now);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadMonitor::addCount ()
|
void LoadMonitor::addLoadSample (LoadEvent const& s)
|
||||||
{
|
{
|
||||||
ScopedLockType sl (mLock);
|
using namespace std::chrono;
|
||||||
|
|
||||||
update ();
|
auto const total = s.runTime() + s.waitTime();
|
||||||
++mCounts;
|
// Don't include "jitter" as part of the latency
|
||||||
}
|
auto const latency = total < 2ms ? 0ms : round<milliseconds>(total);
|
||||||
|
|
||||||
void LoadMonitor::addLatency (int latency)
|
if (latency > 500ms)
|
||||||
{
|
|
||||||
// VFALCO NOTE Why does 1 become 0?
|
|
||||||
if (latency == 1)
|
|
||||||
latency = 0;
|
|
||||||
|
|
||||||
ScopedLockType sl (mLock);
|
|
||||||
|
|
||||||
update ();
|
|
||||||
|
|
||||||
++mLatencyEvents;
|
|
||||||
mLatencyMSAvg += latency;
|
|
||||||
mLatencyMSPeak += latency;
|
|
||||||
|
|
||||||
// Units are quarters of a millisecond
|
|
||||||
int const latencyPeak = mLatencyEvents * latency * 4;
|
|
||||||
|
|
||||||
if (mLatencyMSPeak < latencyPeak)
|
|
||||||
mLatencyMSPeak = latencyPeak;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string LoadMonitor::printElapsed (double seconds)
|
|
||||||
{
|
|
||||||
std::stringstream ss;
|
|
||||||
ss << (std::size_t (seconds * 1000 + 0.5)) << " ms";
|
|
||||||
return ss.str();
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoadMonitor::addLoadSample (LoadEvent const& sample)
|
|
||||||
{
|
|
||||||
std::string const& name (sample.name());
|
|
||||||
beast::RelativeTime const latency (sample.getSecondsTotal());
|
|
||||||
|
|
||||||
if (latency.inSeconds() > 0.5)
|
|
||||||
{
|
{
|
||||||
auto mj = latency.inSeconds() > 1.0 ? j_.warn() : j_.info();
|
auto mj = (latency > 1s) ? j_.warn() : j_.info();
|
||||||
JLOG (mj)
|
JLOG (mj) << "Job: " << s.name() <<
|
||||||
<< "Job: " << name << " ExecutionTime: " << printElapsed (sample.getSecondsRunning()) <<
|
" run: " << round<milliseconds>(s.runTime()).count() << "ms" <<
|
||||||
" WaitingTime: " << printElapsed (sample.getSecondsWaiting());
|
" wait: " << round<milliseconds>(s.waitTime()).count() << "ms";
|
||||||
}
|
}
|
||||||
|
|
||||||
// VFALCO NOTE Why does 1 become 0?
|
addSamples (1, latency);
|
||||||
std::size_t latencyMilliseconds (latency.inMilliseconds());
|
|
||||||
if (latencyMilliseconds == 1)
|
|
||||||
latencyMilliseconds = 0;
|
|
||||||
|
|
||||||
ScopedLockType sl (mLock);
|
|
||||||
|
|
||||||
update ();
|
|
||||||
++mCounts;
|
|
||||||
++mLatencyEvents;
|
|
||||||
mLatencyMSAvg += latencyMilliseconds;
|
|
||||||
mLatencyMSPeak += latencyMilliseconds;
|
|
||||||
|
|
||||||
// VFALCO NOTE Why are we multiplying by 4?
|
|
||||||
int const latencyPeak = mLatencyEvents * latencyMilliseconds * 4;
|
|
||||||
|
|
||||||
if (mLatencyMSPeak < latencyPeak)
|
|
||||||
mLatencyMSPeak = latencyPeak;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add multiple samples
|
/* Add multiple samples
|
||||||
@@ -179,7 +127,7 @@ void LoadMonitor::addLoadSample (LoadEvent const& sample)
|
|||||||
*/
|
*/
|
||||||
void LoadMonitor::addSamples (int count, std::chrono::milliseconds latency)
|
void LoadMonitor::addSamples (int count, std::chrono::milliseconds latency)
|
||||||
{
|
{
|
||||||
ScopedLockType sl (mLock);
|
std::lock_guard<std::mutex> sl (mutex_);
|
||||||
|
|
||||||
update ();
|
update ();
|
||||||
mCounts += count;
|
mCounts += count;
|
||||||
@@ -207,7 +155,7 @@ bool LoadMonitor::isOverTarget (std::uint64_t avg, std::uint64_t peak)
|
|||||||
|
|
||||||
bool LoadMonitor::isOver ()
|
bool LoadMonitor::isOver ()
|
||||||
{
|
{
|
||||||
ScopedLockType sl (mLock);
|
std::lock_guard<std::mutex> sl (mutex_);
|
||||||
|
|
||||||
update ();
|
update ();
|
||||||
|
|
||||||
@@ -221,7 +169,7 @@ LoadMonitor::Stats LoadMonitor::getStats ()
|
|||||||
{
|
{
|
||||||
Stats stats;
|
Stats stats;
|
||||||
|
|
||||||
ScopedLockType sl (mLock);
|
std::lock_guard<std::mutex> sl (mutex_);
|
||||||
|
|
||||||
update ();
|
update ();
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ public:
|
|||||||
cacheTargetSize, cacheTargetSeconds)
|
cacheTargetSize, cacheTargetSeconds)
|
||||||
, m_readShut (false)
|
, m_readShut (false)
|
||||||
, m_readGen (0)
|
, m_readGen (0)
|
||||||
|
, fdlimit_ (0)
|
||||||
, m_storeCount (0)
|
, m_storeCount (0)
|
||||||
, m_fetchTotalCount (0)
|
, m_fetchTotalCount (0)
|
||||||
, m_fetchHitCount (0)
|
, m_fetchHitCount (0)
|
||||||
|
|||||||
@@ -494,16 +494,7 @@ nodeobject_compress (void const* in,
|
|||||||
std::pair<void const*, std::size_t> result;
|
std::pair<void const*, std::size_t> result;
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
case 0: // uncompressed
|
// case 0 was uncompressed data; we always compress now.
|
||||||
{
|
|
||||||
result.second = vn + in_size;
|
|
||||||
std::uint8_t* p = reinterpret_cast<
|
|
||||||
std::uint8_t*>(bf(result.second));
|
|
||||||
result.first = p;
|
|
||||||
std::memcpy(p, vi.data(), vn);
|
|
||||||
std::memcpy(p + vn, in, in_size);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1: // lz4
|
case 1: // lz4
|
||||||
{
|
{
|
||||||
std::uint8_t* p;
|
std::uint8_t* p;
|
||||||
|
|||||||
@@ -103,8 +103,6 @@ private:
|
|||||||
|
|
||||||
AppBundle (beast::unit_test::suite& suite,
|
AppBundle (beast::unit_test::suite& suite,
|
||||||
std::unique_ptr<Config> config);
|
std::unique_ptr<Config> config);
|
||||||
AppBundle (beast::unit_test::suite& suite,
|
|
||||||
Application* app_);
|
|
||||||
~AppBundle();
|
~AppBundle();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -151,12 +151,6 @@ public:
|
|||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
Env::AppBundle::AppBundle(beast::unit_test::suite&,
|
|
||||||
Application* app_)
|
|
||||||
: app(app_)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Env::AppBundle::AppBundle(beast::unit_test::suite& suite,
|
Env::AppBundle::AppBundle(beast::unit_test::suite& suite,
|
||||||
std::unique_ptr<Config> config)
|
std::unique_ptr<Config> config)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user