status: Expose migration_seconds_left
This commit is contained in:
@@ -33,6 +33,8 @@ struct status * status_create( struct server * serve )
|
||||
status->migration_duration /= 1000;
|
||||
status->migration_speed = serve->mirror->all_dirty / ( status->migration_duration + 1 );
|
||||
status->migration_speed_limit = serve->mirror->max_bytes_per_second;
|
||||
|
||||
status->migration_seconds_left = server_mirror_eta( serve );
|
||||
}
|
||||
|
||||
server_unlock_start_mirror( serve );
|
||||
@@ -64,6 +66,7 @@ int status_write( struct status * status, int fd )
|
||||
PRINT_UINT64( pass_clean_bytes );
|
||||
PRINT_UINT64( migration_speed );
|
||||
PRINT_UINT64( migration_duration );
|
||||
PRINT_UINT64( migration_seconds_left );
|
||||
if ( status->migration_speed_limit < UINT64_MAX ) {
|
||||
PRINT_UINT64( migration_speed_limit );
|
||||
};
|
||||
|
@@ -46,6 +46,7 @@
|
||||
* If the server is currently in "listen" mode, this will never be
|
||||
* true.
|
||||
*
|
||||
*
|
||||
* If is_migrating is true, then a number of other attributes may appear,
|
||||
* relating to the progress of the migration.
|
||||
*
|
||||
@@ -69,6 +70,10 @@
|
||||
* to send to the destination. Once all the bytes are clean, the migration is
|
||||
* done.
|
||||
*
|
||||
* migration_seconds_left:
|
||||
* Our current best estimate of how many seconds are left before the migration
|
||||
* migration is finished.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -91,6 +96,7 @@ struct status {
|
||||
uint64_t migration_duration;
|
||||
uint64_t migration_speed;
|
||||
uint64_t migration_speed_limit;
|
||||
uint64_t migration_seconds_left;
|
||||
};
|
||||
|
||||
/** Create a status object for the given server. */
|
||||
|
Reference in New Issue
Block a user