You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
This patch revives PP poorman's profiling using StopWatch class
This commit is contained in:
@ -2155,11 +2155,15 @@ void BatchPrimitiveProcessor::makeResponse()
|
||||
int BatchPrimitiveProcessor::operator()()
|
||||
{
|
||||
utils::setThreadName("PPBatchPrimProc");
|
||||
#ifdef PRIMPROC_STOPWATCH
|
||||
const static std::string msg{"BatchPrimitiveProcessor::operator()"};
|
||||
logging::StopWatch* stopwatch = nullptr;
|
||||
#endif
|
||||
|
||||
if (currentBlockOffset == 0)
|
||||
{
|
||||
#ifdef PRIMPROC_STOPWATCH // TODO: needs to be brought up-to-date
|
||||
map<pthread_t, logging::StopWatch*>::iterator stopwatchMapIter = stopwatchMap.find(pthread_self());
|
||||
logging::StopWatch* stopwatch;
|
||||
#ifdef PRIMPROC_STOPWATCH
|
||||
auto stopwatchMapIter = stopwatchMap.find(pthread_self());
|
||||
|
||||
if (stopwatchMapIter != stopwatchMap.end())
|
||||
{
|
||||
@ -2169,7 +2173,7 @@ int BatchPrimitiveProcessor::operator()()
|
||||
{
|
||||
pthread_mutex_lock(&stopwatchMapMutex);
|
||||
stopwatch = new logging::StopWatch(stopwatchMap.size());
|
||||
stopwatchMap.insert(make_pair(pthread_self(), stopwatch));
|
||||
stopwatchMap.insert({pthread_self(), stopwatch});
|
||||
|
||||
// Create the thread that will show timing results after five seconds of idle time.
|
||||
if (!stopwatchThreadCreated)
|
||||
@ -2186,9 +2190,6 @@ int BatchPrimitiveProcessor::operator()()
|
||||
pthread_mutex_unlock(&stopwatchMapMutex);
|
||||
}
|
||||
|
||||
ostringstream oss;
|
||||
oss << "BatchPrimitiveProcessor::operator()";
|
||||
string msg = oss.str();
|
||||
stopwatch->start(msg);
|
||||
#endif
|
||||
|
||||
|
@ -2628,7 +2628,7 @@ bool BPPV::aborted()
|
||||
}
|
||||
|
||||
#ifdef PRIMPROC_STOPWATCH
|
||||
map<pthread_t, logging::StopWatch*> stopwatchMap;
|
||||
std::unordered_map<pthread_t, logging::StopWatch*> stopwatchMap;
|
||||
pthread_mutex_t stopwatchMapMutex;
|
||||
bool stopwatchThreadCreated = false;
|
||||
|
||||
@ -2670,7 +2670,7 @@ void* autoFinishStopwatchThread(void* arg)
|
||||
pause_(2);
|
||||
count++;
|
||||
// Iterate through the stopwatch map and see how long it's been since last activity.
|
||||
map<pthread_t, logging::StopWatch*>::iterator stopwatchMapIter = stopwatchMap.begin();
|
||||
auto stopwatchMapIter = stopwatchMap.begin();
|
||||
logging::StopWatch* stopwatch;
|
||||
gettimeofday(&tvCurrent, 0);
|
||||
bool primProcIdle = true;
|
||||
|
@ -32,6 +32,7 @@
|
||||
#else
|
||||
#include <tr1/unordered_map>
|
||||
#include <tr1/unordered_set>
|
||||
#include <unordered_map>
|
||||
#endif
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
@ -60,7 +61,7 @@ extern boost::mutex bppLock;
|
||||
extern uint32_t highPriorityThreads, medPriorityThreads, lowPriorityThreads;
|
||||
|
||||
#ifdef PRIMPROC_STOPWATCH
|
||||
extern std::map<pthread_t, logging::StopWatch*> stopwatchMap;
|
||||
extern std::unordered_map<pthread_t, logging::StopWatch*> stopwatchMap;
|
||||
extern pthread_mutex_t stopwatchMapMutex;
|
||||
extern bool stopwatchThreadCreated;
|
||||
|
||||
|
Reference in New Issue
Block a user