summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Lin <developer@kevinlin.info>2021-06-26 22:30:43 -0700
committerdormando <dormando@rydia.net>2021-07-25 14:41:54 -0700
commit1e57dc4716e1c0ce277024901c79d6dd64c74c9d (patch)
tree7008e25b0d75b34c96dc4355b6fe4a562eca19f1
parent32d90726490044ea421c6df3819f85b2072c00b7 (diff)
downloadmemcached-1e57dc4716e1c0ce277024901c79d6dd64c74c9d.tar.gz
Add settings stat for shutdown_command enabled
-rw-r--r--doc/protocol.txt1
-rw-r--r--memcached.c2
-rwxr-xr-xt/stats.t3
3 files changed, 5 insertions, 1 deletions
diff --git a/doc/protocol.txt b/doc/protocol.txt
index e8da557..b4771e9 100644
--- a/doc/protocol.txt
+++ b/doc/protocol.txt
@@ -1367,6 +1367,7 @@ other stats command.
| evictions | on/off | When off, LRU evictions are disabled. |
| domain_socket | string | Path to the domain socket (if any). |
| umask | 32 (oct) | umask for the creation of the domain socket. |
+| shutdown_command | yes/no | If shutdown admin command is enabled. |
| growth_factor | float | Chunk size growth factor. |
| chunk_size | 32 | Minimum space allocated for key+value+flags. |
| num_threads | 32 | Number of threads (including dispatch). |
diff --git a/memcached.c b/memcached.c
index ce9f8e6..b1d5144 100644
--- a/memcached.c
+++ b/memcached.c
@@ -1819,6 +1819,8 @@ void process_stat_settings(ADD_STAT add_stats, void *c) {
APPEND_STAT("domain_socket", "%s",
settings.socketpath ? settings.socketpath : "NULL");
APPEND_STAT("umask", "%o", settings.access);
+ APPEND_STAT("shutdown_command", "%s",
+ settings.shutdown_command ? "yes" : "no");
APPEND_STAT("growth_factor", "%.2f", settings.factor);
APPEND_STAT("chunk_size", "%d", settings.chunk_size);
APPEND_STAT("num_threads", "%d", settings.num_threads);
diff --git a/t/stats.t b/t/stats.t
index 7c82bca..65780fb 100755
--- a/t/stats.t
+++ b/t/stats.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
-use Test::More tests => 108;
+use Test::More tests => 109;
use FindBin qw($Bin);
use lib "$Bin/lib";
use MemcachedTest;
@@ -147,6 +147,7 @@ if (enabled_tls_testing() || !supports_unix_socket()) {
is('on', $settings->{'evictions'});
is('yes', $settings->{'cas_enabled'});
is('no', $settings->{'auth_enabled_sasl'});
+is('no', $settings->{'shutdown_command'});
print $sock "stats reset\r\n";
is(scalar <$sock>, "RESET\r\n", "good stats reset");