return error_code;
}
-stc_error_e table_statistics_per_app(const char *app_id,
+API stc_error_e table_statistics_per_app(const char *app_id,
table_statistics_select_rule *rule,
table_statistics_info_cb info_cb,
void *user_data)
return error_code;
}
-stc_error_e table_statistics_insert(stc_db_classid_iftype_key *stat_key,
+API stc_error_e table_statistics_insert(stc_db_classid_iftype_key *stat_key,
stc_db_app_stats *stat,
time_t last_touch_time)
{
stc_error_e error_code = STC_ERROR_NONE;
sqlite3_stmt *stmt = update_statistics_query;
stc_hw_net_protocol_type_e hw_net_protocol_type = STC_PROTOCOL_UNKNOWN;
+ long long int rcv;
+ long long int snd;
if (!stat->rcv_count && !stat->snd_count) {
error_code = STC_ERROR_INVALID_PARAMETER;
DB_ACTION(sqlite3_bind_int(stmt, 10, (int)stat->ground));
/*we want to reuse tree*/
+ rcv = stat->rcv_count;
+ snd = stat->snd_count;
stat->rcv_count = 0;
stat->snd_count = 0;
if (sqlite3_step(stmt) != SQLITE_DONE) {
goto handle_error; //LCOV_EXCL_LINE
}
- if (STC_DEBUG_LOG)
- STC_LOGD("App stat recorded [\033[0;34m%s\033[0;m]", stat->app_id);
+ if (STC_STAT_LOG)
+ STC_LOGD("App stat recorded [\033[0;34m%s\033[0;m] "
+ "rcv[%lld] snd[%lld]", stat->app_id, rcv, snd);
handle_error:
sqlite3_reset(stmt);