This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "services", | |
"preferGlobal": false, | |
"version": "0.0.1", | |
"description": "example services for serving vitals data from ElasticSearch ", | |
"main": "app.js", | |
"scripts": { | |
}, | |
"keywords": [ | |
"vitals", |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"name":"vitals_rt","hostname":"lech","pid":32736,"level":30,"msg":"vitals_rt listening at http://0.0.0.0:4001","time":"2013-12-14T23:32:05.618Z","v":0} | |
{"name":"vitals_rt","hostname":"lech","pid":32736,"level":30,"req":{"_readableState":{"highWaterMark":16384,"buffer":[],"length":0,"pipes":null,"pipesCount":0,"flowing":false,"ended":false,"endEmitted":false,"reading":false,"calledRead":false,"sync":true,"needReadable":false,"emittedReadable":false,"readableListening":false,"objectMode":false,"defaultEncoding":"utf8","ranOut":false,"awaitDrain":0,"readingMore":false,"decoder":null,"encoding":null},"readable":true,"domain":{"domain":null,"_events":{},"_maxListeners":10,"members":["[Circular]",{"domain":"[Circular]","_events":{},"_maxListeners":10,"output":[],"outputEncodings":[],"writable":true,"_last":false,"chunkedEncoding":false,"shouldKeepAlive":true,"useChunkedEncodingByDefault":true,"sendDate":true,"_headerSent":false,"_header":"","_hasBody":true,"_trailer":"","finished":false,"_hangupClose":false,"socke |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var restify = require('restify'); | |
var bunyan = require('bunyan'); | |
var restifySwagger = require('node-restify-swagger'); | |
var restifyValidation = require('node-restify-validation'); | |
var pathSep = "/"; | |
var processName = 'vitals_rt'; | |
var log = createLogger(processName); | |
var valid_increment_units = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', | |
'm','s','h','w','M' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET /vitals/vital/_search | |
{ | |
"size": 0, | |
"query": { | |
"match_all": {} | |
}, | |
"aggs": { | |
"min_time" : { | |
"min" : { | |
"field" : "recorded_time", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have a service that is defined below but when I get the swaggar UI, the type is always 'string'. Should isInt=true change the type? | |
server.get( | |
{ | |
url: pathSep + feedNoun, | |
swagger: { | |
summary: 'search by parameter for feeds', | |
notes: 'Status=Unstable', | |
nickname: 'get' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"template": "vitals_*", | |
"settings": { | |
"number_of_shards": 1, | |
"number_of_replicas": 0, | |
"term_index_interval": 128, | |
"refresh_interval": "5s", | |
"mapper.dynamic": false, | |
"compress": true, | |
"index.aliases": ["vitals"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "index" : {"_index" : "vitals_2014.01.31_idx", "_type" : "vital"} } | |
{ "recorded_time" : "2014-01-31T01:00:00.000-05:00", "user_guid" : "0ad08904-c1cf-46cf-9a04-e0865c1cced2", "device_guid" : "136bd969-c838-453f-ac58-63ec3419475b", "strokeVolume" : 43.1, "heartRate" : 50.9, "sp02" : 95.5, "respiratoryRate" : 57.9, "ptt": 84.6, "diastolic":1.1, "systolic":79.9, "hrv" : 62.3, "steps" : 18, "calories" : 16, "source" : "foo"} | |
{ "index" : {"_index" : "vitals_2014.01.31_idx", "_type" : "vital"} } | |
{ "recorded_time" : "2014-01-31T01:00:01.000-05:00", "user_guid" : "0ad08904-c1cf-46cf-9a04-e0865c1cced2", "device_guid" : "136bd969-c838-453f-ac58-63ec3419475b", "strokeVolume" : 38.7, "heartRate" : 6.0, "sp02" : 55.8, "respiratoryRate" : 51.6, "ptt": 0.2, "diastolic":22.4, "systolic":9.1, "hrv" : 31.7, "steps" : 95, "calories" : 5, "source" : "foo"} | |
{ "index" : {"_index" : "vitals_2014.01.31_idx", "_type" : "vital"} } | |
{ "recorded_time" : "2014-01-31T01:00:02.000-05:00", "user_guid" : "0ad08904-c1cf-46cf-9a04-e0865c1c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XGET "http://localhost:9200/vitals/vital/_search" -d' | |
{ | |
"size": 0, | |
"query": { | |
"filtered": { | |
"query": { | |
"match_all": {} | |
}, | |
"filter": { | |
"and": { |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"took" : 156, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 30, | |
"successful" : 30, | |
"failed" : 0 | |
}, | |
"hits" : { | |
"total" : 975299, |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ "index" : {"_index" : "vitals_2014.01.31_idx", "_type" : "vital"} } | |
{ "recorded_time" : "2014-01-31T00:00:00.000-05:00", "user_guid" : "0ad08904-c1cf-46cf-9a04-e0865c1cced2", "device_guid" : "136bd969-c838-453f-ac58-63ec3419475b", "strokeVolume" : 85.9, "heartRate" : 15.9, "sp02" : 5.7, "respiratoryRate" : 70.6, "ptt": 37.1, "diastolic":53.8, "systolic":6.2, "hrv" : 73.4, "steps" : 65, "calories" : 20, "source" : "foo"} | |
{ "index" : {"_index" : "vitals_2014.01.31_idx", "_type" : "vital"} } | |
{ "recorded_time" : "2014-01-31T00:00:01.000-05:00", "user_guid" : "0ad08904-c1cf-46cf-9a04-e0865c1cced2", "device_guid" : "136bd969-c838-453f-ac58-63ec3419475b", "strokeVolume" : 23.8, "heartRate" : 89.4, "sp02" : 87.4, "respiratoryRate" : 58.2, "ptt": 97.9, "diastolic":95.7, "systolic":75.2, "hrv" : 45.1, "steps" : 93, "calories" : 21, "source" : "foo"} | |
{ "index" : {"_index" : "vitals_2014.01.31_idx", "_type" : "vital"} } | |
{ "recorded_time" : "2014-01-31T00:00:02.000-05:00", "user_guid" : "0ad08904-c1cf-46cf-9a04-e0865 |