fh-messaging-client
v1.0.5
Published
client for calling fh-messaging
Downloads
2
Keywords
Readme
fh-messaging-client
client for interfacing with fh-messaging both in the core and the mbaas
usage:
var fhMessaging = require('fh-messaging-client')(metricsConfig)
fhMessaging.createAppMessage(topic,message,cb)
//topic is normally fhact
//message is an object generated by the reporting client normally:
{
guid:string (instance app id),
appid:string (widget project id),
domain:string,
bytes:fullparams.bytes, //number
cached:false,
cuid:_fh.cuid || "",
destination:_fh.destination || "",
agent: fullparams.agent,
'function':fullparams.funct || "",
ipAddress:ip,
scriptEngine:"node",
'status':fullparams.status || "",
time:fullparams.time || 0,
startTime : fullparams.start,
endTime : fullparams.end,
'version':_fh.version || 0}
/*
*
* @param from Number timestamp
* @param to Number timestamp
* @param level string (domain/app)
* @param data Object (rolled up metrics)
* @param cb function
* @desc from and to are the time range the metrics being sent covers. The level is either domain or app and the data is rolled up metrics being sent
*/
fhMessaging.sendMbaasMetrics(from, to , level, data, cb);