void ShoreYCSBEnv::print_throughput(const double iQueriedSF, const int iSpread, const int iNumOfThreads, const double delay) { CRITICAL_SECTION(last_stats_cs, _last_stats_mutex); // get the current statistics ShoreYCSBTrxStats current_stats = _get_stats(); // now calculate the diff current_stats -= _last_stats; uint trxs_att = current_stats.attempted.total(); uint trxs_abt = current_stats.failed.total(); uint trxs_dld = current_stats.deadlocked.total(); TRACE( TRACE_ALWAYS, "*******\n" \ "QueriedSF: (%.1f)\n" \ "Spread: (%s)\n" \ "Threads: (%d)\n" \ "Trxs Att: (%d)\n" \ "Trxs Abt: (%d)\n" \ "Trxs Dld: (%d)\n" \ "Secs: (%.2f)\n" \ "TPS: (%.2f)\n", iQueriedSF, (iSpread ? "Yes" : "No"), iNumOfThreads, trxs_att, trxs_abt, trxs_dld, delay, (trxs_att-trxs_abt-trxs_dld)/delay); }
void stats_event_add(char *source, char *name, unsigned long value) { char *old_value; unsigned long new_value; old_value = _get_stats(source, name); if (old_value != NULL) { new_value = atol(old_value); free(old_value); new_value += value; } else { new_value = value; } stats_event_args(source, name, "%ld", new_value); }
void stats_event_inc(char *source, char *name) { char *old_value; int new_value; old_value = _get_stats(source, name); if (old_value != NULL) { new_value = atoi(old_value); free(old_value); new_value++; } else { new_value = 1; } stats_event_args(source, name, "%d", new_value); }
char *stats_get_value(const char *source, const char *name) { return(_get_stats(source, name)); }
void ShoreYCSBEnv::reset_stats() { CRITICAL_SECTION(last_stats_cs, _last_stats_mutex); _last_stats = _get_stats(); }