~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_stats/status_vars.cc

  • Committer: Mark Atwood
  • Date: 2010-06-24 03:15:21 UTC
  • mto: (1637.2.4 build)
  • mto: This revision was merged to the branch mainline in revision 1639.
  • Revision ID: me@mark.atwood.name-20100624031521-gafmppfbf5afm68w
new syslog module, with plugins for query log, error message, and SYSLOG() function

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2010 Joseph Daly <skinny.moey@gmail.com>
 
2
 * Copyright (c) 2010, Joseph Daly <skinny.moey@gmail.com>
3
3
 * All rights reserved.
4
4
 *
5
5
 * Redistribution and use in source and binary forms, with or without
27
27
 * THE POSSIBILITY OF SUCH DAMAGE.
28
28
 */
29
29
 
30
 
#include <config.h>
 
30
#include "config.h"
31
31
#include <drizzled/plugin.h>
32
32
#include <drizzled/statistics_variables.h>
33
33
#include <drizzled/session.h>
40
40
{
41
41
  status_var_counters= (system_status_var*) malloc(sizeof(system_status_var));
42
42
  memset(status_var_counters, 0, sizeof(system_status_var));
43
 
  sent_row_count= 0;
44
43
}
45
44
 
46
45
StatusVars::StatusVars(const StatusVars &status_vars)
48
47
  status_var_counters= (system_status_var*) malloc(sizeof(system_status_var));
49
48
  memset(status_var_counters, 0, sizeof(system_status_var));
50
49
  copySystemStatusVar(status_var_counters, status_vars.status_var_counters); 
51
 
  sent_row_count= 0;
52
50
}
53
51
 
54
52
StatusVars::~StatusVars()
86
84
  {
87
85
    *(to++)+= *(from++);
88
86
  }
89
 
 
90
 
  sent_row_count+= status_vars->sent_row_count;
91
87
}
92
88
 
93
89
void StatusVars::reset()
94
90
{
95
91
  memset(status_var_counters, 0, sizeof(system_status_var));
96
 
  sent_row_count= 0;
97
92
}
98
93
 
99
94
void StatusVars::logStatusVar(Session *session)
100
95
{
101
96
  copySystemStatusVar(status_var_counters, &session->status_var);
102
 
  sent_row_count+= session->sent_row_count;
103
97
}
104
98
 
105
99
bool StatusVars::hasBeenFlushed(Session *session)
118
112
    return false;
119
113
  }
120
114
}
121
 
 
122
 
void StatusVars::copyGlobalVariables(StatusVars *global_status_vars)
123
 
{
124
 
  system_status_var* from_var= global_status_vars->getStatusVarCounters();
125
 
  status_var_counters->aborted_connects= from_var->aborted_connects;  
126
 
  status_var_counters->aborted_threads= from_var->aborted_threads;
127
 
  status_var_counters->connection_time= from_var->connection_time;
128
 
}