All Projects → Freaky → rtss

Freaky / rtss

Licence: MIT license
Relative TimeStamps for Stuff

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to rtss

Sortfilterproxymodel
A nicely exposed QSortFilterProxyModel for QML
Stars: ✭ 214 (+409.52%)
Mutual labels:  filter
Iir1
IIR realtime filter library written in C++
Stars: ✭ 224 (+433.33%)
Mutual labels:  filter
Sndfilter
Algorithms for sound filters, like reverb, dynamic range compression, lowpass, highpass, notch, etc
Stars: ✭ 246 (+485.71%)
Mutual labels:  filter
All In One Customized Adblock List
An all-in-one adblock list that thoroughly blocks trackers, popup ads, ads, unwanted cookies, fake news, cookie warning messages, typosquatters, unwanted comment sections, crypto-coin mining, YouTube clutter, Twitter guff and social network hassles.
Stars: ✭ 217 (+416.67%)
Mutual labels:  filter
Php Validate
Lightweight and feature-rich PHP validation and filtering library. Support scene grouping, pre-filtering, array checking, custom validators, custom messages. 轻量且功能丰富的PHP验证、过滤库。支持场景分组,前置过滤,数组检查,自定义验证器,自定义消息。
Stars: ✭ 225 (+435.71%)
Mutual labels:  filter
Decept
Decept Network Protocol Proxy
Stars: ✭ 229 (+445.24%)
Mutual labels:  filter
Ffmpegandroid
android端基于FFmpeg实现音频剪切、拼接、转码、编解码;视频剪切、水印、截图、转码、编解码、转Gif动图;音视频合成与分离,配音;音视频解码、同步与播放;FFmpeg本地推流、H264与RTMP实时推流直播;FFmpeg滤镜:素描、色彩平衡、hue、lut、模糊、九宫格等;歌词解析与显示
Stars: ✭ 2,858 (+6704.76%)
Mutual labels:  filter
raptor
A fast and space-efficient pre-filter for querying very large collections of nucleotide sequences.
Stars: ✭ 37 (-11.9%)
Mutual labels:  filter
Dsp.jl
Filter design, periodograms, window functions, and other digital signal processing functionality
Stars: ✭ 226 (+438.1%)
Mutual labels:  filter
Rack Reducer
Declaratively filter data via URL params, in any Rack app, with any ORM.
Stars: ✭ 241 (+473.81%)
Mutual labels:  filter
Ios Gpuimage Plus
GPU accelerated image filters for iOS, based on OpenGL.
Stars: ✭ 217 (+416.67%)
Mutual labels:  filter
Caddy Authz
Caddy-authz is a middleware for Caddy that blocks or allows requests based on access control policies.
Stars: ✭ 221 (+426.19%)
Mutual labels:  filter
Magiccamera3
30+Camera different effects with C++ and opengles 3.0
Stars: ✭ 235 (+459.52%)
Mutual labels:  filter
Fuzzysort
Fast SublimeText-like fuzzy search for JavaScript.
Stars: ✭ 2,569 (+6016.67%)
Mutual labels:  filter
Tablefilter
A Javascript library making HTML tables filterable and a bit more :)
Stars: ✭ 248 (+490.48%)
Mutual labels:  filter
Structured Filter
jQuery UI widget for structured queries like "Contacts where Firstname starts with A and Birthday before 1/1/2000 and State in (CA, NY, FL)"...
Stars: ✭ 213 (+407.14%)
Mutual labels:  filter
Torchdata
PyTorch dataset extended with map, cache etc. (tensorflow.data like)
Stars: ✭ 226 (+438.1%)
Mutual labels:  filter
AdBlock-Acceleration
Accelerated subscription for international/China region ad filtering rules(国际/中国地区广告过滤规则的加速订阅)
Stars: ✭ 327 (+678.57%)
Mutual labels:  filter
Svg Filters
🔮 Fildrop. A set of custom SVG Filters
Stars: ✭ 251 (+497.62%)
Mutual labels:  filter
Htmlpurifierbundle
HTML Purifier is a standards-compliant HTML filter library written in PHP.
Stars: ✭ 234 (+457.14%)
Mutual labels:  filter

