我正在从这样的代码中查询inlfluxdb数据库。如何处理从代码查询influxdb数据库获得的结果
q := fmt.Sprintf("select step,timeTaken from ZtpBoot where cvpVersion =
2017.1.1 group by step,numberOfDevices"
res, _ := queryDB(clnt, q)
Result when executing query in influxdb is like:-
name: ZtpBoot
tags: numberOfDevices=2, step=Step3.verifyZtpViaPost
time step timeTaken
---- ---- ---------
1495540747000000000 Step3.verifyZtpViaPost 0.108520030975
1495541643000000000 Step3.verifyZtpViaPost 0.115226984024
name: ZtpBoot
tags: numberOfDevices=2, step=Step4.verifyZtpViaHttp
time step timeTaken
---- ---- ---------
1495540747000000000 Step4.verifyZtpViaHttp 0.100101947784
1495541643000000000 Step4.verifyZtpViaHttp 0.103901863098
我如何处理从res,_:= queryDB(clnt,q)获取的res以显示如表中所示的结果。
yes我看着它,但我不能得到我想要的输出:(。 – supriya
当你运行'fmt.Printf(“Res:%v \ nType:%T \ n”, res,res)'? – jrefior
我得到了这个 - > Res:[{[{ZtpBoot map [numberOfDevices:1 step:Step1.dhcpSetupTime] [time step timeTaken] [[2017-05-16T10:09:44Z Step1.dhcpSetupTime [2017-05-16] [2017-05-16 \ T10:17:14Z Step1.dhcpSetupTime 0.893213033676] [2017-05-16T10:24:44Z Step1.dhcpSetupTime 0.476826906204] [2017-05-16T10:32:17Z Step1.dhcpSetupTime 0.80868196 \ 4874] [2017-05-16T10:42:39Z Step1.dhcpSetupTime 0.484630823135] [2017-05-23T12:14:03Z totalRunTime 4 \ 19.631438017]] false}] []}] 类型:[] client.Result – supriya