mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-01 16:05:52 +00:00
Remove ScopedMetrics
This commit is contained in:
committed by
Nik Bougalis
parent
45b07ff9ec
commit
810175ae95
@@ -2546,12 +2546,6 @@
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\rocksdb2\include;..\..\src\snappy\config;..\..\src\snappy\snappy;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\rocksdb2\include;..\..\src\snappy\config;..\..\src\snappy\snappy;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\nodestore\impl\ScopedMetrics.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='debug.classic|x64'">..\..\src\rocksdb2\include;..\..\src\snappy\config;..\..\src\snappy\snappy;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='release.classic|x64'">..\..\src\rocksdb2\include;..\..\src\snappy\config;..\..\src\snappy\snappy;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\nodestore\impl\Tuning.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\nodestore\Manager.h">
|
||||
@@ -2560,8 +2554,6 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\nodestore\Scheduler.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\nodestore\ScopedMetrics.h">
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\nodestore\Task.h">
|
||||
</ClInclude>
|
||||
<ClCompile Include="..\..\src\ripple\nodestore\tests\Backend.test.cpp">
|
||||
|
||||
@@ -3228,9 +3228,6 @@
|
||||
<ClCompile Include="..\..\src\ripple\nodestore\impl\NodeObject.cpp">
|
||||
<Filter>ripple\nodestore\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\ripple\nodestore\impl\ScopedMetrics.cpp">
|
||||
<Filter>ripple\nodestore\impl</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="..\..\src\ripple\nodestore\impl\Tuning.h">
|
||||
<Filter>ripple\nodestore\impl</Filter>
|
||||
</ClInclude>
|
||||
@@ -3243,9 +3240,6 @@
|
||||
<ClInclude Include="..\..\src\ripple\nodestore\Scheduler.h">
|
||||
<Filter>ripple\nodestore</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\nodestore\ScopedMetrics.h">
|
||||
<Filter>ripple\nodestore</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\ripple\nodestore\Task.h">
|
||||
<Filter>ripple\nodestore</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
||||
|
||||
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 RIPPLE_NODESTORE_SCOPEDMETRICS_H_INCLUDED
|
||||
#define RIPPLE_NODESTORE_SCOPEDMETRICS_H_INCLUDED
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
namespace ripple {
|
||||
namespace NodeStore {
|
||||
|
||||
/** RAII observer to track NodeStore fetches made by the calling thread. */
|
||||
class ScopedMetrics
|
||||
{
|
||||
private:
|
||||
ScopedMetrics* prev_;
|
||||
|
||||
public:
|
||||
ScopedMetrics ();
|
||||
~ScopedMetrics ();
|
||||
|
||||
static
|
||||
ScopedMetrics*
|
||||
get ();
|
||||
|
||||
static
|
||||
void
|
||||
incrementThreadFetches ();
|
||||
|
||||
std::size_t fetches = 0;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -30,7 +30,6 @@
|
||||
#include <ripple/basics/Slice.h>
|
||||
#include <ripple/basics/TaggedCache.h>
|
||||
#include <beast/threads/Thread.h>
|
||||
#include <ripple/nodestore/ScopedMetrics.h>
|
||||
#include <chrono>
|
||||
#include <condition_variable>
|
||||
#include <set>
|
||||
@@ -160,8 +159,6 @@ public:
|
||||
|
||||
std::shared_ptr<NodeObject> fetch (uint256 const& hash) override
|
||||
{
|
||||
ScopedMetrics::incrementThreadFetches ();
|
||||
|
||||
return doTimedFetch (hash, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
/*
|
||||
This file is part of rippled: https://github.com/ripple/rippled
|
||||
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
||||
|
||||
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/nodestore/ScopedMetrics.h>
|
||||
#include <boost/thread/tss.hpp>
|
||||
|
||||
namespace ripple {
|
||||
namespace NodeStore {
|
||||
|
||||
static
|
||||
void
|
||||
cleanup (ScopedMetrics*)
|
||||
{
|
||||
}
|
||||
|
||||
static
|
||||
boost::thread_specific_ptr<ScopedMetrics> scopedMetricsPtr (&cleanup);
|
||||
|
||||
ScopedMetrics::ScopedMetrics () : prev_ (scopedMetricsPtr.get ())
|
||||
{
|
||||
scopedMetricsPtr.reset (this);
|
||||
}
|
||||
|
||||
ScopedMetrics::~ScopedMetrics ()
|
||||
{
|
||||
scopedMetricsPtr.reset (prev_);
|
||||
}
|
||||
|
||||
ScopedMetrics*
|
||||
ScopedMetrics::get ()
|
||||
{
|
||||
return scopedMetricsPtr.get ();
|
||||
}
|
||||
|
||||
void
|
||||
ScopedMetrics::incrementThreadFetches ()
|
||||
{
|
||||
if (scopedMetricsPtr.get ())
|
||||
++scopedMetricsPtr.get ()->fetches;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <ripple/core/JobCoro.h>
|
||||
#include <ripple/net/InfoSub.h>
|
||||
#include <ripple/server/Role.h>
|
||||
#include <ripple/nodestore/ScopedMetrics.h>
|
||||
|
||||
#include <beast/utility/Journal.h>
|
||||
|
||||
@@ -48,7 +47,6 @@ struct Context
|
||||
Role role;
|
||||
std::shared_ptr<JobCoro> jobCoro;
|
||||
InfoSub::pointer infoSub;
|
||||
NodeStore::ScopedMetrics metrics;
|
||||
};
|
||||
|
||||
} // RPC
|
||||
|
||||
@@ -68,7 +68,6 @@ ServerHandlerImp::ServerHandlerImp (Application& app, Stoppable& parent,
|
||||
{
|
||||
auto const& group (cm.group ("rpc"));
|
||||
rpc_requests_ = group->make_counter ("requests");
|
||||
rpc_io_ = group->make_event ("io");
|
||||
rpc_size_ = group->make_event ("size");
|
||||
rpc_time_ = group->make_event ("time");
|
||||
}
|
||||
@@ -365,8 +364,6 @@ ServerHandlerImp::processRequest (HTTP::Port const& port,
|
||||
std::chrono::duration_cast <std::chrono::milliseconds> (
|
||||
std::chrono::high_resolution_clock::now () - start)));
|
||||
++rpc_requests_;
|
||||
rpc_io_.notify (static_cast <beast::insight::Event::value_type> (
|
||||
context.metrics.fetches));
|
||||
rpc_size_.notify (static_cast <beast::insight::Event::value_type> (
|
||||
response.size ()));
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@ private:
|
||||
Setup setup_;
|
||||
JobQueue& m_jobQueue;
|
||||
beast::insight::Counter rpc_requests_;
|
||||
beast::insight::Event rpc_io_;
|
||||
beast::insight::Event rpc_size_;
|
||||
beast::insight::Event rpc_time_;
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include <ripple/nodestore/impl/EncodedBlob.cpp>
|
||||
#include <ripple/nodestore/impl/ManagerImp.cpp>
|
||||
#include <ripple/nodestore/impl/NodeObject.cpp>
|
||||
#include <ripple/nodestore/impl/ScopedMetrics.cpp>
|
||||
|
||||
#include <ripple/nodestore/tests/Backend.test.cpp>
|
||||
#include <ripple/nodestore/tests/Basics.test.cpp>
|
||||
|
||||
@@ -73,7 +73,6 @@ public:
|
||||
private:
|
||||
Application& app_;
|
||||
beast::insight::Counter rpc_requests_;
|
||||
beast::insight::Event rpc_io_;
|
||||
beast::insight::Event rpc_size_;
|
||||
beast::insight::Event rpc_time_;
|
||||
ServerDescription desc_;
|
||||
@@ -95,7 +94,6 @@ public:
|
||||
{
|
||||
auto const& group (desc_.collectorManager.group ("rpc"));
|
||||
rpc_requests_ = group->make_counter ("requests");
|
||||
rpc_io_ = group->make_event ("io");
|
||||
rpc_size_ = group->make_event ("size");
|
||||
rpc_time_ = group->make_event ("time");
|
||||
}
|
||||
@@ -483,12 +481,6 @@ public:
|
||||
"connectivity is working.</p></body></html>");
|
||||
return true;
|
||||
}
|
||||
|
||||
void recordMetrics (RPC::Context const& context) const
|
||||
{
|
||||
rpc_io_.notify (static_cast <beast::insight::Event::value_type> (
|
||||
context.metrics.fetches));
|
||||
}
|
||||
};
|
||||
|
||||
} // websocket
|
||||
|
||||
Reference in New Issue
Block a user