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) {
error = insert_rows_to_dictionaries_mult(&prim_key, &row, txn, thd);
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);
......
......@@ -261,6 +261,11 @@ HASH tokudb_open_tables;
pthread_mutex_t tokudb_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 ulong tokudb_cleaner_period;
static ulong tokudb_cleaner_iterations;
......@@ -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
tokudb_hton_initialized = 1;
rw_unlock(&tokudb_hton_initialized_lock);
......@@ -1425,7 +1432,10 @@ static bool tokudb_show_engine_status(THD * thd, stat_print_fn * stat_print) {
break;
}
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; }
TOKUDB_DBUG_RETURN(error);
......
......@@ -3,7 +3,6 @@
#include "db.h"
extern handlerton *tokudb_hton;
extern DB_ENV *db_env;
......@@ -46,4 +45,6 @@ extern pthread_mutex_t tokudb_meta_mutex;
extern uint32_t tokudb_write_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
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