Skip to content

Instantly share code, notes, and snippets.

View apurvadave's full-sized avatar

Apurva Dave apurvadave

View GitHub Profile
#Example Liveness probe for the Sysdig Blog on "Monitoring Kubernetes"
apiVersion: v1
kind: Pod
metadata:
labels:
test: liveness
name: liveness-exec
spec:
@apurvadave
apurvadave / docker_stats_API_output
Created November 1, 2016 15:43
Example docker stats API. Useful as a stepping stone to docker monitoring
"cpu_stats": {
"cpu_usage": {
"percpu_usage": [
12763896556733
],
"total_usage": 12763896556733,
"usage_in_kernelmode": 918680000000,
"usage_in_usermode": 5232460000000
},
"system_cpu_usage": 6587736350000000,
@apurvadave
apurvadave / main.juttle
Last active August 29, 2015 14:27
Timechart for scatter comparison
(read -demo 'srch_cluster' -from :2 minutes ago: -max_samples '2000' name = 'response_ms';
read -demo 'srch_cluster' -from :2 minutes ago: -max_samples '2000' name='requests')
| reduce -every :2s: avg(value) by name
| @timechart
-keyField 'name' -display.duration :2m: -display.dataDensity 10
-title "Timechart Example"
@apurvadave
apurvadave / Readme.md
Created August 17, 2015 22:34
Showing off a basic use case of operations analytics with scatter chart in Jut

Scatterchart is a great way to correlate two metrics visually. This example shows off response time vs requests.

Row Season No. in series Company Deal Industry Entrepreneur Gender Amount Equity Valuation Corcoran Cuban Greiner Herjavec John O'Leary Harrington Guest # Sharks $ per shark Details / Notes
2 1 1 Ava the Elephant Yes Healthcare Female $50,000 55% $90,909 1 1 $50,000
3 1 1 Mr. Tod's Pie Factory Yes Food and Beverage Male $460,000 50% $920,000 1 1 2 $230,000
4 1 1 Wispots No Business Services Male 0
5 1 1 College Foxes Packing Boxes No Lifestyle / Home Male 0
6 1 1 Ionic Ear No Uncertain / Other Male 0
7 1 2 A Perfect Pear Yes Food and Beverage Female $500,000 50% $1,000,000 1 1 2 $250,000
8 1 2 Classroom Jams Yes Children / Education Male $250,000 10% $2,500,000 1 1 1 1 1 5 $50,000
9 1 2 Lifebelt No Consumer Products Male 0
@apurvadave
apurvadave / main.juttle
Created June 6, 2015 04:05
Create a streaming reduce in 3 lines of code
// Streaming reduce of maximum response time of host(s) every 10 seconds and plot it on a timechart
read -demo 'srch_cluster' -from :5 minutes ago: name = 'response_ms' service= 'search'
| reduce -every :10 seconds: max = max(value) by host
| @timechart
@apurvadave
apurvadave / main.juttle
Last active August 29, 2015 14:22
Simple example using demo data to show off the Jut pan and zoom feature
read -demo 'srch_cluster' -from :2 days ago: -to :now: name = 'response_ms' // Get data from 2 days ago till now
| reduce -every :10 seconds: p90 = percentile('value', .9) by host // Calculate p90 response time
| @timechart -title 'Response time (ms) by Service'
@apurvadave
apurvadave / README.md
Last active August 29, 2015 14:16 — forked from demmer/README.md

Using pace for instant replay of data

This example highlights the use of the pace processor to provide simulated live playback of data.

The first example shows historical data instantly, with live data streaming in. The second example uses pace to playback all of the data, with historical data playing back at 4x original speed.

Your Turn:

@apurvadave
apurvadave / main.juttle
Last active August 29, 2015 14:10
AAPL v Microsoft
source "https://www.quandl.com/api/v1/datasets/GOOG/NASDAQ_AAPL.csv?trim_start=1980-12-12&trim_end=2014-11-20" |
put time=Date(Date) | put AAPL=Close| (@timechart -column 'AAPL' -title 'AAPL v MSFT' -name AAPL);
source "https://www.quandl.com/api/v1/datasets/GOOG/NASDAQ_MSFT.csv?trim_start=1986-03-13&trim_end=2014-11-20" |
put time=Date(Date) | put MSFT=Close | (@timechart -column 'MSFT' -name MSFT -on AAPL)
@apurvadave
apurvadave / data.juttle
Created November 21, 2014 19:48
Wind Data
This file has been truncated, but you can view the full file.
Station_ID,Station_Name,Location_Label,Interval_Minutes,Interval_End_Time,Wind_Velocity_Mtr_Sec,Wind_Direction_Variance_Deg,Wind_Direction_Deg,Ambient_Temperature_Deg_C,Global_Horizontal_Irradiance
SF37,"Chinatown Medical Center","Chinatown Medical Center",5,2014-01-4? 00:05,1.172,0,293.7,9.36,0
SF37,"Chinatown Medical Center","Chinatown Medical Center",5,2014-01-4? 00:10,0.867,0,293.7,9.27,0
SF37,"Chinatown Medical Center","Chinatown Medical Center",5,2014-01-4? 00:15,1.175,0,293.7,9.29,0
SF37,"Chinatown Medical Center","Chinatown Medical Center",5,2014-01-4? 00:20,0.874,0,293.7,9.23,0
SF37,"Chinatown Medical Center","Chinatown Medical Center",5,2014-01-4? 00:25,1.004,0,293.7,9.24,0
SF37,"Chinatown Medical Center","Chinatown Medical Center",5,2014-01-4? 00:30,0.986,0,293.7,9.23,0
SF37,"Chinatown Medical Center","Chinatown Medical Center",5,2014-01-4? 00:35,0.988,0,293.7,9.15,0
SF37,"Chinatown Medical Center","Chinatown Medical Center",5,2014-01-4? 00:40,1.119,0,293.7,9.15,0
SF37,"Chinatown Medical Center","C