graphite custom functions
尊重作者的劳动,转载请注明作者及原文地址 http://www.cnblogs.com/txwsqk/p/6522854.html
参考 https://graphite.readthedocs.io/en/latest/functions.html#function-plugins
/opt/graphite/webapp/graphite/settings.py
# Function plugins
FUNCTION_PLUGINS = ['linkedme.aliasByMap',]
/opt/graphite/webapp/graphite/functions/custom# ls
__init__.py __init__.pyc linkedme.py linkedme.pyc
我添加了一个自定义函数 cat linkedme.py
#coding:utf-8
from graphite.functions.params import Param, ParamTypes def aliasByMap(requestContext, seriesList):
kv = {
'':'你想展示的内容',
}
for series in seriesList:
series.name = kv[series.name]
return seriesList aliasByMap.group = 'Alias'
aliasByMap.params = [
Param('seriesList', ParamTypes.seriesList, required=True),
] SeriesFunctions = {
'aliasByMap': aliasByMap,
}
这样 grafana 中就可以使用了
graphite custom functions的更多相关文章
- [翻译] Using Custom Functions in a Report 在报表中使用自己义函数
Using Custom Functions in a Report 在报表中使用自己义函数 FastReport has a large number of built-in standard ...
- [SCSS] Write Custom Functions with the SCSS @function Directive
Writing SCSS @functions is similar to writing functions in other programming languages; they can acc ...
- Underscore 整体架构浅析
前言 终于,楼主的「Underscore 源码解读系列」underscore-analysis 即将进入尾声,关注下 timeline 会发现楼主最近加快了解读速度.十一月,多事之秋,最近好多事情搞的 ...
- 如何设置Vimrc
.title { text-align: center } .todo { font-family: monospace; color: red } .done { color: green } .t ...
- HTML5资料
1 Canvas教程 <canvas>是一个新的用于通过脚本(通常是JavaScript)绘图的HTML元素.例如,他可以用于绘图.制作图片的组合或者简单的动画(当然并不那么简单).It ...
- window下安装jupyter
1.Install [Anaconda](https://docs.continuum.io/anaconda/install#anaconda-install) 实际上安装了anaconda就已经安 ...
- vim operation
note: 转自 www.quora.com ,很好的网站. 具体链接如下: https://www.quora.com/What-are-some-impressive-demos-of-Vim- ...
- taglib 自定义标签
自定义<%@ taglib prefix="cf" uri="http://training.bmcc.com.cn/tld/functions"%> ...
- WordPress 主题开发 - (六) 创建主题函数 待翻译
We’ve got a file structure in place, now let’s start adding things to them! First, we’re going to ad ...
随机推荐
- 第一个kbmmw for Linux 服务器
从kbmmw 5.01 开始,就正式支持delphi 10.2 和Linux 了. 今天我们就建一个 kbmmw for linux 服务器简单说一下. 本例子基于上次的linux Daemon例子 ...
- socketserver模块实现并发和连接合法性验证
一.socketserver模块 1.sockeserver的源码流程 2.简单的使用 socketserver服务端 import socketserver class MyServer(socke ...
- 671. Second Minimum Node In a Binary Tree
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode ...
- k-SLAM:k-mer Sorted List Alignment and Metagenomics
k-SLAM 是基于大量高通量宏基因组序列数据分析的比对程序,它基于k-mer技术上在reads和序列之间进行比较,然后用Smith-Waterman算法验证.校准是连接在一起组成一个伪组装用来提高特 ...
- hdu-1036(格式题+精确度)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1036 心得:注意,要进行四舍五入的精确可以用+0.5实现. #include<iostream& ...
- (5)How to let go of being a "good" person — and become a better person
https://www.ted.com/talks/dolly_chugh_how_to_let_go_of_being_a_good_person_and_become_a_better_perso ...
- 新加了一块硬盘,在bios中可以看的到,在系统的磁盘管理器中看不到新加硬盘
今天新加了一块硬盘,进入bios中可以看到新加的硬盘,但是进入系统后在磁盘管理及磁盘驱动器中都看不到.并且在设备管理器下其他设备出现了ATA channel1,前面显示感叹号,如下图所示: 而且电脑变 ...
- python:浅拷贝与深拷贝
1,“相等”与“相同” 我们先赋值三个变量a, b, c: a = [1, 2, [1, 2]] b = [1, 2, [1, 2]] c = a 判断一下‘相等’: a == b 返回 True ...
- Java潜在的坑持续总结
1.Java里如果有if (foo == 0),如果foo是null这里居然是会抛NPE异常而不是返回false: 2.Java里整形数值不能用==来比较,因为只有区间是[-128,127]的才能这么 ...
- 添加wifi adb
https://blog.csdn.net/ouyang_peng/article/details/50370786 首先弄懂怎么设置adb wifi无线调试的功能,如下所示. 1. 手机端开启adb ...