thombashi / pingparsing

pingparsing is a CLI-tool/Python-library parser and transmitter for ping command :arrow_right_hook:
https://pingparsing.rtfd.io/
MIT License
78 stars 10 forks source link

Does not work with pings from osx - ping file attached #26

Closed marchon closed 7 years ago

marchon commented 7 years ago

` PING google.com (172.217.6.238): 56 data bytes 64 bytes from 172.217.6.238: icmp_seq=0 ttl=53 time=20.482 ms 64 bytes from 172.217.6.238: icmp_seq=1 ttl=53 time=32.550 ms 64 bytes from 172.217.6.238: icmp_seq=2 ttl=53 time=32.013 ms 64 bytes from 172.217.6.238: icmp_seq=3 ttl=53 time=28.498 ms 64 bytes from 172.217.6.238: icmp_seq=4 ttl=53 time=46.093 ms

--- google.com ping statistics --- 5 packets transmitted, 5 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 20.482/31.927/46.093/8.292 ms

`

thombashi commented 7 years ago

@marchon Thank you for your report.

I've added support for OSX at pingparsing 0.9.0. Please try that version.

$ cat osx.txt
PING google.com (172.217.6.238): 56 data bytes
64 bytes from 172.217.6.238: icmp_seq=0 ttl=53 time=20.482 ms
64 bytes from 172.217.6.238: icmp_seq=1 ttl=53 time=32.550 ms
64 bytes from 172.217.6.238: icmp_seq=2 ttl=53 time=32.013 ms
64 bytes from 172.217.6.238: icmp_seq=3 ttl=53 time=28.498 ms
64 bytes from 172.217.6.238: icmp_seq=4 ttl=53 time=46.093 ms

--- google.com ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 20.482/31.927/46.093/8.292 ms
$ ./parse_sample.py -f osx.txt
# properties ---
packet_transmit: 5 packets
packet_receive: 5 packets
packet_loss_rate: 0.0 %
packet_loss_count: 0 packets
packet_duplicate_rate: NaN
packet_duplicate_count: NaN
rtt_min: 20.482
rtt_avg: 31.927
rtt_max: 46.093
rtt_mdev: 8.292

# asdict ---
{
    "packet_transmit": 5,
    "packet_receive": 5,
    "packet_loss_rate": 0.0,
    "packet_loss_count": 0,
    "rtt_min": 20.482,
    "rtt_avg": 31.927,
    "rtt_max": 46.093,
    "rtt_mdev": 8.292,
    "packet_duplicate_rate": null,
    "packet_duplicate_count": null
}
thombashi commented 7 years ago

I'll close the issue. Feel free to reopen if you still have problems.