Skip to content

Instantly share code, notes, and snippets.

View go-oleg's full-sized avatar

Oleg Seletsky go-oleg

View GitHub Profile
@go-oleg
go-oleg / 0_reuse_code.js
Created March 2, 2016 04:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@go-oleg
go-oleg / .gitignore
Last active February 11, 2016 23:29
websocket not receiving all messages before close
node_modules
// streaming outer join demo:
// process a mixed stream of customer info events and purchase events.
// join customer info onto purchases as they occur.
//
//
// fetch demo events from a GIST.
//
sub get_events() {
// (for real data, instead of this source command you would write filtered read commands below)
source "https://gist.githubusercontent.com/welch/85872ad486a56eb9556a/raw/984b1504f7036ff548d59b2a7cb500109779869f/events.json";

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:
@go-oleg
go-oleg / main.juttle
Last active August 29, 2015 14:18
time between events
reducer timeBetweenEvents(eventTypeField, eventStartType, eventEndType) {
var lastEventStartTime = null;
var eventDuration = null;
function update() {
if(*eventTypeField == eventStartType) {
lastEventStartTime = #time;
eventDuration = null;
}
else if(*eventTypeField == eventEndType && lastEventStartTime != null) {
eventDuration = #time - lastEventStartTime;
[
{
"time" : "2014-10-27T23:19:09.127Z",
"val10" : 20
},
{
"time" : "2014-10-27T23:20:09.127Z",
"val10" : 20
}
]
[
{
"time" : "2014-10-27T23:23:09.127Z",
"val1" : 1
},
{
"time" : "2014-10-27T23:24:09.127Z",
"val1" : 2
},
{