Skip to content

Commit

Permalink
Spark docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zix99 committed Dec 17, 2024
1 parent a7d4aa8 commit 6600e6d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
nvm use --lts
npm install -g terminalizer
terminalizer record -k output.yml
# Do any yaml cleanup/delays
terminalizer render -o temp.gif output.yml
gifsicle -O3 --colors 128 -i temp.gif -o output.gif
```

Note on environment; Make sure bashrc when terminalizer starts is set by changing `command:` in config yaml
Note on environment; Make sure bashrc when terminalizer starts is set by changing `command: bash --rcfile ~/terminalizer/bashrc` in config yaml
```bash
export PS1="$ "
export PATH="./:$PATH"
Expand Down Expand Up @@ -62,6 +63,10 @@ rare table -m '\[(.+?)\].*" (\d+)' -e '{buckettime {1} year}' -e '{2}' access.lo

rare heatmap -m '\[(.+?)\].*" (\d+)' -e "{timeattr {time {1}} yearweek}" -e "{2}" access.log

### Sparkline

rare spark -m '\[(.+?)\].*" (\d+)' -e "{timeattr {time {1}} yearweek}" -e "{2}" access.log

### Analyze bytes sent, only looking at 200's

rare analyze -m '(\d{3}) (\d+)' -e '{2}' -i '{neq {1} 200}' access.log
Expand Down
Binary file added docs/images/rare-spark.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions docs/usage/aggregators.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,39 @@ Matched: 1,035,666 / 1,035,666 (R: 8; C: 61)

![Gif of heatmap](../images/heatmap.gif)

## Sparkline

```
rare help sparkline
```

### Summary

Creates one or more sparklines based on table-style input. Provide
multiple inputs using `{$ a b}` helper.

Supports [alternative scales](#alternative-scales)

### Example

```bash
$ rare spark -m '\[(.+?)\].*" (\d+)' \
-e "{timeattr {time {1}} yearweek}" -e "{2}" access.log

First 2019-34................................................2020-9 Last
404 15,396 ..._._-.^_._.._..________.____.__.___.____________.______.___ 5,946
200 7,146 _____________________________________________________________ 4,938
400 162 _____________________________________________________________ 522
405 6 _____________________________________________________________ 6
408 0 _____________________________________________________________ 6
304 0 _____________________________________________________________ 0
301 6 _____________________________________________________________ 0
206 0 _____________________________________________________________ 0
Matched: 1,034,166 / 1,034,166 (R: 8; C: 61)
```

![Gif of sparkline](../images/rare-spark.gif)

## Reduce

```
Expand Down

0 comments on commit 6600e6d

Please sign in to comment.