Skip to content

Instantly share code, notes, and snippets.

View demmer's full-sized avatar

Michael Demmer demmer

View GitHub Profile
@demmer
demmer / README.md
Created November 18, 2014 04:07
Split and join flowgraphs

Split and Join Flowgraphs

Juttle programs enable you to answer questions in dynamic, changing environments by letting you split a stream of data, run different computations on each stream, and then join the two streams together again. These dynamic programs continually update their results, allowing you to follow hotspots around your environment or use one program output as a key for others.

This example finds the slowest host in the "search" service based on response time, every 10 seconds, and then gets a count of user requests running on that particular host.

Your Turn:

  • Try changing the service from "search" to "index".
  • Let's make sure we are in fact getting showing the slowest host:
  • Uncomment line 21
@demmer
demmer / README.md
Last active August 29, 2015 14:09
Custom reducers

There's a reducer for that...

What query language hasn't left you wanting of just a few more functions? The Juttle dataflow language comes with powerful built-in functions like percentile() but you can define your own functions or reducers that operate on every point in a stream or on batches of points. You can also import functions that other people have written.

In this example, we implement an exponentially weighted moving average calculation and import a rate of change calculation.

Your Turn:

  • Try changing the weight used in the ewma function by changing .1 to .9 on line 16.
  • On line 7, we've imported a derivative reducer. Let's plot what it does by uncommenting line 20.
@demmer
demmer / README.md
Last active August 29, 2015 14:09
Events and Metrics

Events, Meet Metrics

You shouldn't have to go to separate applications for different data types. Juttle allows you to seamlessly combine events like log data, code deploys, and change windows with metrics like CPU, memory, disk or statsd and JMX metrics.

This example plots a typical metric (response time) and overlays server errors combed from logs on the host "sea.0" as vertical bars.

@demmer
demmer / README.md
Last active August 29, 2015 14:09
Live and Historical Data

Live Data, Meet Historical

Jut lets you analyze live data, historical data or both. This showcase taps into response time data from our synthetic demo generator to combine the last two minutes of history with the live firehose.

Your Turn:

  • Line 2: Change the -from time to :5 minutes ago:
  • Line 4, 6 & 7: Change "service" to "host"
  • Line 3: Change the batch interval to :5 seconds:
@demmer
demmer / main.juttle
Last active August 29, 2015 14:07
test 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