You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-08 14:22:09 +03:00
Reformat all code to coding standard
This commit is contained in:
@@ -28,81 +28,81 @@
|
||||
// we'll just have to make our own >:(
|
||||
inline int GetProcessList()
|
||||
{
|
||||
HANDLE hProcessSnap;
|
||||
PROCESSENTRY32 pe32;
|
||||
long Processes = 0;
|
||||
HANDLE hProcessSnap;
|
||||
PROCESSENTRY32 pe32;
|
||||
long Processes = 0;
|
||||
|
||||
|
||||
// Snapshot the current processes and make sure it's valid
|
||||
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
|
||||
// Snapshot the current processes and make sure it's valid
|
||||
hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
|
||||
|
||||
|
||||
if(hProcessSnap == INVALID_HANDLE_VALUE)
|
||||
return Processes;
|
||||
if (hProcessSnap == INVALID_HANDLE_VALUE)
|
||||
return Processes;
|
||||
|
||||
|
||||
// Set the size of the structure before using it.
|
||||
pe32.dwSize = sizeof(PROCESSENTRY32);
|
||||
// Set the size of the structure before using it.
|
||||
pe32.dwSize = sizeof(PROCESSENTRY32);
|
||||
|
||||
|
||||
// Retrieve information about the first process,
|
||||
// and exit if unsuccessful
|
||||
if(!Process32First(hProcessSnap, &pe32))
|
||||
{
|
||||
CloseHandle(hProcessSnap); // clean the snapshot object
|
||||
return Processes;
|
||||
}
|
||||
// Retrieve information about the first process,
|
||||
// and exit if unsuccessful
|
||||
if (!Process32First(hProcessSnap, &pe32))
|
||||
{
|
||||
CloseHandle(hProcessSnap); // clean the snapshot object
|
||||
return Processes;
|
||||
}
|
||||
|
||||
|
||||
// Count the total number of processes
|
||||
do
|
||||
{
|
||||
Processes++;
|
||||
}
|
||||
while(Process32Next(hProcessSnap, &pe32));
|
||||
// Count the total number of processes
|
||||
do
|
||||
{
|
||||
Processes++;
|
||||
}
|
||||
while (Process32Next(hProcessSnap, &pe32));
|
||||
|
||||
|
||||
CloseHandle(hProcessSnap);
|
||||
CloseHandle(hProcessSnap);
|
||||
|
||||
|
||||
return Processes;
|
||||
return Processes;
|
||||
}
|
||||
|
||||
int sysinfo(struct sysinfo *info)
|
||||
int sysinfo(struct sysinfo* info)
|
||||
{
|
||||
SYSTEM_INFO si;
|
||||
MEMORYSTATUSEX statex;
|
||||
SYSTEM_INFO si;
|
||||
MEMORYSTATUSEX statex;
|
||||
|
||||
|
||||
ZeroMemory(&si, sizeof(SYSTEM_INFO));
|
||||
statex.dwLength = sizeof(statex);
|
||||
GetSystemInfo(&si);
|
||||
ZeroMemory(&si, sizeof(SYSTEM_INFO));
|
||||
statex.dwLength = sizeof(statex);
|
||||
GetSystemInfo(&si);
|
||||
|
||||
|
||||
if(!GlobalMemoryStatusEx(&statex))
|
||||
return -1;
|
||||
if (!GlobalMemoryStatusEx(&statex))
|
||||
return -1;
|
||||
|
||||
|
||||
// System Uptime
|
||||
info->uptime = GetTickCount64() / 1000 % 60;
|
||||
// System Uptime
|
||||
info->uptime = GetTickCount64() / 1000 % 60;
|
||||
|
||||
|
||||
// Load times - windows does not have this so say -1 or 0 or nothing basically
|
||||
info->loads[0] = -1;
|
||||
info->loads[1] = -1;
|
||||
info->loads[2] = -1;
|
||||
// Load times - windows does not have this so say -1 or 0 or nothing basically
|
||||
info->loads[0] = -1;
|
||||
info->loads[1] = -1;
|
||||
info->loads[2] = -1;
|
||||
|
||||
|
||||
// Ram usages - note that these may not be exact to what linux has
|
||||
info->freeram = statex.ullAvailPhys;
|
||||
info->freeswap = statex.ullAvailVirtual;
|
||||
info->sharedram = 0;
|
||||
info->totalram = statex.ullTotalPhys;
|
||||
info->bufferram = statex.ullTotalPageFile;
|
||||
info->totalswap = statex.ullTotalVirtual;
|
||||
// Ram usages - note that these may not be exact to what linux has
|
||||
info->freeram = statex.ullAvailPhys;
|
||||
info->freeswap = statex.ullAvailVirtual;
|
||||
info->sharedram = 0;
|
||||
info->totalram = statex.ullTotalPhys;
|
||||
info->bufferram = statex.ullTotalPageFile;
|
||||
info->totalswap = statex.ullTotalVirtual;
|
||||
|
||||
|
||||
// Processes
|
||||
info->procs = GetProcessList();
|
||||
return 0;
|
||||
// Processes
|
||||
info->procs = GetProcessList();
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user