52
52
plugin::TableFunction::Generator(arg)
56
LOCK_thread_count.lock();
57
it= getSessionList().begin();
60
57
ProcesslistTool::Generator::~Generator()
62
LOCK_thread_count.unlock();
65
61
bool ProcesslistTool::Generator::populate()
70
while (it != getSessionList().end())
72
if ((*it)->isViewable())
79
if (it == getSessionList().end())
83
const SecurityContext *tmp_sctx= &tmp->getSecurityContext();
87
push((int64_t) tmp->thread_id);
91
if (not tmp_sctx->getUser().empty())
92
push(tmp_sctx->getUser());
97
push(tmp_sctx->getIp());
100
if (! tmp->db.empty())
110
if ((val= const_cast<char *>(tmp->killed == Session::KILL_CONNECTION ? "Killed" : 0)))
116
push(command_name[tmp->command].str, command_name[tmp->command].length);
120
push(static_cast<uint64_t>(tmp->start_time ? now - tmp->start_time : 0));
123
val= (char*) (tmp->client->isWriting() ?
125
tmp->client->isReading() ?
126
(tmp->command == COM_SLEEP ?
127
NULL : "Reading from net") :
128
tmp->get_proc_info() ? tmp->get_proc_info() :
129
tmp->getThreadVar() &&
130
tmp->getThreadVar()->current_cond ?
131
"Waiting on cond" : NULL);
132
val ? push(val) : push();
135
size_t length= strlen(tmp->process_list_info);
136
length ? push(tmp->process_list_info, length) : push();
63
drizzled::SessionPtr tmp;
65
while ((tmp= session_generator))
67
const SecurityContext *tmp_sctx= &tmp->getSecurityContext();
71
push((int64_t) tmp->thread_id);
75
if (not tmp_sctx->getUser().empty())
76
push(tmp_sctx->getUser());
81
push(tmp_sctx->getIp());
84
if (! tmp->db.empty())
94
if ((val= const_cast<char *>(tmp->killed == Session::KILL_CONNECTION ? "Killed" : 0)))
100
push(command_name[tmp->command].str, command_name[tmp->command].length);
104
push(static_cast<uint64_t>(tmp->start_time ? now - tmp->start_time : 0));
107
val= (char*) (tmp->client->isWriting() ?
109
tmp->client->isReading() ?
110
(tmp->command == COM_SLEEP ?
111
NULL : "Reading from net") :
112
tmp->get_proc_info() ? tmp->get_proc_info() :
113
tmp->getThreadVar() &&
114
tmp->getThreadVar()->current_cond ?
115
"Waiting on cond" : NULL);
116
val ? push(val) : push();
119
size_t length= strlen(tmp->process_list_info);
120
length ? push(tmp->process_list_info, length) : push();