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 5.02发布
5.02.00 May 27 2017 Important notes (changes that may break existing code) ========================= ...
- floor函数
C++中 可以用floor函数来截断小数部分 floor(x)返回一个不大于x的整数,有点像取整函数
- 2018.12.15 hdu4641 K-string(后缀自动机)
传送门 后缀自动机基础题. 题意简述:支持动态在串尾插入字符,查询在串中出现超过kkk次的子串的个数. 动态修改samsamsam,每次增量构造好了之后在parentparentparent树上从新建 ...
- springboot mybatis 分页整合
spring boot 整合mybatis ,分两块mybatis 整合,分页整合. 1.pom文件增加 <dependency> <groupId>org.mybatis ...
- vue-cli项目中使用rem
1.安装px2rem插件 npm install px2rem-loader lib-flexible --save 2.在main.js中引入lib-flexible import 'lib-fle ...
- create table b1 as select * from b建表锁表测试
A: create table a1 like a; insert into a1 as select * from a; B: create table b1 as select * from b; ...
- oss+上传文件夹
最近公司做工程项目,实现文件夹云存储上传. 网上找了一天,发现网上很多代码都存在相似问题,最后终于找到了一个满足我需求的项目. 工程如下: 这里对项目的文件夹传输功能做出分析,怎么实现文件夹上传的,如 ...
- std::string的find问题研究
https://files-cdn.cnblogs.com/files/aquester/std之string的find问题研究.pdf 目录 目录 1 1. 前言 1 2. find字符串 1 3. ...
- XML与DTD
什么是XML XML个称为Extensible Markup Language,意思是可扩展的标记语言. 应用常见 配置文件 <?xml version="1.0" enco ...
- Alpha冲刺 - (10/10)
Part.1 开篇 队名:彳艮彳亍团队 组长博客:戳我进入 作业博客:班级博客本次作业的链接 Part.2 成员汇报 组员1(组长)柯奇豪 过去两天完成了哪些任务 本人负责的模块(共享编辑)的前端代码 ...