当前位置: 首页>>代码示例>>Java>>正文


Java ConsolFuns类代码示例

本文整理汇总了Java中org.jrobin.core.ConsolFuns的典型用法代码示例。如果您正苦于以下问题:Java ConsolFuns类的具体用法?Java ConsolFuns怎么用?Java ConsolFuns使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ConsolFuns类属于org.jrobin.core包,在下文中一共展示了ConsolFuns类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initGraphSource

import org.jrobin.core.ConsolFuns; //导入依赖的package包/类
private void initGraphSource(RrdGraphDef graphDef, int height, boolean maxHidden) {
	final String dataSourceName = getDataSourceName();
	final String average = "average";
	graphDef.datasource(average, rrdFileName, dataSourceName, ConsolFuns.CF_AVERAGE);
	graphDef.setMinValue(0);
	final String moyenneLabel = I18N.getString("Moyenne");
	graphDef.area(average, getPaint(height), moyenneLabel);
	graphDef.gprint(average, ConsolFuns.CF_AVERAGE, moyenneLabel + ": %9.0f %S\\r");
	//graphDef.gprint(average, ConsolFuns.CF_MIN, "Minimum: %9.0f %S\\r");
	if (!maxHidden) {
		final String max = "max";
		graphDef.datasource(max, rrdFileName, dataSourceName, "MAX");
		final String maximumLabel = I18N.getString("Maximum");
		graphDef.line(max, Color.BLUE, maximumLabel);
		graphDef.gprint(max, ConsolFuns.CF_MAX, maximumLabel + ": %9.0f %S\\r");
	}
	// graphDef.comment("JRobin :: RRDTool Choice for the Java World");
}
 
开发者ID:javamelody,项目名称:javamelody,代码行数:19,代码来源:JRobin.java

示例2: determineConsolidationFun

import org.jrobin.core.ConsolFuns; //导入依赖的package包/类
private String determineConsolidationFun(Statistic.Type type) {
    switch (type) {
        case count:
            return ConsolFuns.CF_LAST;
        default:
            return ConsolFuns.CF_AVERAGE;
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:9,代码来源:StatsEngine.java

示例3: getData

import org.jrobin.core.ConsolFuns; //导入依赖的package包/类
@Override
public double[][] getData(long startTime, long endTime, int dataPoints) {
    // Our greatest datapoints is 60 so if it is something less than that
    // then we want an average.
    return fetchData((dataPoints != 60 ? ConsolFuns.CF_AVERAGE : consolidationFunction),
            startTime, endTime, dataPoints);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:8,代码来源:StatsEngine.java

示例4: getData

import org.jrobin.core.ConsolFuns; //导入依赖的package包/类
@Override
public double[][] getData(long startTime, long endTime, int dataPoints) {
          // Our greatest datapoints is 60 so if it is something less than that
          // then we want an average.
          return fetchData((dataPoints != 60 ? ConsolFuns.CF_AVERAGE : consolidationFunction),
                  startTime, endTime, dataPoints);
      }
 
开发者ID:coodeer,项目名称:g3server,代码行数:8,代码来源:StatsEngine.java

示例5: init

import org.jrobin.core.ConsolFuns; //导入依赖的package包/类
private void init() throws IOException, RrdException {
	final File rrdFile = new File(rrdFileName);
	final File rrdDirectory = rrdFile.getParentFile();
	if (!rrdDirectory.mkdirs() && !rrdDirectory.exists()) {
		throw new IOException(
				"JavaMelody directory can't be created: " + rrdDirectory.getPath());
	}
	// cf issue 41: rrdFile could have been created with length 0 if out of disk space
	// (fix IOException: Read failed, file xxx.rrd not mapped for I/O)
	if (!rrdFile.exists() || rrdFile.length() == 0) {
		// create RRD file since it does not exist (or is empty)
		final RrdDef rrdDef = new RrdDef(rrdFileName, step);
		// "startTime" décalé de "step" pour éviter que addValue appelée juste
		// après ne lance l'exception suivante la première fois
		// "Bad sample timestamp x. Last update time was x, at least one second step is required"
		rrdDef.setStartTime(Util.getTime() - step);
		// single gauge datasource
		final String dsType = "GAUGE";
		// max time before "unknown value"
		final int heartbeat = step * 2;
		rrdDef.addDatasource(getDataSourceName(), dsType, heartbeat, 0, Double.NaN);
		// several archives
		final String average = ConsolFuns.CF_AVERAGE;
		final String max = ConsolFuns.CF_MAX;
		// 1 jour
		rrdDef.addArchive(average, 0.25, 1, DAY / step);
		rrdDef.addArchive(max, 0.25, 1, DAY / step);
		// 1 semaine
		rrdDef.addArchive(average, 0.25, HOUR / step, 7 * 24);
		rrdDef.addArchive(max, 0.25, HOUR / step, 7 * 24);
		// 1 mois
		rrdDef.addArchive(average, 0.25, 6 * HOUR / step, 31 * 4);
		rrdDef.addArchive(max, 0.25, 6 * HOUR / step, 31 * 4);
		// 2 ans (1 an pour période "1 an" et 2 ans pour période "tout")
		rrdDef.addArchive(average, 0.25, 8 * 6 * HOUR / step, 2 * 12 * 15);
		rrdDef.addArchive(max, 0.25, 8 * 6 * HOUR / step, 2 * 12 * 15);
		// create RRD file in the pool
		final RrdDb rrdDb = rrdPool.requestRrdDb(rrdDef);
		rrdPool.release(rrdDb);
	}
}
 
开发者ID:javamelody,项目名称:javamelody,代码行数:42,代码来源:JRobin.java


注:本文中的org.jrobin.core.ConsolFuns类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。