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 ...
随机推荐
- Seaborn图形可视化库
一.绘图 1)快速生成图 import numpy as np import matplotlib.pyplot as plt def sinplot(filp=): x = np.linspace( ...
- 一波水题 MZOJ 1035: 贝克汉姆
#include <bits/stdc++.h> using namespace std; ; int n,m; int v[N],w[N],f[N]; int main() { scan ...
- 2018.10.27 bzoj1984: 月下“毛景树”(树链剖分)
传送门 唉蒟蒻又退化了,这道sb题居然做了20min,最后发现是updcovupdcovupdcov写成了updaddupdaddupdadd我还能说什么233233233 就是让你转边权为点权之后, ...
- 2018.10.24 bzoj2064: 分裂(状压dp)
传送门 状压dp好题. 考虑对于两个给出的集合. 如果没有两个元素和相等的子集,那么只能全部拼起来之后再拆开,一共需要n1+n2−2n1+n2-2n1+n2−2. 如果有呢? 那么对于没有的就是子问题 ...
- 牛客训练三:处女座和小姐姐(三)(数位dp)
题目链接:传送门 思路:数位dp的记忆化搜索模板 从高位向低位枚举,逐位确定每一位的6的个数,dp[i][s]表示处理到第i条边,状态为s时的数字的个数. 注意,要使用long long类型. #in ...
- 1-10假期训练(hdu-2059 简单dp)
题目一:传送门 思路:水题,模拟即可 题目二:传送门 思路:dp,决策每个充电站是否要充电.(决策只有搜索,DP两种解决方法) (1)考虑状态的个数,n+2个,因为除了n个还有位置0,终点len两种状 ...
- linux 修改yum 为阿里云源
为了加快yum的下载速度,我们可以讲yum源指向阿里云的资源. 操作方法: 1.备份系统的yum源 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repo ...
- 安装了nodejs后在命令行运行npm报错:Error: Cannot find module 'internal/util/types'
报错如下图所示: 解决方法:删除目录“C:\Users\wls\AppData\Roaming\npm\node_modules”下的npm文件夹
- hadoop学习笔记-目录
以下是hadoop学习笔记的顺序: hadoop学习笔记(一):概念和组成 hadoop学习笔记(二):centos7三节点安装hadoop2.7.0 hadoop学习笔记(三):hdfs体系结构和读 ...
- dj 用户认证组件
auth模块 from django.contrib import auth django.contrib.auth中提供了许多方法,主要的三个: 1.1 authenticate() 提供了用户认证 ...