Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
5c7aa5f2
Commit
5c7aa5f2
authored
Nov 12, 2011
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feedback plugin:
fix for mem_total on windows report the time of the data snapshot
parent
04f3ecf6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
plugin/feedback/utils.cc
plugin/feedback/utils.cc
+9
-8
No files found.
plugin/feedback/utils.cc
View file @
5c7aa5f2
...
@@ -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
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment