Skip to content

Commit

Permalink
Added logging of dns resolver info
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeenan committed Jun 5, 2024
1 parent 283fae9 commit 8332636
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/support/devtools_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ def process_netlog_requests(self):
mapping = {'created': 'created',
'dns_start': 'dns_start',
'dns_end': 'dns_end',
'dns_info': 'dns_info',
'connect_start': 'connect_start',
'connect_end': 'connect_end',
'ssl_start': 'ssl_start',
Expand Down
8 changes: 8 additions & 0 deletions internal/support/netlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ def post_process_events(self):
if hostname in dns_lookups and 'claimed' not in dns_lookups[hostname]:
dns = dns_lookups[hostname]
dns['claimed'] = True
if 'info' in dns:
request['dns_info'] = dns['info']
# Find the longest DNS time that completed before connect_start
if 'times' in dns_lookups[hostname]:
elapsed = None
Expand All @@ -384,6 +386,8 @@ def post_process_events(self):
if hostname in dns_lookups and 'claimed' not in dns_lookups[hostname]:
dns = dns_lookups[hostname]
dns['claimed'] = True
if 'info' in dns:
request['dns_info'] = dns['info']
# Find the longest DNS time that completed before the request start
if 'times' in dns_lookups[hostname]:
elapsed = None
Expand Down Expand Up @@ -755,6 +759,10 @@ def process_dns_event(self, event):
entry['end'] = event['time']
if 'host' not in entry and 'host' in params:
entry['host'] = params['host']
if name == 'HOST_RESOLVER_DNS_TASK' and params:
if 'info' not in entry:
entry['info'] = {}
entry['info'].update(params)

def process_socket_event(self, event):
if 'socket' not in self.netlog:
Expand Down

0 comments on commit 8332636

Please sign in to comment.