-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
我的查询 代码
let conn = self.td_conns.get(machine_index as usize).unwrap();
let query_clone = query.clone();
let result = conn.query(query_clone).await;
let mut result = match result {
Ok(result) => result,
Err(err) => {
return Err(format!("查询taos 错误 ,sql语句 is {}, err is {}", query, err));
}
};
如果 出现错误 ,如 查询的表不存在 , 在命令行打印为
Jan 29 01:41:07.621 INFO axum_study::controller::jian_pan_controller: 查询失败 "查询taos 错误 ,sql语句 is select 1 as sort_order ,'dcs_rhte' as tablename,'undefined' as description ,'' as label ,'1' as borderType ,'undefined' as unit, l
ast(ts) as ts ,last(pvalue) as pvalue from dcs_rhte order by sort_order ;, err is [0x2662] Internal error: `����������������������������������������������������������������������������������������������������������������������������������
��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������systS�x�`"
err 全都是乱码,无法显示
另外 这是我启动的代码
let start = Instant::now();
// 建立 taos 连接
let taos_futures: Vec<_> = config.cfg.iter().enumerate().map(|(index, cfg)| {
let dsn = format!("taos://{}:{}@{}:{}/{}", cfg.user, cfg.password, cfg.host, cfg.port, cfg.database);
info!("{}号机 taos 连接字符串为: {}", index + 1, dsn);
async move {
let builder = TaosBuilder::from_dsn(&dsn).map_err(|e| format!("创建 TaosBuilder 失败:{}", e))?;
builder.build().await.map_err(|e| format!("{}号机 taos 数据库连接失败:{}", index + 1, e))
}
}).collect();
// let taos = Vec::new();
let taos: Vec<_> = join_all(taos_futures)
.await
.into_iter()
.map(|db| db.unwrap_or_else(|e| panic!("taos 数据库连接失败:{}", e)))
.collect();
let duration = start.elapsed();
info!("建立taos 连接耗时为 :{:?}", duration);
启动完成后 发现 程序 占用内存 50多m ,注释掉这行代码 只用内存为 7m , 我尝试过不用futures ,然后 单个连接taos 数据库, 结果占用内存 48m , 连接同样的taos 数据库, c# 占用内存就少很多 ,只有 8m 多 ,不知道为什么
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels