Commit b58fa5cb authored by John Esmet's avatar John Esmet Committed by Yoni Fogel

refs #5710 add status counter for the total number of primary key bytes...

refs #5710 add status counter for the total number of primary key bytes inserted (key and value, no secondary indexes)


git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@50527 c7de825b-a66e-492c-adef-691d508d4ae1
parent 413641de
...@@ -3922,6 +3922,10 @@ int ha_tokudb::write_row(uchar * record) { ...@@ -3922,6 +3922,10 @@ int ha_tokudb::write_row(uchar * record) {
error = insert_rows_to_dictionaries_mult(&prim_key, &row, txn, thd); error = insert_rows_to_dictionaries_mult(&prim_key, &row, txn, thd);
if (error) { goto cleanup; } if (error) { goto cleanup; }
} }
if (error == 0) {
uint64_t full_row_size = prim_key.size + row.size;
toku_hton_update_primary_key_bytes_inserted(full_row_size);
}
} }
trx = (tokudb_trx_data *) thd_data_get(thd, tokudb_hton->slot); trx = (tokudb_trx_data *) thd_data_get(thd, tokudb_hton->slot);
......
...@@ -261,6 +261,11 @@ HASH tokudb_open_tables; ...@@ -261,6 +261,11 @@ HASH tokudb_open_tables;
pthread_mutex_t tokudb_mutex; pthread_mutex_t tokudb_mutex;
pthread_mutex_t tokudb_meta_mutex; pthread_mutex_t tokudb_meta_mutex;
static PARTITIONED_COUNTER tokudb_primary_key_bytes_inserted;
void toku_hton_update_primary_key_bytes_inserted(uint64_t row_size) {
increment_partitioned_counter(tokudb_primary_key_bytes_inserted, row_size);
}
static ulonglong tokudb_lock_timeout; static ulonglong tokudb_lock_timeout;
static ulong tokudb_cleaner_period; static ulong tokudb_cleaner_period;
static ulong tokudb_cleaner_iterations; static ulong tokudb_cleaner_iterations;
...@@ -565,6 +570,8 @@ static int tokudb_init_func(void *p) { ...@@ -565,6 +570,8 @@ static int tokudb_init_func(void *p) {
} }
} }
tokudb_primary_key_bytes_inserted = create_partitioned_counter();
//3938: succeeded, set the init status flag and unlock //3938: succeeded, set the init status flag and unlock
tokudb_hton_initialized = 1; tokudb_hton_initialized = 1;
rw_unlock(&tokudb_hton_initialized_lock); rw_unlock(&tokudb_hton_initialized_lock);
...@@ -1425,7 +1432,10 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) { ...@@ -1425,7 +1432,10 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) {
break; break;
} }
STATPRINT(mystat[row].legend, buf); STATPRINT(mystat[row].legend, buf);
} }
uint64_t bytes_inserted = read_partitioned_counter(tokudb_primary_key_bytes_inserted);
snprintf(buf, bufsiz, "%" PRIu64, bytes_inserted);
STATPRINT("handlerton: primary key bytes inserted", buf);
} }
if (error) { my_errno = error; } if (error) { my_errno = error; }
TOKUDB_DBUG_RETURN(error); TOKUDB_DBUG_RETURN(error);
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "db.h" #include "db.h"
extern handlerton *tokudb_hton; extern handlerton *tokudb_hton;
extern DB_ENV *db_env; extern DB_ENV *db_env;
...@@ -46,4 +45,6 @@ extern pthread_mutex_t tokudb_meta_mutex; ...@@ -46,4 +45,6 @@ extern pthread_mutex_t tokudb_meta_mutex;
extern uint32_t tokudb_write_status_frequency; extern uint32_t tokudb_write_status_frequency;
extern uint32_t tokudb_read_status_frequency; extern uint32_t tokudb_read_status_frequency;
void toku_hton_update_primary_key_bytes_inserted(uint64_t row_size);
#endif //#ifdef _HATOKU_HTON #endif //#ifdef _HATOKU_HTON
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment