本文整理汇总了Java中org.rhq.core.domain.measurement.MeasurementScheduleRequest.getName方法的典型用法代码示例。如果您正苦于以下问题:Java MeasurementScheduleRequest.getName方法的具体用法?Java MeasurementScheduleRequest.getName怎么用?Java MeasurementScheduleRequest.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.rhq.core.domain.measurement.MeasurementScheduleRequest
的用法示例。
在下文中一共展示了MeasurementScheduleRequest.getName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getValues
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
@Override
public void getValues(final MeasurementReport report, final Set<MeasurementScheduleRequest> requests) throws Exception {
final ServiceMetrics metrics = getServiceMetrics();
final Service service = getService();
if ((metrics != null) && (service != null)) {
for (MeasurementScheduleRequest request: requests) {
final MeasurementDataNumeric measurementData = getCommonMetric(request, metrics);
if (measurementData != null) {
report.addData(measurementData);
} else {
final String name = request.getName();
final Throttling throttling = service.getThrottling();
if (METRIC_THROTTLING_ENABLED.equals(name)) {
report.addData(new MeasurementDataTrait(request, Boolean.toString(throttling.isEnabled())));
} else if (METRIC_TIME_PERIOD.equals(name)) {
report.addData(new MeasurementDataTrait(request, Long.toString(throttling.getTimePeriod())));
} else if (METRIC_MAX_REQUESTS.equals(name)) {
report.addData(new MeasurementDataTrait(request, Integer.toString(throttling.getMaxRequests())));
} else if (LOG.isDebugEnabled()) {
LOG.debug("Unable to collect Service measurement " + request.getName());
}
}
}
}
}
示例2: getCommonMetric
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
protected MeasurementDataNumeric getCommonMetric(final MeasurementScheduleRequest request, final Metrics metrics) {
final String name = request.getName();
if (METRIC_SUCCESS_COUNT.equals(name)) {
return new MeasurementDataNumeric(request, Double.valueOf(metrics.getSuccessCount()));
} else if (METRIC_FAULT_COUNT.equals(name)) {
return new MeasurementDataNumeric(request, Double.valueOf(metrics.getFaultCount()));
} else if (METRIC_TOTAL_COUNT.equals(name)) {
return new MeasurementDataNumeric(request, Double.valueOf(metrics.getTotalCount()));
} else if (METRIC_TOTAL_PROCESSING_TIME.equals(name)) {
return new MeasurementDataNumeric(request, Double.valueOf(metrics.getTotalTime()));
} else if (METRIC_AVERAGE_PROCESSING_TIME.equals(name)) {
return new MeasurementDataNumeric(request, Double.valueOf(metrics.getAverageTime()));
} else if (METRIC_MIN_PROCESSING_TIME.equals(name)) {
return new MeasurementDataNumeric(request, Double.valueOf(metrics.getMinTime()));
} else if (METRIC_MAX_PROCESSING_TIME.equals(name)) {
return new MeasurementDataNumeric(request, Double.valueOf(metrics.getMaxTime()));
} else {
return null;
}
}
示例3: getValues
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
@Override
public void getValues(final MeasurementReport report, final Set<MeasurementScheduleRequest> requests) throws Exception {
final GatewayMetrics metrics = getGatewayMetrics();
final Gateway gateway = getGateway();
if ((metrics != null) && (gateway != null)) {
for (MeasurementScheduleRequest request: requests) {
final MeasurementDataNumeric measurementData = getCommonMetric(request, metrics);
if (measurementData != null) {
report.addData(measurementData);
} else {
final String name = request.getName();
if (METRIC_STATE.equals(name)) {
report.addData(new MeasurementDataTrait(request, gateway.getState()));
} else if (LOG.isDebugEnabled()) {
LOG.debug("Unable to collect Reference Binding measurement " + request.getName());
}
}
}
}
}
示例4: getValues
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
@Override
public void getValues(final MeasurementReport report, final Set<MeasurementScheduleRequest> requests) throws Exception {
final GatewayMetrics metrics = getGatewayMetrics();
final Gateway gateway = getGateway();
if ((metrics != null) && (gateway != null)) {
for (MeasurementScheduleRequest request: requests) {
final MeasurementDataNumeric measurementData = getCommonMetric(request, metrics);
if (measurementData != null) {
report.addData(measurementData);
} else {
final String name = request.getName();
if (METRIC_STATE.equals(name)) {
report.addData(new MeasurementDataTrait(request, gateway.getState()));
} else if (LOG.isDebugEnabled()) {
LOG.debug("Unable to collect Service Binding measurement " + request.getName());
}
}
}
}
}
示例5: getValues
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) throws Exception {
String[] stats = cache.getAllCacheStatistics(instanceName);
for (MeasurementScheduleRequest request : requests) {
String name = request.getName();
String value = null;
for (String stat : stats) {
if (stat.indexOf('=') == name.length() && stat.startsWith(name)) {
value = stat.substring(name.length()+1);
break;
}
}
if (value != null) {
report.addData(new MeasurementDataNumeric(request, Double.parseDouble(value)));
}
}
}
示例6: getValues
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
@Override
public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {
QueueData queueData = getQueueData();
log.debug("queue data " + queueData);
for (MeasurementScheduleRequest mr : metrics) {
String n = mr.getName();
if (n.equals("jobCount"))
report.addData(new MeasurementDataNumeric(mr, (double)queueData.jobCount));
if (n.equals("mapTotal"))
report.addData(new MeasurementDataNumeric(mr, (double)queueData.mapTotal));
if (n.equals("mapComplete"))
report.addData(new MeasurementDataNumeric(mr, (double)queueData.mapComplete));
if (n.equals("reducersComplete"))
report.addData(new MeasurementDataNumeric(mr, (double)queueData.reducersComplete));
if (n.equals("reducersTotal"))
report.addData(new MeasurementDataNumeric(mr, (double)queueData.reducersTotal));
}
}
示例7: getValues
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
@Override
public void getValues(MeasurementReport mr, Set<MeasurementScheduleRequest> msr) throws Exception {
getAvailability(); // loads stats
for (MeasurementScheduleRequest r : msr) {
String name = r.getName();
Object val = stats.get(name);
if (val == null) {
continue;
}
if (r.getDataType() == DataType.MEASUREMENT) {
Number n;
if (name.endsWith("WindowId")) {
n = AppComponent.windowId(val);
} else {
n = Double.parseDouble(val.toString());
}
mr.addData(new MeasurementDataNumeric(r, n.doubleValue()));
} else {
mr.addData(new MeasurementDataTrait(r, val.toString()));
}
}
}
示例8: getValues
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) {
for (MeasurementScheduleRequest request : requests) {
String name = request.getName();
if (name.equals(ELAPSED)) {
report.addData(new MeasurementDataNumeric(request, (double)elapsed));
} else if (name.equals(ENABLED)) {
report.addData(new MeasurementDataTrait(request, setting(ENABLED, Boolean.toString(false))));
} else if (name.equals(GROUP)) {
report.addData(new MeasurementDataTrait(request, setting(GROUP)));
} else if (name.equals(OUTPUT)) {
report.addData(new MeasurementDataTrait(request, setting(OUTPUT)));
} else {
log.warn("unknown metric " + name);
}
}
}
示例9: getValues
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
@Override
public void getValues(MeasurementReport report,
Set<MeasurementScheduleRequest> metrics) throws Exception {
getAvailability();
long now = System.currentTimeMillis();
for (MeasurementScheduleRequest metric : metrics) {
String name = metric.getName();
Object trait = traits.get(name);
if (name.equals("startElapsed") && startTime != null) {
report.addData(new MeasurementDataNumeric(metric, (double) (now - startTime.getTime())));
} else if (name.equals("actionElapsed") && lastAction != null) {
report.addData(new MeasurementDataNumeric(metric, (double) (lastAction.getTime() - now)));
} else if (trait != null) {
report.addData(new MeasurementDataTrait(metric, s(trait)));
}
}
}
示例10: getValues
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) {
List<EmsBean> beans = parent.getEmsConnection().queryBeans(objectName);
log.debug("found " + beans.size());
for (MeasurementScheduleRequest request : requests) {
String name = request.getName();
double sum = 0;
for (EmsBean bean : beans) {
EmsAttribute attr = bean.getAttribute(name);
if (attr == null || attr.getValue() == null) {
log.error(name + " not found");
continue;
}
Object value = attr.getValue();
if (value instanceof Number) {
sum += ((Number)value).doubleValue();
}
}
if (request.getDataType() == DataType.MEASUREMENT) {
report.addData(new MeasurementDataNumeric(request, sum));
}
}
}
示例11: getValues
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) throws Exception {
log.debug("Entering getValues");
boolean dataAdded = false;
for (MeasurementScheduleRequest request : requests) {
String name = request.getName();
if (name.equals("InvocationTime")) {
AdminClientStats stats = AdminClientStatsCollector.INSTANCE.rotateStats();
CallTimeData data = new CallTimeData(request);
for (AdminClientStatsData statsData : stats.getData()) {
data.addAggregatedCallData(statsData.getDestination(), stats.getBeginTime(), stats.getEndTime(),
statsData.getMin(), statsData.getMax(), statsData.getTotal(), statsData.getCount());
}
report.addData(data);
if (log.isDebugEnabled()) {
log.debug("Added " + data.getValues().size() + " call time data items to the report");
}
dataAdded = true;
} else if (name.equals("LogEventsPublished")) {
report.addData(new MeasurementDataNumeric(request, Double.valueOf(EventStats.getLogEventsPublished())));
} else if (name.equals("LogEventsSuppressed")) {
report.addData(new MeasurementDataNumeric(request, Double.valueOf(EventStats.getLogEventsSuppressed())));
}
}
if (!dataAdded) {
log.debug("No call time data requested. Nothing has been added to the report.");
}
}
示例12: getValues0
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
public void getValues0(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {
long length = 0;
long fileCount = 0;
long directoryCount = 0;
long spaceConsumed = 0;
for (String path : paths) {
log.debug("get summary " + path);
try {
ContentSummary cs = fileSystem.getContentSummary(new Path(path));
log.debug("got summary " + cs);
length += cs.getLength();
fileCount += cs.getFileCount();
directoryCount += cs.getDirectoryCount();
spaceConsumed += cs.getSpaceConsumed();
} catch (FileNotFoundException e) {
log.debug("file not found");
}
}
for (MeasurementScheduleRequest mr : metrics) {
String n = mr.getName();
if (n.equals("length"))
report.addData(new MeasurementDataNumeric(mr, (double)length));
if (n.equals("fileCount"))
report.addData(new MeasurementDataNumeric(mr, (double)fileCount));
if (n.equals("directoryCount"))
report.addData(new MeasurementDataNumeric(mr, (double)directoryCount));
if (n.equals("spaceConsumed"))
report.addData(new MeasurementDataNumeric(mr, (double)spaceConsumed));
}
}
示例13: getValues
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
@Override
public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> msrs) {
for (MeasurementScheduleRequest msr : msrs) {
String name = msr.getName();
if (name.endsWith(suffix)) {
name = name.substring(0, name.length() - suffix.length());
EmsAttribute attr = getEmsBean().getAttribute(name);
String val = (String) attr.refresh();
double d = count(val);
report.addData(new MeasurementDataNumeric(msr, d));
}
}
// TODO Auto-generated method stub
super.getValues(report, msrs);
}
示例14: getValues
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
@Override
public void getValues(MeasurementReport mr, Set<MeasurementScheduleRequest> msr) throws Exception {
Map<String, Object> details = component.getDetailTree();
Map<String, String> counters = (Map<String, String>) details.get(COUNTERS);
for (MeasurementScheduleRequest request : msr) {
String name = request.getName();
String value = counters.get(name);
if (value != null) {
mr.addData(new MeasurementDataNumeric(request, Double.parseDouble(value)));
}
}
}
示例15: getValues
import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入方法依赖的package包/类
@Override
public void getValues(MeasurementReport mr, Set<MeasurementScheduleRequest> msrs) throws Exception {
getAvailability();
for (MeasurementScheduleRequest msr : msrs) {
String name = msr.getName();
if (name.equals(GET_RATIO)) {
String ms = info.get(GET_MISSES);
String hs = info.get(GET_HITS);
if (ms == null || hs == null)
continue;
get_misses = Long.parseLong(ms);
get_hits = Long.parseLong(hs);
double hd = get_hits - get_hits2;
double md = get_misses - get_misses2;
get_misses2 = get_misses;
get_hits2 = get_hits;
if (md + hd == 0)
continue; // avoid NaN
double d = hd / (md + hd);
if (d < 0)
continue; // stats were reset?
mr.addData(new MeasurementDataNumeric(msr, d));
continue;
}
String s = info.get(name);
if (s != null) {
if (msr.getDataType() == DataType.TRAIT) {
mr.addData(new MeasurementDataTrait(msr, s));
} else {
mr.addData(new MeasurementDataNumeric(msr, Double.parseDouble(s)));
}
} else {
log.warn("stat not found " + name);
}
}
}