作者:王瑾瑜2702935333 | 来源:互联网 | 2023-09-10 18:23
Iamtryingtosenddatatographitecarbon-cacheprocessonport2003using我正在尝试使用在2003端口上向石墨碳缓存进
I am trying to send data to graphite carbon-cache process on port 2003 using
我正在尝试使用在2003端口上向石墨碳缓存进程发送数据
1) Ubuntu terminal
1)Ubuntu终端
echo "test.average 4 `date +%s`" | nc -q0 127.0.0.1 2003
2) NODEJS
2)NODEJS
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 ?
当我在我的ubuntu上使用终端窗口命令发送数据时,它工作正常。但是,我不知道如何从nodejs发送时间戳unix epoch格式?
Grpahite understands metric in this format metric_path value timestamp\n
Grpahite以此格式度量度量标准度量路径值时间戳\ n
3 个解决方案