rtss — Relative TimeStamps for Stuff

rtss annotates its output with relative durations between consecutive lines and since program start.

It can be used as a filter in a pipeline:

-% cargo build --release 2>&1 | rtss
 274.1ms  274.1ms |    Compiling libc v0.2.40
   1.50s    1.22s |    Compiling memchr v2.0.1
   2.28s  780.8ms |    Compiling rtss v0.5.0 (file:///home/freaky/code/rtss)
   5.18s    2.90s |     Finished release [optimized] target(s) in 5.17 secs
   5.18s    exit code: 0

It can also directly run commands, annotating both stdout and stderr with durations. stdin is passed through to the child process, and its exit code will become rtss' own exit code:

-% rtss sh -c "echo foo; echo bar; sleep 1; echo moo >&2; sleep 1; echo baz; exit 64"
   1.7ms    1.7ms | foo
   1.7ms          | bar
   1.00s    1.00s # moo
   2.03s    2.03s | baz
   2.03s    exit code: 64
zsh: exit 64    rtss sh -c

-% rtss sh -c "echo foo; echo bar; sleep 1; echo moo >&2; sleep 1; echo baz; exit 64" 2>/dev/null
   1.9ms    1.9ms | foo
   1.9ms          | bar
   2.05s    2.04s | baz
   2.05s    exit code: 64
zsh: exit 64    rtss sh -c  2> /dev/null

Blank durations indicate lines were read in a single read(). Line durations are per-descriptor, so stderr and stdout have their own distinct durations.

Output suitable for piping to sort -k2 can be requested with -s / --sortable:

-% rtss --sortable sh -c "echo foo; echo bar; sleep 1; echo moo >&2; sleep 1; echo baz; exit 64"
00:00:00.001652 00:00:00.001652 | foo
00:00:00.001652 00:00:00.000000 | bar
00:00:01.007287 00:00:01.007287 # moo
00:00:02.071962 00:00:02.070309 | baz
00:00:02.072185    exit code: 64

PTY mode

For programs that buffer their output or otherwise alter their behaviour when connected to pipes, the --pty (aka --tty) option will, on supported platforms, run the command under a pseudo-terminal.

-% rtss zpool status 5
  10.01s   10.01s |   pool: rpool
  10.01s          |  state: ONLINE
  10.01s          |   scan: scrub repaired 0 in 1h7m with 0 errors on Wed May  2 04:00:38 2018

-% rtss --pty zpool status 5
   4.2ms    4.2ms |   pool: rpool
   4.2ms          |  state: ONLINE
   4.5ms    0.3ms |   scan: scrub repaired 0 in 1h7m with 0 errors on Wed May  2 04:00:38 2018

API

The backend of rtss is provided as a library for use in other programs. This includes:

  • RtssWriter — an io::Write wrapper and implementation, forwarding write() calls and annotating newlines.
  • DurationExt — extends Duration with write_human(), write_sortable(), human_string() and sortable_string() methods.
  • line_timing_copy() — wraps an io::Write in RtssWriter<BufWriter<W>> and calls io::copy() on it and the provided io::Read.
use std::io::{self, Write};
use std::time::{Duration, Instant};

extern crate rtss;
use rtss::{RtssWriter, DurationExt};

fn main() -> io::Result<()> {
    let mut writer = RtssWriter::new(io::stdout(), Duration::human_string, '|', Instant::now());
    writer.write(b"Hello!\n")?;
    writer.write(b"World!\n")?;
    Ok(())
}

Output:

   0.2μs    0.2μs | Hello!
  84.7μs   84.6μs | World!

Installation

If you have Cargo installed you can install the latest release with:

cargo install rtss

You can also install the latest bleeding-edge version using:

cargo install --git https://github.com/Freaky/rtss.git

Alternatively you can clone and build manually without installing:

git clone https://github.com/Freaky/rtss.git &&
cd rtss &&
cargo build --release &&
target/release/rtss echo It works

Alternatives

rtss was inspired by Kevin Burke's tss.

Both are basically trendier versions of ts from moreutils.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].