用grafana制作timeseries数据动画
grafanimate的Python项目详细描述
grafanimate
用grafana制作timeseries数据的动画。
关于
grafanimate在设置动画时捕获屏幕快照 通过操纵仪表板的time range control, 即在时间中导航。结果可以呈现为 png图像序列、动画gif文件和视频文件。
注意!
这个程序可以给grafana实例带来很大的负载 以及底层的数据库机器。小心处理!
示例
组成:The Hiveeyes Project。开发一个灵活的蜂箱监控基础设施。 点击一张图片将带你进入动画版本。
luftdaten.info覆盖范围
- 数据源:luftdaten.info(本地设计院)
- 生产:Luftdatenpumpe,LDI data plane v2,每日。
- 开发:Erneuerung der Luftdatenpumpe。欢迎所有投稿。
除夕微尘污染
- 数据源:luftdaten.info(本地设计院)
- 生产:Luftdatenpumpe,LDI data plane v2,历史。
- 开发:Erneuerung der Luftdatenpumpe。欢迎所有投稿。
红外传感器SVG像素映射
使用量
$ grafanimate --help Usage: grafanimate [options] [--target=<target>]... grafanimate --version grafanimate (-h | --help) Options: --grafana-url=<url> Base URL to Grafana, [default: http://localhost:3000]. --scenario=<scenario> Which scenario to run. Scenarios are defined as methods. --dashboard-uid=<uid> Grafana dashboard uid. Optional: --panel-id=<id> Render single panel only by navigating to "panelId=<id>&fullscreen". --dashboard-view=<mode> Use Grafana's "d-solo" view for rendering single panels without header. --header-layout=<layout> The header rendering subsystem offers different modes for amending the vanilla Grafana user interface. Multiple modes can be combined. [default: large-font] - no-chrome: Set kiosk mode, remove sidemenu and more chrome - large-font: Use larger font sizes for title and datetime - collapse-datetime: Collapse datetime into title - studio: Apply studio modifications. This options aggregates "no-chrome", "large-font" and "collapse-datetime". - no-folder: Don't include foldername in title - no-title: Turn off title widget - no-datetime: Turn off datetime widget --datetime-format=<format> Datetime format to use with header layouts like "studio". Examples: YYYY-MM-DD HH:mm:ss, YYYY, HH:mm. There are also some format presets available here: - human-date: on 2018-08-14 - human-time: at 03:16:05 - human-datetime: on 2018-08-14 at 03:16:05 When left empty, the default is determined by the configured interval. --debug Enable debug logging -h --help Show this screen Examples for scenario mode. Script your animation in file "scenarios.py". # Generate sequence of .png files in ./var/spool/ldi_all/1aOmc1sik grafanimate --grafana-url=http://localhost:3000/ --scenario=ldi_all --dashboard-uid=1aOmc1sik # Use more parameters to control the rendering process. grafanimate --grafana-url=http://localhost:3000/ --scenario=ir_sensor_svg_pixmap --dashboard-uid=_TbvFUyik --header-layout=studio --datetime-format=human-time --panel-id=6
设置
先决条件
这个程序使用精细的ffmpeg来完成繁重的工作。
grafanimate注意
由于火狐的木偶不适用于Python3,
此程序仅适用于Python2。我们建议安装
程序变成了python的virtualenv。
virtualenv --python=python2 .venv2
source .venv2/bin/activate
pip install grafanimate
注意
由于火狐的木偶不适用于Python3, 此程序仅适用于Python2。我们建议安装 程序变成了python的virtualenv。
virtualenv --python=python2 .venv2 source .venv2/bin/activate pip install grafanimate
背景和细节
简介 在精神轴的时间轴上做动画。 的GeoLoop Panel Plugin尚未为Grafana解锁 以一种更普遍的方式。接受挑战!
时间扭曲
程序的核心是set time range in Grafana:
timeSrv = angular.element('grafana-app').injector().get('timeSrv'); timeSrv.setTime({from: "2015-10-01", to: "2018-12-31"});
渲染引擎
海龟一路向上,主要的渲染工作是一个火狐浏览器 自动通过Marionette Python Client名声:
The Marionette Python client library allows you to remotely control a Gecko-based browser or device which is running a Marionette server.
展望
无论是Playlists还是Scripted Dashboards都不提供这些东西 对用户来说,但是这个程序可以按照 在grafana之上实现更复杂的动画。
项目信息
grafanimate在gnu agpl v3许可下发布。
代码位于GitHub上,并且 python包被发布到PyPI。
该软件已经在Python2.7上进行了测试。
贡献
我们总是乐于接受代码贡献、想法、建议 以及来自社区的问题报告。 花点时间四处看看,找出一个bug,设计问题或者 拼写错误,然后向我们发送拉取请求或创建问题。
许可证
此程序是免费软件;您可以重新分发和/或修改 根据由 自由软件基金会;许可证的第3版,或者 (由您选择)任何更高版本。
这个程序是分布式的特德希望它会有用, 但没有任何保证;甚至没有 适销性或适合某一特定目的的适销性。见 GNU通用公共许可证了解更多详细信息。
你应该收到一份gnu-affero通用公共许可证的副本 与此程序一起;如果没有,请参阅: <;http://www.gnu.org/licenses/agpl-3.0.txt>;, 或者写信给自由软件基金会, 美国马萨诸塞州波士顿富兰克林街51号,5楼,邮编:02110-1301