Skip to content

Instantly share code, notes, and snippets.

@nbergseng
Created January 7, 2015 17:26
Show Gist options
  • Save nbergseng/04ea8a3a537133a94bf8 to your computer and use it in GitHub Desktop.
Save nbergseng/04ea8a3a537133a94bf8 to your computer and use it in GitHub Desktop.
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:

Make sure you rerun the program after you make changes by clicking the stop button and then the play button.

demo search_cluster metrics 'response_ms' // Get response_ms metrics from our search demo data
-from :2 minutes ago: // Get data from 2 minutes ago and ingest live data
| batch :2 seconds: // Group into 2 second intervals
| reduce p90 = percentile('value', .9) by service // Calculate p90 response time
| @timechart -valueField 'p90' // Plot data on a chart
-keyField 'service' // Every service should be a line on the chart
-title 'Response time (ms) by Service'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment