1 Star 0 Fork 0

runner-mei/tsproxy

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README

ts proxy

因为 tsdb 数据库的表结构中, 没有 管理对象的 详细信息,只有一个 id 字段, 如 cpu 指标的表结构如下

managed_object_id int
cpu               int
time              timestamp

但是我们在写 sql 时希望这样写

select * from cpu where mo_address = '127.0.0.1' and time > now()-1h

所以我们写了这个代理, 它将 上面语句中的 mo_address = '127.0.0.1' 提取出来,将设备 127.0.0.1 的 ID 从 其它数据库(或系统) 中查询出来, 然后将 sql 改写成

select * from cpu where managed_object_id = 36 and time > now()-1h

// 注意这个 36 是 设备 127.0.0.1 的 ID

Empty file

About

tsdb 的代理工具 expand collapse
Go
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/runner.mei/tsproxy.git
git@gitee.com:runner.mei/tsproxy.git
runner.mei
tsproxy
tsproxy
master

Search