Comments (8)
Closing this one for now.... we'll reopen it if needed.
from python-ping.
Due to the fact that quiet_ping() should run in background and we only care about the end result (and infinite quiet ping is not really something ppl will really need) maybe it will be better if we only keep verbose_ping() as generator and revert quiet_ping() to the old way....
@EclectickMedia What do you think?
from python-ping.
I found the issue.
if count is not None and i < count:
i += 1
elif count is not None:
yield myStats.pktsSent
elif count is not None and i >= count:
break
Should be
if count is not None and i < count:
i += 1
elif count is not None and i >= count:
break
elif count is not None:
yield myStats.pktsSent
Or it will never brake.
Fix: f969f9d
from python-ping.
On the note of reverting quiet_ping
to non-generator code,
I somewhat agree. I'm working with this repository in my own code and have found single_ping
more useful for extension anyways.
Im able to just create a generator that uses single_ping
as many times as needed (in my case, generally infinitely as I am using the software to collect large datasets) via:
import ping as pythonping # I have another function named ping that is higher level than this
def generate_pings(address, **kwargs):
i = 0
while 1:
yield pyping.single_ping('google.com', host_name, 3000, timeout, i, 64)
i += 1
I use this generator to generate my own statistics and visualize them via MatPlotLib (unfortunately matplotlib doesnt like the frequency at which I can generate data....
grumbles angrily
)
*The current implementation was able to receive new data up to 70% more often than Nix's implemented ping
utility.
As to your comment about no one needing to infinitely ping:
I need ping's to run for up to 6 months at a time to collect data and run analysis on the variance over time. I know several other IT pro's that maintain data about their response rate over time. This feature set is standard accross low level ping implementations across OS's. I think it is a feature worth implementing.
While most people collect data off each request (i.e saving the output to a CSV file), I can't really see anyone leaving the quiet_ping
running for the same usages.
For an example of the software generating information exceptionally quickly, try out [my software](www.github.com/eclectickeclipse/pingstats]. Use $sudo python3 PingStats.py -a google.ca -sNF
from python-ping.
How do you suggest we proceed ?
I already did checkout ur project (PingStats) 👍
from python-ping.
I believe limiting features because you think the user won't need them sets you up for needing to add the feature later.
May as well allow the user the option regardless of the number of people that use it.
from python-ping.
In this case I preffer going the KISS way.
quiet_ping() will be used mainly when ping.py is used as a lib... with that in mind, whoever is using it can just loop on single_ping() , so we're really saving him what... 2-3 lines of code...
from python-ping.
Pretty much yeah. Thats fair.
from python-ping.
Related Issues (15)
- do_one is named obtusely HOT 1
- quiet and verbose_ping cannot ping continuously HOT 3
- Python 2.7 spits out a traceback on [Error 65] HOT 2
- The current experimental generator functionality breaks myStats. HOT 5
- We are dropping the TTL data during execution. HOT 5
- Should we submit a pull to samuel/python-ping? HOT 2
- The current repository name breaks python import structures in python3 and above HOT 5
- The current license has outdated information HOT 1
- single_ping blocks threading.Thread.join HOT 1
- There is a set of logic in single_ping that potentially blocks out ipv6 decoding HOT 1
- Doesn't work anymore on Windows HOT 3
- Needs more 3.6 compatibility
- Broadcast Pings do not appear to be working HOT 1
- How to hide 'Request timed out' message when calling quiet_ping() ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-ping.