7 个版本
使用旧的 Rust 2015
0.2.3 | 2020 年 11 月 16 日 |
---|---|
0.2.1 | 2018 年 5 月 15 日 |
0.1.3 | 2017 年 10 月 25 日 |
0.1.2 | 2016 年 12 月 14 日 |
#319 在 WebSocket
用于 rustneat
735KB
534 代码行
包含 (WOFF 字体, 24KB) glyphicons-halflings-regular.woff, (WOFF 字体, 19KB) glyphicons-halflings-regular.woff2
Rust 实时遥测,包含 http 服务器、仪表板和 WebSocket。
** 运行示例 ** cargo run --example dashboard --features=telemetry
然后访问 https://127.0.0.1:3000 等待几秒钟,查看仪表板遥测
** 如何使用 ** 在你的 Cargo.toml 中导入库
[dependencies]
rusty_dashed = *
并将遥测宏添加到你的代码中
#[macro_use]
extern crate rusty_dashed;
fn main(){
let mut dashboard = Dashboard::new();
dashboard.add_graph("mydashboard_id", "myd3jsFunction", 0, 0, 4, 4);
let throttle = 0.01; #only 1 percent of the messages will be sended (1 to all)
telemetry!("mydashboard_id", throttle, format!("[{myid:'id1', myvalue:1}]")
}
然后创建一个名为 graphs
的文件夹,包含两个文件 myd3jsFunction.js
和 myd3jsFunction.css
开发 运行 cargo run --example dashboard --features "debug_static telemetry" --no-default-features
以编辑公共文件而不重新构建
依赖项
~9MB
~196K SLoC