1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

clang format apply

This commit is contained in:
Leonid Fedorov
2022-01-21 16:43:49 +00:00
parent 6b6411229f
commit 04752ec546
1376 changed files with 393460 additions and 412662 deletions

View File

@ -73,67 +73,65 @@
namespace logging
{
class StopWatch
{
public:
void start(const std::string& message);
bool stop(const std::string& message, const int limit);
void stop(const std::string& message);
void finish();
public:
void start(const std::string& message);
bool stop(const std::string& message, const int limit);
void stop(const std::string& message);
void finish();
bool isActive()
bool isActive()
{
return fOpenCalls > 0;
}
StopWatch() : fStarted(false), fId(-1), fOpenCalls(0), fOutputToFile(false), fLogFile(""){};
StopWatch(int id) : fStarted(false), fId(id), fOpenCalls(0), fOutputToFile(false), fLogFile(""){};
StopWatch(const std::string& fileName)
: fStarted(false), fId(-1), fOpenCalls(0), fOutputToFile(true), fLogFile(fileName)
{
}
struct ::timeval fTvLast;
int getId()
{
return fId;
}
private:
class ProcessStats
{
public:
std::string fProcess;
struct timeval fTvProcessStarted;
double fTotalSeconds;
int64_t fStartCount;
int64_t fStopCount;
ProcessStats() : fProcess(""), fTotalSeconds(0.0), fStartCount(0), fStopCount(0){};
void processStart()
{
return fOpenCalls > 0;
}
StopWatch() : fStarted(false), fId(-1), fOpenCalls(0), fOutputToFile(false), fLogFile("") {};
StopWatch(int id) : fStarted(false), fId(id), fOpenCalls(0), fOutputToFile(false), fLogFile("") {};
StopWatch(const std::string& fileName) : fStarted(false), fId(-1), fOpenCalls(0), fOutputToFile(true), fLogFile(fileName) {}
struct ::timeval fTvLast;
int getId()
{
return fId;
gettimeofday(&fTvProcessStarted, 0);
fStartCount++;
}
private:
class ProcessStats
void processStop()
{
public:
struct timeval tvStop;
gettimeofday(&tvStop, 0);
fStopCount++;
fTotalSeconds += (tvStop.tv_sec + (tvStop.tv_usec / 1000000.0)) -
(fTvProcessStarted.tv_sec + (fTvProcessStarted.tv_usec / 1000000.0));
}
};
std::string fProcess;
struct timeval fTvProcessStarted;
double fTotalSeconds;
int64_t fStartCount;
int64_t fStopCount;
ProcessStats() : fProcess(""), fTotalSeconds(0.0), fStartCount(0), fStopCount(0) {};
void processStart()
{
gettimeofday(&fTvProcessStarted, 0);
fStartCount++;
}
void processStop()
{
struct timeval tvStop;
gettimeofday(&tvStop, 0);
fStopCount++;
fTotalSeconds +=
(tvStop.tv_sec + (tvStop.tv_usec / 1000000.0)) -
(fTvProcessStarted.tv_sec + (fTvProcessStarted.tv_usec / 1000000.0));
}
};
struct timeval fTvStart;
std::vector <ProcessStats> fProcessStats;
bool fStarted;
int fId;
int fOpenCalls;
bool fOutputToFile;
std::string fLogFile;
struct timeval fTvStart;
std::vector<ProcessStats> fProcessStats;
bool fStarted;
int fId;
int fOpenCalls;
bool fOutputToFile;
std::string fLogFile;
};
} // end of logging namespace
} // namespace logging