【Grafana】連接mssql並圖表顯示

在这里插入图片描述


在这里插入图片描述
在这里插入图片描述

在这里插入图片描述


1. 函數

Macro exampleReplaced by
$__time(dateColumn)An expression to rename the column to time. For example, dateColumn as time
$__timeEpoch(dateColumn)An expression to convert a DATETIME column type to Unix timestamp and rename it to time.
For example, DATEDIFF(second, ‘1970-01-01’, dateColumn) AS time
$__timeFilter(dateColumn)A time range filter using the specified column name.
For example, dateColumn BETWEEN ‘2017-04-21T05:01:17Z’ AND ‘2017-04-21T05:06:17Z’
$__timeFrom()The start of the currently active time selection. For example, ‘2017-04-21T05:01:17Z’
$__timeTo()The end of the currently active time selection. For example, ‘2017-04-21T05:06:17Z’
$__timeGroup(dateColumn,'5m'[, fillvalue])An expression usable in GROUP BY clause. Providing a fillValue of NULL or floating value will automatically fill empty series in timerange with that value.
For example, CAST(ROUND(DATEDIFF(second, ‘1970-01-01’, time_column)/300.0, 0) as bigint)*300.
$__timeGroup(dateColumn,'5m', 0)Same as above but with a fill parameter so missing points in that series will be added by grafana and 0 will be used as value.
$__timeGroup(dateColumn,'5m', NULL)Same as above but NULL will be used as value for missing points.
$__timeGroup(dateColumn,'5m', previous)Same as above but the previous value in that series will be used as fill value if no value has been seen yet NULL will be used (only available in Grafana 5.3+).
$__timeGroupAlias(dateColumn,'5m')Same as $__timeGroup but with an added column alias (only available in Grafana 5.3+).
$__unixEpochFilter(dateColumn)A time range filter using the specified column name with times represented as Unix timestamp. For example, dateColumn > 1494410783 AND dateColumn < 1494497183
$__unixEpochFrom()The start of the currently active time selection as Unix timestamp. For example, 1494410783
$__unixEpochTo()The end of the currently active time selection as Unix timestamp. For example, 1494497183
$__unixEpochNanoFilter(dateColumn)A time range filter using the specified column name with times represented as nanosecond timestamp. For example, dateColumn > 1494410783152415214 AND dateColumn < 1494497183142514872
$__unixEpochNanoFrom()The start of the currently active time selection as nanosecond timestamp. For example, 1494410783152415214
$__unixEpochNanoTo()The end of the currently active time selection as nanosecond timestamp. For example, 1494497183142514872
$__unixEpochGroup(dateColumn,'5m', [fillmode])Same as $__timeGroup but for times stored as Unix timestamp (only available in Grafana 5.3+).
$__unixEpochGroupAlias(dateColumn,'5m', [fillmode])Same as above but also adds a column alias (only available in Grafana 5.3+).

2. Demo

2.1 Query

  • demo01
    在这里插入图片描述
  • demo02
    在这里插入图片描述

2.2 Query

  • 官方提供的函數,底層查詢使用的時間會減少8小時
    在这里插入图片描述
  • 所有,代碼插入DB的時候要減8小時
    在这里插入图片描述
  • 顯示的時候再加回來
    在这里插入图片描述

3. Awakening

1.1 Big Data – Postgres

     在一秒钟内看到本质的人和花半辈子也看不清一件事本质的人,自然是不一样的命运。

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

百世经纶『一页書』

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值