sandwatch: record historical command runtimes for later prediction

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

track historical runtimes for this directory and command, predict if there's time for a sandwich on this run


[Skip to Readme]

Properties

Versions 0.1.1.0, 0.1.1.0
Change log CHANGELOG.md
Dependencies aeson (>=1.4.7.1 && <2.2), atomic-write (>=0.2.0 && <0.3), base (>=4.14 && <4.20), bytestring (>=0.11 && <0.12), criterion-measurement (>=0.2 && <0.3), directory (>=1.3 && <1.5), process (>=1.6 && <1.7), sandwatch, text (>=2.0 && <2.1), time (>=1.12 && <1.13) [details]
License BSD-3-Clause
Author Shae Erisson
Maintainer shae@scannedinavian.com
Category Command Line
Uploaded by ShaeErisson at 2024-04-29T20:43:05Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for sandwatch-0.1.1.0

[back to package description]

sandwatch

Remember how long commands take, tell me if I have enough time to make a sandwich?

This is inspired by arbtt, the shell built-in time, and the rust utility tally.

The name was suggested by qu1j0t3.

Why?

Rather than telling me how long something has taken, I would like to know roughly how long this task will take, based on historical records.

Sandwatch records the current directory, the command line, and the runtime for a command.

When running a new command that matches the directory and the first two words of the command line, sandwatch reports expected completion time in sandwich units (five minutes?).

How to use it?

It's a wrapper command. sandwatch cabal build or sandwatch make or whatever you like. Perhaps one day this will become a shell builtin written in Rust.

How to install it?

I suggest using ghcup to install the Haskell compiler and then cabal build in your clone of this git repo.

How does it work?

Sandwatch creates a json file holding entries recording the working directory, the command line, and the execution time.

When a command matches in the same directory, execution from previous runs is average together to give you a rough idea as to whether you have time to make a sandwich or not!

Tell me the root problem?

I don't have insight into the progress of a running program. I wish all programs would dump some number of percent complete events. I could use that to estimate completion time from start time.

Ideas