Add some chains to separate monitoring and restriction
[platform/core/connectivity/stc-manager.git] / src / database / tables / table-statistics.c
index f0fd084..5983ad7 100644 (file)
@@ -585,6 +585,8 @@ stc_error_e table_statistics_insert(stc_db_classid_iftype_key *stat_key,
        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;
+       int64_t rcv;
+       int64_t 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) {
@@ -618,7 +622,8 @@ stc_error_e table_statistics_insert(stc_db_classid_iftype_key *stat_key,
        }
 
        if (STC_DEBUG_LOG)
-               STC_LOGD("App stat recorded [\033[0;34m%s\033[0;m]", stat->app_id);
+               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);