Module: check_mk
Branch: master
Commit: 94311c6add1153a27158f338cc7084886b330d89
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=94311c6add1153…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Mon May 8 11:36:54 2017 +0200
Unify naming in NEB and CMC a bit more.
Change-Id: I18b11bc9d5380d65be827ee4262e0413c99b473e
---
livestatus/src/TableStatus.cc | 8 ++++----
livestatus/src/module.cc | 24 ++++++++++++------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/livestatus/src/TableStatus.cc b/livestatus/src/TableStatus.cc
index 17b55d8..d3a3873 100644
--- a/livestatus/src/TableStatus.cc
+++ b/livestatus/src/TableStatus.cc
@@ -64,9 +64,9 @@ extern int num_cached_log_messages;
extern int interval_length;
extern int g_num_hosts;
extern int g_num_services;
-extern int g_num_clientthreads;
+extern int g_livestatus_threads;
extern int g_num_queued_connections;
-extern int g_num_active_connections;
+extern int g_livestatus_active_connections;
#ifndef NAGIOS4
extern circular_buffer external_command_buffer;
@@ -224,7 +224,7 @@ TableStatus::TableStatus(MonitoringCore *mc) : Table(mc) {
addColumn(make_unique<IntPointerColumn>(
"livestatus_active_connections",
"The current number of active connections to MK Livestatus",
- &g_num_active_connections));
+ &g_livestatus_active_connections));
addColumn(make_unique<IntPointerColumn>(
"livestatus_queued_connections",
"The current number of queued connections to MK Livestatus (that wait for a
free thread)",
@@ -232,7 +232,7 @@ TableStatus::TableStatus(MonitoringCore *mc) : Table(mc) {
addColumn(make_unique<IntPointerColumn>(
"livestatus_threads",
"The maximum number of connections to MK Livestatus that can be handled in
parallel",
- &g_num_clientthreads));
+ &g_livestatus_threads));
// Special stuff for Check_MK
addColumn(make_unique<StatusSpecialIntColumn>(
diff --git a/livestatus/src/module.cc b/livestatus/src/module.cc
index dd55075..63715cc 100644
--- a/livestatus/src/module.cc
+++ b/livestatus/src/module.cc
@@ -91,12 +91,12 @@ static milliseconds fl_idle_timeout = minutes(5);
// maximum time for reading a query
static milliseconds fl_query_timeout = seconds(10);
-size_t g_num_clientthreads =
- 10; /* allow 10 concurrent connections per default */
-int g_num_queued_connections =
- 0; /* current number of queued connections (for statistics) */
-int g_num_active_connections =
- 0; /* current number of active connections (for statistics) */
+// allow 10 concurrent connections per default
+size_t g_livestatus_threads = 10;
+// current number of queued connections (for statistics)
+int g_num_queued_connections = 0;
+// current number of active connections (for statistics)
+int g_livestatus_active_connections = 0;
size_t g_thread_stack_size = 1024 * 1024; /* stack size of threads */
extern int g_disable_statehist_filtering;
@@ -229,7 +229,7 @@ void *client_thread(void *data) {
while (!fl_should_terminate) {
int cc = fl_client_queue->popConnection();
g_num_queued_connections--;
- g_num_active_connections++;
+ g_livestatus_active_connections++;
if (cc >= 0) {
Debug(fl_logger_livestatus) << "accepted client connection on fd
"
<< cc;
@@ -252,7 +252,7 @@ void *client_thread(void *data) {
}
close(cc);
}
- g_num_active_connections--;
+ g_livestatus_active_connections--;
}
return voidp;
}
@@ -309,7 +309,7 @@ void start_threads() {
}
Informational(fl_logger_nagios) << "starting main thread and "
- << g_num_clientthreads
+ << g_livestatus_threads
<< " client threads";
pthread_atfork(livestatus_count_fork, nullptr,
@@ -329,7 +329,7 @@ void start_threads() {
<< g_thread_stack_size;
}
- fl_thread_info.resize(g_num_clientthreads + 1);
+ fl_thread_info.resize(g_livestatus_threads + 1);
for (auto &info : fl_thread_info) {
ptrdiff_t idx = &info - &fl_thread_info[0];
if (idx == 0) {
@@ -362,7 +362,7 @@ void terminate_threads() {
}
}
Informational(fl_logger_nagios) << "main thread + "
- << g_num_clientthreads
+ << g_livestatus_threads
<< " client threads have
finished";
g_thread_running = 0;
fl_should_terminate = false;
@@ -937,7 +937,7 @@ void livestatus_parse_arguments(const char *args_orig) {
} else {
Notice(fl_logger_nagios)
<< "setting number of client threads to "
<< c;
- g_num_clientthreads = c;
+ g_livestatus_threads = c;
}
} else if (strcmp(left, "query_timeout") == 0) {
int c = atoi(right);