status: Remove useless stats

This commit is contained in:
nick
2013-09-23 14:19:49 +01:00
parent ca9aea0d13
commit 847b2ec9ad
3 changed files with 2 additions and 78 deletions

View File

@@ -19,10 +19,6 @@ struct status * status_create( struct server * serve )
status->is_mirroring = NULL != serve->mirror; status->is_mirroring = NULL != serve->mirror;
if ( status->is_mirroring ) { if ( status->is_mirroring ) {
status->migration_pass = serve->mirror->pass;
status->pass_dirty_bytes = serve->mirror->this_pass_dirty;
status->pass_clean_bytes = serve->mirror->this_pass_clean;
status->migration_duration = monotonic_time_ms(); status->migration_duration = monotonic_time_ms();
if ( ( serve->mirror->migration_started ) < status->migration_duration ) { if ( ( serve->mirror->migration_started ) < status->migration_duration ) {
@@ -61,9 +57,6 @@ int status_write( struct status * status, int fd )
PRINT_BOOL( has_control ); PRINT_BOOL( has_control );
if ( status->is_mirroring ) { if ( status->is_mirroring ) {
PRINT_INT( migration_pass );
PRINT_UINT64( pass_dirty_bytes );
PRINT_UINT64( pass_clean_bytes );
PRINT_UINT64( migration_speed ); PRINT_UINT64( migration_speed );
PRINT_UINT64( migration_duration ); PRINT_UINT64( migration_duration );
PRINT_UINT64( migration_seconds_left ); PRINT_UINT64( migration_seconds_left );

View File

@@ -57,18 +57,8 @@
* Network transfer speed, in bytes/second. This only takes dirty bytes * Network transfer speed, in bytes/second. This only takes dirty bytes
* into account. * into account.
* *
* migration_pass: * migration_speed_limit:
* When migrating, we perform a number of passes over the file. This indicates * If set, the speed we're going to try to limit the migration to.
* the current pass.
*
* pass_dirty_bytes:
* For the current pass, how many dirty bytes have we found so far? These are
* classed as bytes that we are required to send to the destination.
*
* pass_clean_bytes:
* For the current pass, how many clean bytes? These are bytes we don't need
* to send to the destination. Once all the bytes are clean, the migration is
* done.
* *
* migration_seconds_left: * migration_seconds_left:
* Our current best estimate of how many seconds are left before the migration * Our current best estimate of how many seconds are left before the migration
@@ -89,9 +79,6 @@ struct status {
int clients_allowed; int clients_allowed;
int num_clients; int num_clients;
int is_mirroring; int is_mirroring;
int migration_pass;
uint64_t pass_dirty_bytes;
uint64_t pass_clean_bytes;
uint64_t migration_duration; uint64_t migration_duration;
uint64_t migration_speed; uint64_t migration_speed;

View File

@@ -124,26 +124,6 @@ START_TEST( test_gets_num_clients )
} }
END_TEST END_TEST
START_TEST( test_gets_migration_pass )
{
struct server * server = mock_server();
struct status * status = status_create( server );
fail_if( status->migration_pass != 0, "migration_pass was set" );
status_destroy( status );
destroy_mock_server( server );
server = mock_mirroring_server();
server->mirror->pass = 1;
status = status_create( server );
fail_unless( status->migration_pass == 1, "migration_pass wasn't set" );
status_destroy( status );
destroy_mock_server( server );
}
END_TEST
START_TEST( test_gets_pid ) START_TEST( test_gets_pid )
{ {
struct server * server = mock_server(); struct server * server = mock_server();
@@ -173,8 +153,6 @@ END_TEST
START_TEST( test_gets_migration_statistics ) START_TEST( test_gets_migration_statistics )
{ {
struct server * server = mock_mirroring_server(); struct server * server = mock_mirroring_server();
server->mirror->this_pass_clean = 2048;
server->mirror->this_pass_dirty = 4096;
server->mirror->all_dirty = 16384; server->mirror->all_dirty = 16384;
server->mirror->max_bytes_per_second = 32768; server->mirror->max_bytes_per_second = 32768;
server->mirror->offset = 0; server->mirror->offset = 0;
@@ -184,9 +162,6 @@ START_TEST( test_gets_migration_statistics )
struct status * status = status_create( server ); struct status * status = status_create( server );
fail_unless( 2048 == status->pass_clean_bytes, "pass_clean_bytes wasn't gathered" );
fail_unless( 4096 == status->pass_dirty_bytes, "pass_dirty_bytes wasn't gathered" );
fail_unless ( fail_unless (
0 == status->migration_duration || 0 == status->migration_duration ||
1 == status->migration_duration || 1 == status->migration_duration ||
@@ -324,39 +299,16 @@ START_TEST( test_renders_size )
} }
END_TEST END_TEST
START_TEST( test_renders_migration_pass )
{
RENDER_TEST_SETUP
status.is_mirroring = 0;
status.migration_pass = 1;
status_write( &status, fds[1] );
fail_if_rendered( fds[0], "migration_pass" );
status.is_mirroring = 1;
status_write( &status, fds[1] );
fail_unless_rendered( fds[0], "migration_pass=1" );
}
END_TEST
START_TEST( test_renders_migration_statistics ) START_TEST( test_renders_migration_statistics )
{ {
RENDER_TEST_SETUP RENDER_TEST_SETUP
status.is_mirroring = 0; status.is_mirroring = 0;
status.pass_dirty_bytes = 2048;
status.pass_clean_bytes = 4096;
status.migration_duration = 8; status.migration_duration = 8;
status.migration_speed = 40000000; status.migration_speed = 40000000;
status.migration_speed_limit = 40000001; status.migration_speed_limit = 40000001;
status.migration_seconds_left = 1; status.migration_seconds_left = 1;
status_write( &status, fds[1] );
fail_if_rendered( fds[0], "pass_dirty_bytes" );
status_write( &status, fds[1] );
fail_if_rendered( fds[0], "pass_clean_bytes" );
status_write( &status, fds[1] ); status_write( &status, fds[1] );
fail_if_rendered( fds[0], "migration_duration" ); fail_if_rendered( fds[0], "migration_duration" );
@@ -371,12 +323,6 @@ START_TEST( test_renders_migration_statistics )
status.is_mirroring = 1; status.is_mirroring = 1;
status_write( &status, fds[1] );
fail_unless_rendered( fds[0], "pass_dirty_bytes=2048" );
status_write( &status, fds[1] );
fail_unless_rendered( fds[0], "pass_clean_bytes=4096" );
status_write( &status, fds[1] ); status_write( &status, fds[1] );
fail_unless_rendered( fds[0], "migration_duration=8" ); fail_unless_rendered( fds[0], "migration_duration=8" );
@@ -410,7 +356,6 @@ Suite *status_suite(void)
tcase_add_test(tc_create, test_gets_num_clients); tcase_add_test(tc_create, test_gets_num_clients);
tcase_add_test(tc_create, test_gets_pid); tcase_add_test(tc_create, test_gets_pid);
tcase_add_test(tc_create, test_gets_size); tcase_add_test(tc_create, test_gets_size);
tcase_add_test(tc_create, test_gets_migration_pass);
tcase_add_test(tc_create, test_gets_migration_statistics); tcase_add_test(tc_create, test_gets_migration_statistics);
@@ -420,7 +365,6 @@ Suite *status_suite(void)
tcase_add_test(tc_render, test_renders_num_clients); tcase_add_test(tc_render, test_renders_num_clients);
tcase_add_test(tc_render, test_renders_pid); tcase_add_test(tc_render, test_renders_pid);
tcase_add_test(tc_render, test_renders_size); tcase_add_test(tc_render, test_renders_size);
tcase_add_test(tc_render, test_renders_migration_pass);
tcase_add_test(tc_render, test_renders_migration_statistics); tcase_add_test(tc_render, test_renders_migration_statistics);
suite_add_tcase(s, tc_create); suite_add_tcase(s, tc_create);