Skip to content

Commit

Permalink
Add settings stat for shutdown_command enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
LINKIWI authored and dormando committed Jul 25, 2021
1 parent 32d9072 commit 1e57dc4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/protocol.txt
Expand Up @@ -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). |
Expand Down
2 changes: 2 additions & 0 deletions memcached.c
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion 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;
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 1e57dc4

Please sign in to comment.