用grafana制作timeseries数据动画

grafanimate的Python项目详细描述


https://img.shields.io/badge/Python-2.7-green.svghttps://img.shields.io/pypi/v/grafanimate.svghttps://img.shields.io/github/tag/daq-tools/grafanimate.svg

grafanimate

用grafana制作timeseries数据的动画。

关于

grafanimate在设置动画时捕获屏幕快照 通过操纵仪表板的time range control, 即在时间中导航。结果可以呈现为 png图像序列、动画gif文件和视频文件。

注意!

这个程序可以给grafana实例带来很大的负载 以及底层的数据库机器。小心处理!

示例

组成The Hiveeyes Project。开发一个灵活的蜂箱监控基础设施。 点击一张图片将带你进入动画版本。

luftdaten.info覆盖范围

https://ptrace.hiveeyes.org/2018-12-28_luftdaten-info-coverage.gif

从2015年10月起覆盖整个欧洲的Luftdaten.info传感器。

除夕微尘污染

红外传感器SVG像素映射
https://ptrace.hiveeyes.org/2019-02-04_acUXbj_mz_2018-08-14T03-16-12.png

显示蜂巢内温度变化的红外传感器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

背景和细节

简介 在精神轴的时间轴上做动画。 的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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java JTable无法向新创建的列添加值   java如何调整JEditorPane中编辑区域的大小?   Java通过反射确定未知数组中的数组大小   java Intellij Idea有时无法按其预期的方式构建应用程序   java Swing GUI带有IntelliJ错误“contentPane不能设置为null”从终端编译时   如何将这些通用方法调用从C#转换为Java   在null上找不到java属性或字段“index”   从Java HashMap获取整数值时是否需要调用intValue()方法?   java Android谷歌地图获取相机中的图像块   unix无法捕获JAVA中“who m”命令的输出   java,同时将邮件发送到“收件人”标题“我”中的多个收件人   在java中向链表添加未知数量的节点   无法为Heroku上的discord bot设置java端口   java使用Apache HttpClient进行选项请求   与元素类型“ApplicationName”关联的属性“Application Version”需要java Open quote   Android Studio Java中的两个变量求和