~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_gearman/logging_gearman.cc

  • Committer: Mark Atwood
  • Date: 2011-08-11 03:05:03 UTC
  • mfrom: (2385.1.12 refactor4)
  • Revision ID: me@mark.atwood.name-20110811030503-rp9xjihc5x3y0x4q
mergeĀ lp:~olafvdspek/drizzle/refactor4

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include "config.h"
 
20
#include <config.h>
21
21
 
22
22
#include <boost/scoped_array.hpp>
23
23
 
 
24
#include <drizzled/plugin.h>
24
25
#include <drizzled/plugin/logging.h>
25
26
#include <drizzled/gettext.h>
26
27
#include <drizzled/session.h>
 
28
#include <drizzled/session/times.h>
 
29
#include <drizzled/sql_parse.h>
27
30
#include <drizzled/errmsg_print.h>
28
31
#include <boost/date_time.hpp>
29
32
#include <boost/program_options.hpp>
37
40
#include <cerrno>
38
41
#include <memory>
39
42
 
40
 
 
41
 
namespace drizzle_plugin
42
 
{
 
43
namespace drizzle_plugin {
43
44
 
44
45
namespace po= boost::program_options;
45
46
 
228
229
      inside itself, so be more accurate, and so this doesnt have to
229
230
      keep calling current_utime, which can be slow.
230
231
    */
231
 
    uint64_t t_mark= session->getCurrentTimestamp(false);
 
232
    uint64_t t_mark= session->times.getCurrentTimestamp(false);
232
233
  
233
234
 
234
235
    // buffer to quotify the query
235
236
    unsigned char qs[255];
236
237
  
237
238
    // to avoid trying to printf %s something that is potentially NULL
238
 
    drizzled::util::string::const_shared_ptr dbs(session->schema());
 
239
    drizzled::util::string::ptr dbs(session->schema());
239
240
  
240
241
    msgbuf_len=
241
242
      snprintf(msgbuf.get(), MAX_MSG_LEN,
254
255
               (int)drizzled::getCommandName(session->command).size(),
255
256
               drizzled::getCommandName(session->command).c_str(),
256
257
               // counters are at end, to make it easier to add more
257
 
               (t_mark - session->getConnectMicroseconds()),
258
 
               (session->getElapsedTime()),
259
 
               (t_mark - session->utime_after_lock),
 
258
               (t_mark - session->times.getConnectMicroseconds()),
 
259
               (session->times.getElapsedTime()),
 
260
               (t_mark - session->times.utime_after_lock),
260
261
               session->sent_row_count,
261
262
               session->examined_row_count,
262
263
               session->tmp_table,
263
264
               session->total_warn_count,
264
265
               session->getServerId(),
265
 
               drizzled::glob_hostname
 
266
               drizzled::getServerHostname().c_str()
266
267
               );
267
268
  
268
269
    char job_handle[GEARMAN_JOB_HANDLE_SIZE];