Github user venkat1m commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1537#discussion_r183937495
  
    --- Diff: core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp ---
    @@ -530,11 +542,39 @@ static void* SessionWatchDog(void* arg)
                     okToGo = false;
                 }
             }
    -
    -
    -           while(!record_session_done && okToGo)
    -           {
    -                   REPOS_STATS repos_stats = repos_queue.get_task();
    +        vector< vector<string> > query_list;
    +        vector<string> session_start;
    +        vector<string> statement_new_query;
    +        vector<string> session_stat_aggregation;
    +
    +        session_start.push_back("upsert into 
Trafodion.\"_REPOS_\".metric_session_table values");
    +        statement_new_query.push_back("insert into 
Trafodion.\"_REPOS_\".metric_query_table values");
    +        session_stat_aggregation.push_back("insert into 
Trafodion.\"_REPOS_\".metric_query_aggr_table values");
    +
    +        query_list.push_back(session_start);
    +        query_list.push_back(statement_new_query);
    +        query_list.push_back(session_stat_aggregation);
    +
    +        int query_limit = statisticsCacheSize;
    +        int time_limit = aggrInterval;
    +        //0:None 1:update 2:insert/upsert cache limit 3:achieve timeline
    +        int execute_flag = REPOS_EXECUTE_NONE;
    +        clock_t time_start = clock();
    +        clock_t time_end= clock();
    +
    +        REPOS_STATS repos_stats;
    +        while(!record_session_done && okToGo)
    +        {
    +            time_start = clock();
    +            while(repos_queue.isEmpty() && (((time_end = clock()) - 
time_start) / 1000000 < time_limit));
    --- End diff --
    
    If you set the statisticsCacheSize to 1, would we preserve the current 
behavior where mxosrvr publishes the repository records when it is time. For 
example session start is published as soon as session starts and session end is 
updated as soon as session ends. Like wise we need aggregate stats every 1 
minute. Will the existing behavior be retained by setting statisticsCacheSize 
to 1 ?


---

Reply via email to