1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

This patch revives PP poorman's profiling using StopWatch class

This commit is contained in:
Roman Nozdrin
2021-04-08 12:06:22 +00:00
parent fd720bfd7d
commit 895cbbe2d1
3 changed files with 12 additions and 10 deletions

View File

@ -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