Commit 5c7aa5f2 authored by Sergei Golubchik's avatar Sergei Golubchik

feedback plugin:

  fix for mem_total on windows
  report the time of the data snapshot
parent 04f3ecf6
...@@ -188,24 +188,24 @@ int fill_plugin_version(THD *thd, TABLE_LIST *tables) ...@@ -188,24 +188,24 @@ int fill_plugin_version(THD *thd, TABLE_LIST *tables)
*/ */
static ulonglong my_getphysmem() static ulonglong my_getphysmem()
{ {
#ifdef _WIN32
MEMORYSTATUSEX memstatus;
memstatus.dwLength= sizeof(memstatus);
GlobalMemoryStatusEx(&memstatus);
return memstatus.ullTotalPhys;
#else
ulonglong pages= 0; ulonglong pages= 0;
#ifdef _SC_PHYS_PAGES #ifdef _SC_PHYS_PAGES
pages= sysconf(_SC_PHYS_PAGES); pages= sysconf(_SC_PHYS_PAGES);
#else
return 0;
#endif #endif
#ifdef _SC_PAGESIZE #ifdef _SC_PAGESIZE
return pages * sysconf(_SC_PAGESIZE); return pages * sysconf(_SC_PAGESIZE);
#endif
#ifdef _WIN32
MEMORYSTATUSEX memstatus;
memstatus.dwLength= sizeof(memstatus);
GlobalMemoryStatusEx(&memstatus);
return memstatus.ullTotalPhys;
#else #else
return pages * my_getpagesize(); return pages * my_getpagesize();
#endif #endif
#endif
} }
/* get the number of (online) CPUs */ /* get the number of (online) CPUs */
...@@ -356,6 +356,7 @@ int fill_misc_data(THD *thd, TABLE_LIST *tables) ...@@ -356,6 +356,7 @@ int fill_misc_data(THD *thd, TABLE_LIST *tables)
INSERT1("Cpu_count", (my_getncpus(), UNSIGNED)); INSERT1("Cpu_count", (my_getncpus(), UNSIGNED));
#endif #endif
INSERT1("Mem_total", (my_getphysmem(), UNSIGNED)); INSERT1("Mem_total", (my_getphysmem(), UNSIGNED));
INSERT1("Now", (thd->query_start(), UNSIGNED));
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment