flightstats / node-insights

Submit data to New Relic Insights
7 stars 1 forks source link

support nrql construction from a javascript object #8

Closed cirne closed 9 years ago

cirne commented 9 years ago

Hey! Lew Cirne here, founder and CEO at New Relic. Love that you are doing an npm package for Insights. I began some work on something similar but never published. I frequently create queries of simple JS objects, similar to the model introduced by Rails ActiveRecord. Hope you like it!

Cheers!

/cc @wraithan @groundwater

mattpage commented 9 years ago

This is cool. I'll go ahead and merge it despite the fact that you hate semicolons :P Thanks!

cirne commented 9 years ago

Hah my bad. I actually like semicolons; I just sometimes forget, and I blame @groundwater as an enabler. Too much time in Ruby.

mattpage commented 9 years ago

No worries. That's published as 1.0.7. The test coverage shows that:

  if(params.compare) {
    nrql += " COMPARE WITH " + params.compare;
  }

is not being tested.

I'm not familiar with 'compare with', is there a simple test param for that?

If you are curious, you can generate the test coverage like so:

npm install istanbul -g
grunt coverage
open ./coverage/lcov-report/index.html #or however you want to open in a browser
groundwater commented 9 years ago

What semicolons :hear_no_evil: :see_no_evil:

:smiley: