~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/logging.cc

  • Committer: Andrew Hutchings
  • Date: 2010-11-09 13:38:01 UTC
  • mto: (1919.1.2 trunk)
  • mto: This revision was merged to the branch mainline in revision 1920.
  • Revision ID: andrew@linuxjedi.co.uk-20101109133801-byjzsao76346395x
Add FLUSH GLOBAL STATUS; command
Clears the global status variables for the server

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
  }
122
122
};
123
123
 
 
124
class ResetIterate : public unary_function<plugin::Logging *, bool>
 
125
{
 
126
  Session *session;
 
127
public:
 
128
  ResetIterate(Session *session_arg) :
 
129
    unary_function<plugin::Logging *, bool>(),
 
130
    session(session_arg) {}
 
131
 
 
132
  inline result_type operator()(argument_type handler)
 
133
  {
 
134
    if (handler->resetGlobalScoreboard())
 
135
    {
 
136
      /* TRANSLATORS: The leading word "logging" is the name
 
137
         of the plugin api, and so should not be translated. */
 
138
      errmsg_printf(ERRMSG_LVL_ERROR,
 
139
                    _("logging '%s' resetCurrentScoreboard() failed"),
 
140
                    handler->getName().c_str());
 
141
      return true;
 
142
    }
 
143
    return false;
 
144
  }
 
145
};
 
146
 
 
147
 
124
148
/* This is the Logging::preDo entry point.
125
149
   This gets called by the rest of the Drizzle server code */
126
150
bool plugin::Logging::preDo(Session *session)
165
189
  return iter != all_loggers.end();
166
190
}
167
191
 
 
192
/* Resets global stats for logging plugin */
 
193
bool plugin::Logging::resetStats(Session *session)
 
194
{
 
195
  vector<plugin::Logging *>::iterator iter=
 
196
    find_if(all_loggers.begin(), all_loggers.end(),
 
197
            ResetIterate(session));
 
198
 
 
199
  return iter != all_loggers.end();
 
200
}
 
201
 
168
202
} /* namespace drizzled */