Convert Puppeteers HttpResponse.timing().requestTime to real time

Viewed 53

I'm using puppeteers page.on('requestFinished') event in my web scraper. Part of the project, I need to collect each request start time and the time it took to complete the request. I found httpResponse.timing() but I couldn't wrap my head around the requestTime fields value. It looks like it is in seconds with decimal place, but, it neither an epoch time nor it is the time elapsed since I start my crawler process (monotonic time). What time format is it? Can we convert it to human understandable time, so that I know when the request started?

Example of timing() output:

{
  requestTime: 700151.9155,
  proxyStart: -1,
  proxyEnd: -1,
  dnsStart: 1.646,
  dnsEnd: 108.539,
  connectStart: 108.539,
  connectEnd: 218.554,
  sslStart: 164.675,
  sslEnd: 218.531,
  workerStart: -1,
  workerReady: -1,
  workerFetchStart: -1,
  workerRespondWithSettled: -1,
  sendStart: 221.102,
  sendEnd: 222.261,
  pushStart: 0,
  pushEnd: 0,
  receiveHeadersEnd: 364.526
}
{
  requestTime: 700152.313434,
  proxyStart: -1,
  proxyEnd: -1,
  dnsStart: -1,
  dnsEnd: -1,
  connectStart: -1,
  connectEnd: -1,
  sslStart: -1,
  sslEnd: -1,
  workerStart: -1,
  workerReady: -1,
  workerFetchStart: -1,
  workerRespondWithSettled: -1,
  sendStart: 1.316,
  sendEnd: 2.29,
  pushStart: 700152.24554,
  pushEnd: 700152.24558,
  receiveHeadersEnd: 13.923
}
0 Answers
Related