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

clang format apply

This commit is contained in:
Leonid Fedorov
2022-02-11 12:24:40 +00:00
parent 509f005be7
commit 7c808317dc
1367 changed files with 394342 additions and 413129 deletions

View File

@@ -74,68 +74,67 @@
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
#endif // STOPWATCH_H
#endif // STOPWATCH_H