Ejemplo n.º 1
0
void LibEventJob::stopTimer() {
  if (RuntimeOption::EnableStats && RuntimeOption::EnableWebStats) {
    timespec end;
    Timer::GetMonotonicTime(end);
    time_t dsec = end.tv_sec - start.tv_sec;
    long dnsec = end.tv_nsec - start.tv_nsec;
    int64_t dusec = dsec * 1000000 + dnsec / 1000;
    ServerStats::Log("page.wall.queuing", dusec);

#ifdef EVHTTP_CONNECTION_GET_START
    struct timespec evstart;
    evhttp_connection_get_start(request->evcon, &evstart);
    dsec = start.tv_sec - evstart.tv_sec;
    dnsec = start.tv_nsec - evstart.tv_nsec;
    dusec = dsec * 1000000 + dnsec / 1000;
    ServerStats::Log("page.wall.request_read_time", dusec);
#endif
  }
}
Ejemplo n.º 2
0
void LibEventJob::getRequestStart(struct timespec *reqStart) {
#ifdef EVHTTP_CONNECTION_GET_START
  evhttp_connection_get_start(request->evcon, reqStart);
#endif
}