These are chat archives for juttle/juttle

14th
Jan 2016
Daria Mehra
@dmehra
Jan 14 2016 00:35
@rlgomes and I started thinking about testing needed at the adapter level, see notes here https://github.com/juttle/juttle/wiki/Adapter-Test-Checklist
Rodney Lopes Gomes
@rlgomes
Jan 14 2016 05:41
@dmehra one idea I had for the adapter test checklist would be to apply it to an existing adapter and use the adapter tests as linked examples to the wiki document.
maybe I could start by doing this for the built in http adapter first
David Majda
@dmajda
Jan 14 2016 11:17
Little bit of language usability testing: in your opinion, what should be the value of s in this code and why:
const c1 = null;
const c2 = 5;
const c3 = "abcd";
const c4 =  :2016-01-01 12:34:56:;

const s = "Interpolated: ${c1} ${c2} ${c3} ${c4}";
And what should be the value of s here:
David Majda
@dmajda
Jan 14 2016 11:25
const c1 = [ null, 5, "abcd",  :2016-01-01 12:34:56: ];
const c2 = { a: null, b: 5, c: "abcd", d: :2016-01-01 12:34:56: };
const c3 = [];
const c4 = {};

const s = "Interpolated: ${c1} ${c2} ${c3} ${c4}";
Rodney Lopes Gomes
@rlgomes
Jan 14 2016 16:44
First one "would/should" give "Interpolated: null 5 abcd 2016-01-01T01:01T12:34:56.000Z" while the second would give "Interpolated: [ null, 5, "abcd", "2016-01-01T01:01T12:34:56.000Z" ] { a: null, b: 5, c: "abcd", d: "2016-01-01T01:01T12:34:56.000Z" } [] {}" ? I'd guess this would be the behavior as most languages simple go with whatever the .toString() method of each type is and place it in that position in the string. But there are issues with the two examples I put like the fact that within an array and object strings aren't naked but they are on their own.
slightly tweaked initial answer to account for a valid string representation of the moments
Michael Demmer
@demmer
Jan 14 2016 16:52
I generally agree --
Daria Mehra
@dmehra
Jan 14 2016 16:52
I'm +1 including quoting of strings inside objects; if we didn't do that, interpolating c5 = { a: '' } would be a problem.
Michael Demmer
@demmer
Jan 14 2016 16:53
one thing to keep in mind is how we handle object keys that aren't simple strings -- seems like we would want to quote the keys as well in that case. Maybe in all cases ?
Rodney Lopes Gomes
@rlgomes
Jan 14 2016 16:53
yeah I'm thinking about objects ... but they should be in a format that if you copied into the node repl they'd recreate the object (minus functions)
so yes the keys wrapped in quotes would be better since some keys could be my-field
David Cook
@davidbcook
Jan 14 2016 17:05
Hey jutis, whenever I try to use timechart I get this error: We couldn't draw the chart because the selected valueField "heartrate.hr" must be numeric.
My program looks like this:
read file -file 'Archive/Philadelphia/IP6_Beacon_03/juttle-IP6_BEACON_03-00004.json' -timeField 'timestamp'
| view timechart -title 'Heartrate Over Time' -valueField 'audio.average'
I've tried it with different valueFields that are all numeric in the JSON and still get the same error. Has anyone run into similar problems?
Rodney Lopes Gomes
@rlgomes
Jan 14 2016 17:08
share a few lines of the json file ? (just to poke at it on my side)
David Cook
@davidbcook
Jan 14 2016 17:10
{"accel.x": -0.0859375, "event": "10 - Fox Jingle - First drum", "event_number": 1, "city": "Chicago", "battery": 98, "unixtimestamp": 1448931569.062556, "accel.z": -0.960113525390625, "stats.rmsAll": 0.5799751877784729, "device_id": "IP6_BEACON_03", "accel.rms": 0.5799751877784729, "accel.y": -0.282684326171875, "accel.timestamp": "2015-12-01T00:59:29.068368", "timestamp": "2015-12-01T00:59:29.062556"} {"accel.x": -0.08099365234375, "event": "10 - Fox Jingle - First drum", "stats.rmsAll": 0.5825551152229309, "heartrate.id": "3", "city": "Chicago", "unixtimestamp": 1448931569.153789, "battery": 98, "heartrate.hrv2": 564, "heartrate.timestamp": "2015-12-01T00:59:29.092202", "accel.z": -0.9643707275390625, "event_number": 1, "heartrate.hr": 109, "device_id": "IP6_BEACON_03", "heartrate.hrv1": 564, "accel.rms": 0.5825551152229309, "accel.y": -0.285552978515625, "accel.timestamp": "2015-12-01T00:59:29.167373", "timestamp": "2015-12-01T00:59:29.153789"} {"accel.x": -0.082794189453125, "event": "10 - Fox Jingle - First drum", "event_number": 1, "city": "Chicago", "battery": 98, "unixtimestamp": 1448931569.256649, "accel.z": -0.9624176025390625, "stats.rmsAll": 0.5808379650115967, "device_id": "IP6_BEACON_03", "accel.rms": 0.5808379650115967, "accel.y": -0.281097412109375, "accel.timestamp": "2015-12-01T00:59:29.266380", "timestamp": "2015-12-01T00:59:29.256649"} {"accel.x": -0.0828399658203125, "event": "10 - Fox Jingle - First drum", "event_number": 1, "city": "Chicago", "battery": 98, "unixtimestamp": 1448931569.356653, "accel.z": -0.9635009765625, "stats.rmsAll": 0.581386923789978, "device_id": "IP6_BEACON_03", "accel.rms": 0.581386923789978, "accel.y": -0.2807769775390625, "accel.timestamp": "2015-12-01T00:59:29.365387", "timestamp": "2015-12-01T00:59:29.356652"} {"accel.x": -0.08074951171875, "event": "10 - Fox Jingle - First drum", "event_number": 1, "city": "Chicago", "battery": 98, "unixtimestamp": 1448931569.455442, "accel.z": -0.95709228515625, "stats.rmsAll": 0.5780117511749268, "device_id": "IP6_BEACON_03", "accel.rms": 0.5780117511749268, "accel.y": -0.2823944091796875, "accel.timestamp": "2015-12-01T00:59:29.464400", "timestamp": "2015-12-01T00:59:29.455441"}
Daria Mehra
@dmehra
Jan 14 2016 17:11
Your program has no -from/-to I wonder if that's confusing the timechart? We had a related issue that I thought was fixed; @go-oleg ?
Rodney Lopes Gomes
@rlgomes
Jan 14 2016 17:13
are these actua llines from a .json file ? asking because not seeing a separator between those {} objects
so this looks more like jsonl
Oleg Seletsky
@go-oleg
Jan 14 2016 17:14
I don’t think thats the issue here, @davidbcook , i’m not seeing the audio.average field in there
David Cook
@davidbcook
Jan 14 2016 17:14
haha you're right, there are no commas, though that didn't stop table from displaying the data
@go-oleg yeah it's not in that snippet but you can try another field
Rodney Lopes Gomes
@rlgomes
Jan 14 2016 17:15
I'm wondering what the underlying parser is doing here as its not failing either... if these is a jsonl file then simply supply -format "jsonl" to the read file
David Cook
@davidbcook
Jan 14 2016 17:17
@rlgomes same error
Michael Demmer
@demmer
Jan 14 2016 17:19
@davidbcook this worked fine for me:
read file -file '/tmp/data.json' -timeField 'timestamp' | keep time, 'accel.x' | view timechart -valueField ‘accel.x’
Rodney Lopes Gomes
@rlgomes
Jan 14 2016 17:19
seems like once you hit a value that is not numerical (ie is null things go kaboom)
with those few lines this finally fixed the issue;
Michael Demmer
@demmer
Jan 14 2016 17:20
it works without the keep as well but timechart thinks the other fields are part of the series key
Rodney Lopes Gomes
@rlgomes
Jan 14 2016 17:20
read file -file '/home/rlgomes/caca.json' -timeField 'timestamp'                                                                                                        
| filter *'heartrate.hr' != null
| (view timechart -title 'Heartrate Over Time' -valueField 'heartrate.hr'
;
view text)
ie the issue is that hearrate.hr in those other linesdoesn't exist and timechart sees a null and freaks out and doesn't render what it actually got
so @davidbcook just filter on valueField != null for and I believe the timechart should render what it does get and for the points without the valueField those should be simply ignored or better just a warning displayed
David Cook
@davidbcook
Jan 14 2016 17:25
sweet! that works! thanks so much guys!! I have to pull together a report of the key intense moments of a movie today and using juttle will make that so much easier for me
Michael Demmer
@demmer
Jan 14 2016 17:25
great!
Rodney Lopes Gomes
@rlgomes
Jan 14 2016 17:26
great, meanwhile I'll file a bug in juttle-viz for this
David Cook
@davidbcook
Jan 14 2016 17:26
thanks!
David Cook
@davidbcook
Jan 14 2016 17:42
Does anyone remember the option for the events sink to get the values of a field in the tooltip? I've tried -labelField and -textField to no avail
Oleg Seletsky
@go-oleg
Jan 14 2016 17:42
-messageField and -nameField
David Cook
@davidbcook
Jan 14 2016 17:43
of course!
those docs are much more helpful than where I was looking (https://github.com/juttle/juttle/blob/master/docs/sinks/view.md)
thank you!
Michael Demmer
@demmer
Jan 14 2016 17:44
seems like we should have a link to the juttle-viz docs in that page
David Cook
@davidbcook
Jan 14 2016 17:47
yeah that might help ;) the examples section of this page would be a good place too https://github.com/juttle/juttle
Michael Demmer
@demmer
Jan 14 2016 18:03
@rlgomes can you look at this travis failure:
Rodney Lopes Gomes
@rlgomes
Jan 14 2016 18:05
did you rebase your branch since I merged this: juttle/juttle@39a4431
Michael Demmer
@demmer
Jan 14 2016 18:08
not sure but i will rebase now and push