Merge lp:~skinny.moey/drizzle/bug760367 into lp:~drizzle-trunk/drizzle/development

Proposed by Joe Daly
Status: Merged
Approved by: Brian Aker
Approved revision: 2277
Merged at revision: 2280
Proposed branch: lp:~skinny.moey/drizzle/bug760367
Merge into: lp:~drizzle-trunk/drizzle/development
Diff against target: 42 lines (+9/-1)
3 files modified
drizzled/session/times.cc (+5/-0)
drizzled/session/times.h (+1/-0)
plugin/logging_stats/logging_stats.cc (+3/-1)
To merge this branch: bzr merge lp:~skinny.moey/drizzle/bug760367
Reviewer Review Type Date Requested Status
Drizzle Merge Team Pending
Review via email: mp+57798@code.launchpad.net

Description of the change

fix bug 760367, this variable is used for summing total connection time to the server for a user, not when a user connected to the server

To post a comment you must log in.
Revision history for this message
Joe Daly (skinny.moey) wrote :

merged trunk

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'drizzled/session/times.cc'
2--- drizzled/session/times.cc 2011-04-08 14:05:22 +0000
3+++ drizzled/session/times.cc 2011-04-15 01:23:30 +0000
4@@ -60,6 +60,11 @@
5 return _start_timer;
6 }
7
8+boost::posix_time::ptime Times::epoch() const
9+{
10+ return _epoch;
11+}
12+
13 void Times::set_time()
14 {
15 _end_timer= _start_timer= boost::posix_time::microsec_clock::universal_time();
16
17=== modified file 'drizzled/session/times.h'
18--- drizzled/session/times.h 2011-04-08 14:05:22 +0000
19+++ drizzled/session/times.h 2011-04-15 01:23:30 +0000
20@@ -46,6 +46,7 @@
21 type::Time::epoch_t getCurrentTimestampEpoch(type::Time::usec_t& fraction_arg) const;
22 type::Time::epoch_t query_start();
23 boost::posix_time::ptime start_timer() const;
24+ boost::posix_time::ptime epoch() const;
25
26 boost::posix_time::ptime _epoch;
27 boost::posix_time::ptime _connect_time;
28
29=== modified file 'plugin/logging_stats/logging_stats.cc'
30--- plugin/logging_stats/logging_stats.cc 2011-04-08 14:05:22 +0000
31+++ plugin/logging_stats/logging_stats.cc 2011-04-15 01:23:30 +0000
32@@ -218,7 +218,9 @@
33 }
34
35 scoreboard_slot->getStatusVars()->logStatusVar(session);
36- scoreboard_slot->getStatusVars()->getStatusVarCounters()->connection_time= session->times.getConnectSeconds();
37+ boost::posix_time::ptime end(boost::posix_time::microsec_clock::universal_time());
38+ uint64_t end_time= (end - session->times.epoch()).total_seconds();
39+ scoreboard_slot->getStatusVars()->getStatusVarCounters()->connection_time= end_time - session->times.getConnectSeconds();
40
41 cumulative_stats->logUserStats(scoreboard_slot, isInScoreboard);
42 cumulative_stats->logGlobalStats(scoreboard_slot);