status: Display number of currently connected clients, and whether new clients are allowed

These will be useful for migration status monitoring - replaces "is pass == 7?"
This commit is contained in:
nick
2013-09-23 13:38:19 +01:00
parent a6c175ed1d
commit 0f2225becf
3 changed files with 161 additions and 102 deletions

View File

@@ -12,6 +12,9 @@ struct status * status_create( struct server * serve )
status->size = serve->size;
status->has_control = serve->success;
status->clients_allowed = serve->allow_new_clients;
status->num_clients = server_count_clients( serve );
server_lock_start_mirror( serve );
status->is_mirroring = NULL != serve->mirror;
@@ -51,6 +54,8 @@ int status_write( struct status * status, int fd )
PRINT_INT( pid );
PRINT_UINT64( size );
PRINT_BOOL( is_mirroring );
PRINT_BOOL( clients_allowed );
PRINT_INT( num_clients );
PRINT_BOOL( has_control );
if ( status->is_mirroring ) {