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


Java Aggregation类代码示例

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


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

示例1: printAggregation

import com.sun.btrace.aggregation.Aggregation; //导入依赖的package包/类
public static void printAggregation(String name, String format, Collection<Aggregation> aggregationList) {
    Aggregation[] aggregationArray = new Aggregation[aggregationList.size()];
    int index = 0;
    for (Aggregation a : aggregationList) {
            aggregationArray[index] = a;
            index++;
    }
    BTraceRuntime.printAggregation(name, format, aggregationArray);
}
 
开发者ID:haitaoyao,项目名称:btrace,代码行数:10,代码来源:BTraceUtils.java

示例2: printAggregation

import com.sun.btrace.aggregation.Aggregation; //导入依赖的package包/类
/**
 * Precondition: Only values from the first Aggregation are printed. If the subsequent aggregations have 
 * values for keys which the first aggregation does not have, these rows are ignored. 
 * @param name
 * @param format
 * @param aggregationArray
 */
static void printAggregation(String name, String format, Aggregation[] aggregationArray) {
	if (aggregationArray.length > 1 && aggregationArray[0].getKeyData().size() > 1) {
		int aggregationDataSize = aggregationArray[0].getKeyData().get(0).getElements().length + aggregationArray.length;
		
		List<Object[]> aggregationData = new ArrayList<Object[]>();
		
		//Iterate through all keys in the first Aggregation and build up an array of aggregationData
		for (AggregationKey aggKey : aggregationArray[0].getKeyData()) {
			int aggDataIndex = 0;
			Object[] currAggregationData = new Object[aggregationDataSize];
			
			//Add the key to the from of the current aggregation Data
			for (Object obj : aggKey.getElements()) {
				currAggregationData[aggDataIndex] = obj;
				aggDataIndex++;
			}
			
			for (Aggregation agg : aggregationArray) {
				currAggregationData[aggDataIndex] = agg.getValueForKey(aggKey);
				aggDataIndex++;
        	}
			
			aggregationData.add(currAggregationData);
		}
			
		getCurrent().send(new GridDataCommand(name, aggregationData, format));
	}
}
 
开发者ID:haitaoyao,项目名称:btrace,代码行数:36,代码来源:BTraceRuntime.java

示例3: newAggregation

import com.sun.btrace.aggregation.Aggregation; //导入依赖的package包/类
static Aggregation newAggregation(AggregationFunction type) {
    return new Aggregation(type);
}
 
开发者ID:haitaoyao,项目名称:btrace,代码行数:4,代码来源:BTraceRuntime.java

示例4: addToAggregation

import com.sun.btrace.aggregation.Aggregation; //导入依赖的package包/类
static void addToAggregation(Aggregation aggregation, long value) {
    aggregation.add(value);
}
 
开发者ID:haitaoyao,项目名称:btrace,代码行数:4,代码来源:BTraceRuntime.java

示例5: clearAggregation

import com.sun.btrace.aggregation.Aggregation; //导入依赖的package包/类
static void clearAggregation(Aggregation aggregation) {
    aggregation.clear();
}
 
开发者ID:haitaoyao,项目名称:btrace,代码行数:4,代码来源:BTraceRuntime.java

示例6: truncateAggregation

import com.sun.btrace.aggregation.Aggregation; //导入依赖的package包/类
static void truncateAggregation(Aggregation aggregation, int count) {
    aggregation.truncate(count);
}
 
开发者ID:haitaoyao,项目名称:btrace,代码行数:4,代码来源:BTraceRuntime.java

示例7: newAggregation

import com.sun.btrace.aggregation.Aggregation; //导入依赖的package包/类
/**
 * Creates a new aggregation based on the given aggregation function type.
 *
 * @param type the aggregating function to be performed on the data being added to the aggregation.
 */
public static Aggregation newAggregation(AggregationFunction type) {
    return Aggregations.newAggregation(type);
}
 
开发者ID:haitaoyao,项目名称:btrace,代码行数:9,代码来源:BTraceUtils.java

示例8: addToAggregation

import com.sun.btrace.aggregation.Aggregation; //导入依赖的package包/类
/**
 * Adds a value to the aggregation with no grouping key. This method should be used when the aggregation
 * is to calculate only a single aggregated value.
 *
 * @param aggregation the aggregation to which the value should be added
 */
public static void addToAggregation(Aggregation aggregation, long value) {
    Aggregations.addToAggregation(aggregation, value);
}
 
开发者ID:haitaoyao,项目名称:btrace,代码行数:10,代码来源:BTraceUtils.java

示例9: clearAggregation

import com.sun.btrace.aggregation.Aggregation; //导入依赖的package包/类
/**
 * Resets values within the aggregation to the default. This will affect all values within the aggregation
 * when multiple aggregation keys have been used.
 *
 * @param aggregation the aggregation to be cleared
 */
public static void clearAggregation(Aggregation aggregation) {
    Aggregations.clearAggregation(aggregation);
}
 
开发者ID:haitaoyao,项目名称:btrace,代码行数:10,代码来源:BTraceUtils.java

示例10: truncateAggregation

import com.sun.btrace.aggregation.Aggregation; //导入依赖的package包/类
/**
 * Removes all aggregated values from the aggregation except for the largest or smallest
 * <code>abs(count)</code> elements.
 *
 * <p>If <code>count</code> is positive, the largest aggregated values in the aggregation will be
 * preserved. If <code>count</code> is negative the smallest values will be preserved. If <code>count</code>
 * is zero then all elements will be removed.
 *
 * <p>Behavior is intended to be similar to the dtrace <code>trunc()</code> function.
 *
 * @param aggregation the aggregation to be truncated
 * @param count the number of elements to preserve. If negative, the smallest <code>abs(count)</code> elements are preserved.
 */
public static void truncateAggregation(Aggregation aggregation, int count) {
    Aggregations.truncateAggregation(aggregation, count);
}
 
开发者ID:haitaoyao,项目名称:btrace,代码行数:17,代码来源:BTraceUtils.java


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