~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/logging_stats/status_vars.cc

  • Committer: Joe Daly
  • Date: 2010-06-26 02:14:49 UTC
  • mto: This revision was merged to the branch mainline in revision 1656.
  • Revision ID: skinny.moey@gmail.com-20100626021449-aiirxjmxazj0s0va
add counter logic for rows sent/received/inserted/updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
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;
43
44
}
44
45
 
45
46
StatusVars::StatusVars(const StatusVars &status_vars)
47
48
  status_var_counters= (system_status_var*) malloc(sizeof(system_status_var));
48
49
  memset(status_var_counters, 0, sizeof(system_status_var));
49
50
  copySystemStatusVar(status_var_counters, status_vars.status_var_counters); 
 
51
  sent_row_count= 0;
50
52
}
51
53
 
52
54
StatusVars::~StatusVars()
84
86
  {
85
87
    *(to++)+= *(from++);
86
88
  }
 
89
 
 
90
  sent_row_count+= status_vars->sent_row_count;
87
91
}
88
92
 
89
93
void StatusVars::reset()
90
94
{
91
95
  memset(status_var_counters, 0, sizeof(system_status_var));
 
96
  sent_row_count= 0;
92
97
}
93
98
 
94
99
void StatusVars::logStatusVar(Session *session)
95
100
{
96
101
  copySystemStatusVar(status_var_counters, &session->status_var);
 
102
  sent_row_count+= session->sent_row_count;
97
103
}
98
104
 
99
105
bool StatusVars::hasBeenFlushed(Session *session)