我正在使用Selify和ChromeDriver从Chrome获取性能日志。
caps = DesiredCapabilities.CHROME
caps['loggingPrefs'] = {'performance': 'ALL'}
driver = webdriver.Chrome(desired_capabilities=caps)
driver.get("some.website")
time.sleep(5)
for entry in driver.get_log('performance'):
print(entry)
检查这些消息时,我发现timestamp
字段的值很奇怪(779922.902049)。所以我的问题是这个timestamp
字段的格式是什么?
{'message': '{"message":{"method":"Network.responseReceived","params":{"frameId":"29983.1","loaderId":"29983.1","requestId":"29983.1","response":{"connectionId":0,"connectionReused":false,"encodedDataLength":0,"fromDiskCache":fals
e,"fromServiceWorker":false,"headers":{"Access-Control-Allow-Origin":"*","Content-Type":"text/plain;charset=US-ASCII"},"mimeType":"text/plain","protocol":"data","securityState":"unknown","status":200,"statusText":"OK","url":"data:
,"},"timestamp":779922.902049,"type":"Document"}},"webview":"e6d532fe-f007-4397-bf28-4c4a26c79e4d"}', 'level': 'INFO', 'timestamp': 1523607170083}
{'message': '{"message":{"method":"Network.loadingFinished","params":{"encodedDataLength":0,"requestId":"29983.1","timestamp":779922.902067}},"webview":"e6d532fe-f007-4397-bf28-4c4a26c79e4d"}', 'level': 'INFO', 'timestamp': 152360
7170083}
请注意在上述消息中还有另一个timestamp
字段,该字段从Epoch开始以毫秒为单位。但这不是我要问的领域。
1条答案
按热度按时间lx0bsm1f1#
我发现它是从上次系统启动时间(即系统正常运行时间)算起的秒数。不过,我找不到任何描述此时间戳格式的文档。