catchpoint / WebPageTest.agent

Cross-platform WebPageTest agent
Other
213 stars 138 forks source link

New way to create hostname-ipaddress #539

Closed sammeboy635 closed 2 years ago

sammeboy635 commented 2 years ago

Working on fixing the new logger, I was trying to figure out how the hostname was generated in webpagetest.py and thought maybe we could clean this up and allow me to practice more on PRs). I tried a few different variants but this variant worked on all platforms(Windows, Linux, MacOS) getting the correct local IP address. Other variants worked on windows and Linux but macOS received a localhost IP, instead of a local IP address which is why this pc_name() method was chosen.

As far as Line 108 - 121 in webpagetest.py, I can see its trying to get a mac address but a little unclear if it's important. I tested these lines in (Windows, Linux, MacOS, and a VM of Linux), and received no matches. If it is important maybe we could have a if/elif statement to make it run when needed and not every time.

@pmeenan please review and any feedback is very much appreciated! Thanks

pmeenan commented 2 years ago

LGTM.