Skip to content

Instantly share code, notes, and snippets.

View mccanne's full-sized avatar

Steve McCanne mccanne

View GitHub Profile
@mccanne
mccanne / main.juttle
Last active August 29, 2015 14:08 — forked from demmer/main.juttle
// main.juttle created 10-6-2014
demo cdn -from :15 minutes ago: -to :now:
-every :5 second: -period :2 seconds: -batch_size 250
| reduce count=count() by host,type,name
| @table
@mccanne
mccanne / README.md
Last active August 29, 2015 14:10
Emitter example

Simpler emitter example. Creates a flow of five points, one per second in real-time, with just a timestamp.

@mccanne
mccanne / README.md
Created December 7, 2014 21:10
Dice test

A simple juttle to test the dice_rolls subgraph

@mccanne
mccanne / README.md
Last active August 29, 2015 14:10
Frequency table test

A simple test of the frequency_table subgraph.

@mccanne
mccanne / README.md
Last active August 29, 2015 14:10
Dice game histogram.

Roll dice and compute a histogram displayed as a barchart.

@mccanne
mccanne / README.md
Last active August 29, 2015 14:10
Multiple dice games

A simple example where we run multiple dice games, illustrating how modularity and subgraphs are helpful

@mccanne
mccanne / main.juttle
Last active August 29, 2015 14:13
Juttle "hello, world"
emitter -limit 5 | put message='Hello, world' | @table
@mccanne
mccanne / README.md
Last active August 29, 2015 14:15
harmonics

A toy example of Juttle that illustrates how far one can push on the modularity of subgraphs...

@mccanne
mccanne / main.juttle
Created February 15, 2015 03:18
chord anti-pattern
const scale = 0.9;
emitter -hz 20 -limit 1000 | (
put first=Math.sin(scale*2*Math.PI*Date.unixms(time)/1000.) |
put third=Math.sin(1.25*scale*2*Math.PI*Date.unixms(time)/1000.) |
put fifth=Math.sin(1.5*scale*2*Math.PI*Date.unixms(time)/1000.) |
( split 'first','third','fifth' | @timechart ;
put value=first+third+fifth | keep time,value |
@timechart -title 'major chord' )
;
put first=Math.sin(scale*2*Math.PI*Date.unixms(time)/1000.) |
@mccanne
mccanne / rando.go
Created April 22, 2020 17:39
generate some random zng for testing
package main
import (
"fmt"
"math/rand"
"time"
"github.com/tjarratt/babble"
)