mirror of https://gitee.com/bigwinds/arangodb
added queue name in log
This commit is contained in:
parent
292b78002d
commit
47db93a546
|
@ -120,7 +120,7 @@ bool Dispatcher::isRunning () {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void Dispatcher::addQueue (string const& name, size_t nrThreads) {
|
void Dispatcher::addQueue (string const& name, size_t nrThreads) {
|
||||||
_queues[name] = new DispatcherQueue(this, defaultDispatcherThread, nrThreads);
|
_queues[name] = new DispatcherQueue(this, name, defaultDispatcherThread, nrThreads);
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -128,7 +128,7 @@ void Dispatcher::addQueue (string const& name, size_t nrThreads) {
|
||||||
/////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void Dispatcher::addQueue (string const& name, newDispatcherThread_fptr func, size_t nrThreads) {
|
void Dispatcher::addQueue (string const& name, newDispatcherThread_fptr func, size_t nrThreads) {
|
||||||
_queues[name] = new DispatcherQueue(this, func, nrThreads);
|
_queues[name] = new DispatcherQueue(this, name, func, nrThreads);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -41,9 +41,11 @@ namespace triagens {
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
DispatcherQueue::DispatcherQueue (Dispatcher* dispatcher,
|
DispatcherQueue::DispatcherQueue (Dispatcher* dispatcher,
|
||||||
|
string const& name,
|
||||||
Dispatcher::newDispatcherThread_fptr creator,
|
Dispatcher::newDispatcherThread_fptr creator,
|
||||||
size_t nrThreads)
|
size_t nrThreads)
|
||||||
: stopping(0),
|
: _name(name),
|
||||||
|
stopping(0),
|
||||||
monopolizer(0),
|
monopolizer(0),
|
||||||
nrStarted(0),
|
nrStarted(0),
|
||||||
nrRunning(0),
|
nrRunning(0),
|
||||||
|
@ -86,7 +88,7 @@ namespace triagens {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER_DEBUG << "beginning shutdown sequence of dispatcher queue";
|
LOGGER_DEBUG << "beginning shutdown sequence of dispatcher queue '" << _name <<"'";
|
||||||
|
|
||||||
// broadcast the we want to stop
|
// broadcast the we want to stop
|
||||||
size_t const MAX_TRIES = 10;
|
size_t const MAX_TRIES = 10;
|
||||||
|
@ -97,7 +99,7 @@ namespace triagens {
|
||||||
{
|
{
|
||||||
CONDITION_LOCKER(guard, accessQueue);
|
CONDITION_LOCKER(guard, accessQueue);
|
||||||
|
|
||||||
LOGGER_TRACE << "shutting down dispatcher queue, "
|
LOGGER_TRACE << "shutting down dispatcher queue '" << _name << "', "
|
||||||
<< nrRunning << " running threads, "
|
<< nrRunning << " running threads, "
|
||||||
<< nrWaiting << " waiting threads, "
|
<< nrWaiting << " waiting threads, "
|
||||||
<< nrSpecial << " special threads";
|
<< nrSpecial << " special threads";
|
||||||
|
@ -112,7 +114,7 @@ namespace triagens {
|
||||||
usleep(10000);
|
usleep(10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOGGER_DEBUG << "shutting down dispatcher queue, "
|
LOGGER_DEBUG << "shutting down dispatcher queue '" << _name << "', "
|
||||||
<< nrRunning << " running threads, "
|
<< nrRunning << " running threads, "
|
||||||
<< nrWaiting << " waiting threads, "
|
<< nrWaiting << " waiting threads, "
|
||||||
<< nrSpecial << " special threads";
|
<< nrSpecial << " special threads";
|
||||||
|
|
|
@ -52,6 +52,7 @@ namespace triagens {
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
DispatcherQueue (Dispatcher* dispatcher,
|
DispatcherQueue (Dispatcher* dispatcher,
|
||||||
|
std::string const& name,
|
||||||
Dispatcher::newDispatcherThread_fptr,
|
Dispatcher::newDispatcherThread_fptr,
|
||||||
size_t nrThreads);
|
size_t nrThreads);
|
||||||
|
|
||||||
|
@ -180,6 +181,7 @@ namespace triagens {
|
||||||
Dispatcher* dispatcher;
|
Dispatcher* dispatcher;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
string const _name;
|
||||||
Dispatcher::newDispatcherThread_fptr createDispatcherThread;
|
Dispatcher::newDispatcherThread_fptr createDispatcherThread;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue