Add prefix to Server member variables
Added the m_ prefix to Server member variables.
This commit is contained in:
parent
3ee5d9a8ea
commit
c95adf1f2e
@ -33,34 +33,33 @@ class Server : public SERVER
|
||||
public:
|
||||
|
||||
Server()
|
||||
: response_time(maxbase::EMAverage {0.04, 0.35, 500})
|
||||
: m_response_time(maxbase::EMAverage {0.04, 0.35, 500})
|
||||
{
|
||||
}
|
||||
|
||||
int response_time_num_samples() const
|
||||
{
|
||||
return response_time->num_samples();
|
||||
return m_response_time->num_samples();
|
||||
}
|
||||
|
||||
double response_time_average() const
|
||||
{
|
||||
return response_time->average();
|
||||
return m_response_time->average();
|
||||
}
|
||||
|
||||
void response_time_add(double ave, int num_samples)
|
||||
{
|
||||
response_time->add(ave, num_samples);
|
||||
m_response_time->add(ave, num_samples);
|
||||
}
|
||||
|
||||
// TODO: Do all access to Server via methods
|
||||
mutable std::mutex lock;
|
||||
mutable std::mutex m_lock;
|
||||
|
||||
private:
|
||||
// nantti, TODO. Decide whether to expose some of this in config, or if the values
|
||||
// can be calculated at runtime. The "500" or sample_max affects how often a
|
||||
// session should updates this stat. sample_max should be slightly lower than max sample
|
||||
// rate (which is less than qps due to the noise filter).
|
||||
mxs::rworker_local<maxbase::EMAverage> response_time;
|
||||
mxs::rworker_local<maxbase::EMAverage> m_response_time;
|
||||
};
|
||||
|
||||
void server_free(Server* server);
|
||||
|
@ -877,7 +877,7 @@ bool server_remove_parameter(SERVER* srv, const char* name)
|
||||
{
|
||||
Server* server = static_cast<Server*>(srv);
|
||||
bool rval = false;
|
||||
std::lock_guard<std::mutex> guard(server->lock);
|
||||
std::lock_guard<std::mutex> guard(server->m_lock);
|
||||
|
||||
for (SERVER_PARAM* p = server->parameters; p; p = p->next)
|
||||
{
|
||||
@ -899,7 +899,7 @@ void server_set_parameter(SERVER* srv, const char* name, const char* value)
|
||||
|
||||
if (param)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(server->lock);
|
||||
std::lock_guard<std::mutex> guard(server->m_lock);
|
||||
|
||||
// Insert new value
|
||||
param->next = server->parameters;
|
||||
@ -971,7 +971,7 @@ static size_t server_get_parameter_nolock(const SERVER* server, const char* name
|
||||
size_t server_get_parameter(const SERVER* srv, const char* name, char* out, size_t size)
|
||||
{
|
||||
const Server* server = static_cast<const Server*>(srv);
|
||||
std::lock_guard<std::mutex> guard(server->lock);
|
||||
std::lock_guard<std::mutex> guard(server->m_lock);
|
||||
return server_get_parameter_nolock(server, name, out, size);
|
||||
}
|
||||
|
||||
@ -1279,7 +1279,7 @@ bool mxs::server_set_status(SERVER* srv, int bit, string* errmsg_out)
|
||||
* but the race condition cannot cause significant harm. Monitors are never
|
||||
* freed so the pointer stays valid. */
|
||||
MXS_MONITOR* mon = monitor_server_in_use(server);
|
||||
std::lock_guard<std::mutex> guard(server->lock);
|
||||
std::lock_guard<std::mutex> guard(server->m_lock);
|
||||
|
||||
if (mon && mon->state == MONITOR_STATE_RUNNING)
|
||||
{
|
||||
@ -1328,7 +1328,7 @@ bool mxs::server_clear_status(SERVER* srv, int bit, string* errmsg_out)
|
||||
Server* server = static_cast<Server*>(srv);
|
||||
bool written = false;
|
||||
MXS_MONITOR* mon = monitor_server_in_use(server);
|
||||
std::lock_guard<std::mutex> guard(server->lock);
|
||||
std::lock_guard<std::mutex> guard(server->m_lock);
|
||||
|
||||
if (mon && mon->state == MONITOR_STATE_RUNNING)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user