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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3db7cdd5
Commit
3db7cdd5
authored
Apr 10, 2007
by
jani@ua141d10.elisa.omakaista.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch for displaying questions per second average correctly.
parent
1e38c22e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
sql/sql_parse.cc
sql/sql_parse.cc
+9
-4
No files found.
sql/sql_parse.cc
View file @
3db7cdd5
...
...
@@ -1140,6 +1140,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
STATUS_VAR
current_global_status_var
;
ulong
uptime
;
uint
length
;
ulonglong
queries_per_second1000
;
#ifndef EMBEDDED_LIBRARY
char
buff
[
250
];
uint
buff_len
=
sizeof
(
buff
);
...
...
@@ -1152,19 +1153,23 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
statistic_increment
(
thd
->
status_var
.
com_stat
[
SQLCOM_SHOW_STATUS
],
&
LOCK_status
);
calc_sum_of_all_status
(
&
current_global_status_var
);
uptime
=
(
ulong
)
(
thd
->
start_time
-
server_start_time
);
if
(
!
(
uptime
=
(
ulong
)
(
thd
->
start_time
-
server_start_time
)))
queries_per_second1000
=
0
;
else
queries_per_second1000
=
thd
->
query_id
*
LL
(
1000
)
/
uptime
;
length
=
my_snprintf
((
char
*
)
buff
,
buff_len
-
1
,
"Uptime: %lu Threads: %d Questions: %lu "
"Slow queries: %lu Opens: %lu Flush tables: %lu "
"Open tables: %u Queries per second avg: %
.3f
"
,
"Open tables: %u Queries per second avg: %
u.%u
"
,
uptime
,
(
int
)
thread_count
,
(
ulong
)
thd
->
query_id
,
current_global_status_var
.
long_query_count
,
current_global_status_var
.
opened_tables
,
refresh_version
,
cached_open_tables
(),
(
u
ptime
?
(
ulonglong2double
(
thd
->
query_id
)
/
(
double
)
uptime
)
:
(
double
)
0
));
(
u
int
)
(
queries_per_second1000
/
1000
),
(
uint
)
(
queries_per_second1000
%
100
0
));
#ifdef SAFEMALLOC
if
(
sf_malloc_cur_memory
)
// Using SAFEMALLOC
{
...
...
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