mattjegan / howlong Goto Github PK
View Code? Open in Web Editor NEWA simple command line application that lets you know how long your command has been running.
License: Apache License 2.0
A simple command line application that lets you know how long your command has been running.
License: Apache License 2.0
We should be testing on python 3.6 now as well
At the moment we don't really have proper tests so it would be nice to have pytest working and full unit tests implemented.
HowLong's default timer interval is 1 second. This time interval can thus not provide accurate time measurements for programs that execute in less than a second(which are a large percentage). Therefore, I think it'd be great if the interval is reduced to something much lower, like 0.1s.
I've created a PR for this - #41
It would be nice to have some color in our output.
Can we have a feature to attach to an already running process and give timing stats about that?
I regularly come across this scenario when I am running heavy resource intensive processes [say Linux kernel compilation or Android AOSP builds or downloading system updates]. It is fairly easy to forget running the command under howlong
or *nix's time
while launching the process. It would be great to keep track of how long something has been running even after it has been started.
I have a fairly solid knowledge of achieving that in Linux systems with proc
support. Not sure about other operating systems, though.
Would love to hear your thoughts about this.
I am currently looking for feature requests for the next release of HowLong. If you think you have an interesting feature, with a plausible use case, please feel free to open an issue so we can discuss it before a pull request ๐
Currently, we are not capable of spawning programs which takes arguments in the form of dashes or double dashes, (example: ls -a
)
Running
howlong "ls -a"
results in
Running ls -a
Traceback (most recent call last):
File "/usr/bin/howlong", line 11, in <module>
load_entry_point('howlong==0.0.1', 'console_scripts', 'howlong')()
File "/usr/lib/python3.5/site-packages/HowLong/HowLong.py", line 35, in howlong
HowLong().run()
File "/usr/lib/python3.5/site-packages/HowLong/HowLong.py", line 25, in run
process = Popen(self.parsed_args.command)
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'ls -a'
and running
howlong ls -a
results in
usage: howlong [-h] [-i [interval]] C [C ...]
howlong: error: unrecognized arguments: -a
We can make use of argparse.REMAINDER
for nargs
to get all the arguments for the target program properly.
Would like to hear your thoughts before I can send a PR ๐
When Ctrl-C is used to terminate the program, the process that is being run should also be killed. Currently not supported since.
It would be nice if the project have a command that show the whole history or import it to a file
P.S. I would like to work on this new feature
I think it is best to add an AUTHORS
file in the project root with the list of people who have contributed to the project.
Gives a better sense of accomplishment for fresh contributors too.
Perhaps the README could contain a piece comparing using howlong
to using the system supplied time
command?
The repeated log statements break up terminal outputs from the process. This may make it difficult to interpret the usual outputs from the process.
An option might be added to specify that only the last log statement should be kept in the terminal output. Previous log statements should be cleaned up as each new log statement is written.
For example:
$ howlong -c python helloworld.py
Running python helloworld.py
INFO:0:00:01.003903
Hello, World!
INFO:0:00:02.005022
Finished python helloworld.py
might become:
$ howlong --latest-only -c python helloworld.py
Running python helloworld.py
Hello, World!
INFO:0:00:02.005022
Finished python helloworld.py
All you need to do is fix this code smell: https://landscape.io/github/mattjegan/HowLong/5/messages/smell
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.