Changeset 6381 for geovis


Ignore:
Timestamp:
Jun 16, 2016 3:15:50 PM (8 years ago)
Author:
ldelgass
Message:

Fix stats to report end time in render_stop

File:
1 edited

Legend:

Unmodified
Added
Removed
  • geovis/trunk/Stats.cpp

    r4424 r6381  
    4949GeoVis::serverStats(const Stats& stats, int code)
    5050{
    51     double start, finish;
    52     {
    53         struct timeval tv;
    54 
    55         /* Get ending time. */
    56         gettimeofday(&tv, NULL);
    57         finish = CVT2SECS(tv);
    58         tv = stats.start;
    59         start = CVT2SECS(tv);
    60     }
     51    struct timeval now;
     52    /* Get ending time. */
     53    gettimeofday(&now, NULL);
     54    double session_time = CVT2SECS(now) - CVT2SECS(stats.start);
    6155
    6256    std::ostringstream oss;
     
    6559    buf[BUFSIZ-1] = '\0';
    6660    std::string hostname(buf);
    67     strcpy(buf, ctime(&stats.start.tv_sec));
     61    strcpy(buf, ctime(&now.tv_sec));
    6862    buf[strlen(buf) - 1] = '\0';
    6963    std::string date(buf);
     
    7468        << "host " << hostname << " "
    7569        << "date {" << date << "} "
    76         << "date_secs " << stats.start.tv_sec << " "
     70        << "date_secs " << now.tv_sec << " "
    7771        << "num_data_sets " << stats.nDataSets << " "
    7872        << "data_set_bytes " << stats.nDataBytes << " "
     
    8175        << "num_commands " << stats.nCommands << " "
    8276        << "cmd_time " << stats.cmdTime << " "
    83         << "session_time " << (finish - start) << " "
     77        << "session_time " << session_time << " "
    8478        << "status " << code << " ";
    8579
Note: See TracChangeset for help on using the changeset viewer.