Fixed 64 bit type format
[platform/core/connectivity/stc-manager.git] / src / database / tables / table-statistics.c
old mode 100644 (file)
new mode 100755 (executable)
index f0fd084..7670e28
@@ -500,7 +500,7 @@ handle_error:
        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)
@@ -578,13 +578,15 @@ handle_error:
        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;
@@ -607,6 +609,8 @@ stc_error_e table_statistics_insert(stc_db_classid_iftype_key *stat_key,
        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) {
@@ -617,8 +621,9 @@ stc_error_e table_statistics_insert(stc_db_classid_iftype_key *stat_key,
                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);