Node.js - How to generate timestamp unix epoch format?
I am trying to send data to graphite carbon-cache process on port 2003 using
Ubuntu terminal:
echo "test.average 4 `date +%s`" | nc -q0 127.0.0.1 2003
Node.js:
var socket = net.createConnection(2003, "127.0.0.1", function() {
socket.write("test.average "+assigned_tot+"\n");
socket.end();
});
It works fine when i send data using the terminal window command on my ubuntu. However, i am not sure how to send timestamp unix epoch format from nodejs ?
Grpahite understands metric in this format metric_path value timestamp
Thanks!