- Timestamp:
- Jun 16, 2016 3:15:50 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
geovis/trunk/Stats.cpp
r4424 r6381 49 49 GeoVis::serverStats(const Stats& stats, int code) 50 50 { 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); 61 55 62 56 std::ostringstream oss; … … 65 59 buf[BUFSIZ-1] = '\0'; 66 60 std::string hostname(buf); 67 strcpy(buf, ctime(& stats.start.tv_sec));61 strcpy(buf, ctime(&now.tv_sec)); 68 62 buf[strlen(buf) - 1] = '\0'; 69 63 std::string date(buf); … … 74 68 << "host " << hostname << " " 75 69 << "date {" << date << "} " 76 << "date_secs " << stats.start.tv_sec << " "70 << "date_secs " << now.tv_sec << " " 77 71 << "num_data_sets " << stats.nDataSets << " " 78 72 << "data_set_bytes " << stats.nDataBytes << " " … … 81 75 << "num_commands " << stats.nCommands << " " 82 76 << "cmd_time " << stats.cmdTime << " " 83 << "session_time " << (finish - start)<< " "77 << "session_time " << session_time << " " 84 78 << "status " << code << " "; 85 79
Note: See TracChangeset
for help on using the changeset viewer.