• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MeasurementScheduleRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



MeasurementScheduleRequest类属于org.rhq.core.domain.measurement包,在下文中一共展示了MeasurementScheduleRequest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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());
                }
            }
        }
    }
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:26,代码来源:ServiceResourceComponent.java


示例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;
    }
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:21,代码来源:BaseSwitchYardResourceComponent.java


示例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());
                }
            }
        }
    }
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:21,代码来源:ReferenceBindingResourceComponent.java


示例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());
                }
            }
        }
    }
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:21,代码来源:ServiceBindingResourceComponent.java


示例5: getValue

import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入依赖的package包/类
public void getValue(WebSphereServer server, MeasurementReport report, MeasurementScheduleRequest request) throws InterruptedException, JMException, ConnectorException {
    Object value;
    try {
        value = mbean.invoke(operationName, new Object[0], new String[0]);
    } catch (InstanceNotFoundException ex) {
        if (ignoreInstanceNotFound) {
            if (log.isDebugEnabled()) {
                log.debug("Ignoring InstanceNotFoundException for measurement of " + request.getName() + " on " + mbean);
            }
            value = null;
        } else {
            throw ex;
        }
    }
    JMXMeasurementDataUtils.addData(report, request, value);
}
 
开发者ID:kszbcss,项目名称:rhq-websphere-plugin,代码行数:17,代码来源:JMXOperationMeasurementHandler.java


示例6: getValues

import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入依赖的package包/类
public void getValues(WebSphereServer server, MeasurementReport report, Map<String,MeasurementScheduleRequest> requests) {
    String[] attributes = requests.keySet().toArray(new String[requests.size()]);
    AttributeList list;
    try {
        list = mbean.getAttributes(attributes);
    } catch (Exception ex) {
        log.error("Failed to get values for attributes " + requests.keySet());
        // TODO: shouldn't we fall back to fetching each attribute individually?
        return;
    }
    if (log.isDebugEnabled()) {
        log.debug("Fetched attributes from " + mbean + ": " + Arrays.asList(attributes) + "=" + list);
    }
    for (int i=0; i<attributes.length; i++) {
        JMXMeasurementDataUtils.addData(report, requests.get(attributes[i]), ((Attribute)list.get(i)).getValue());
    }
}
 
开发者ID:kszbcss,项目名称:rhq-websphere-plugin,代码行数:18,代码来源:JMXAttributeGroupHandler.java


示例7: 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)));
        }
    }
}
 
开发者ID:kszbcss,项目名称:rhq-websphere-plugin,代码行数:17,代码来源:DynaCacheComponent.java


示例8: getValues

import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入依赖的package包/类
@Override
public void getValues(MeasurementReport mr, Set<MeasurementScheduleRequest> msrs) {
    Map<String, Double> digest = new HashMap<String, Double>();
    try {
        digest(digest);
    } catch (Exception e) {
        log.warn("failed to digest additional content", e);
    }
    msrs = new HashSet(msrs); // need to copy - RHQ Bug 821058
    for (Iterator<MeasurementScheduleRequest> i = msrs.iterator(); i.hasNext(); ) {
        MeasurementScheduleRequest msr = i.next();
        Double d = digest.get(msr.getName());
        if (d != null) {
            mr.addData(new MeasurementDataNumeric(msr, d));
            i.remove();
        }
    }
    if (!msrs.isEmpty()) // JIRA issue HADOOP-8389
        super.getValues(mr, msrs);
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:21,代码来源:HadoopMBean.java


示例9: 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));
    }
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:19,代码来源:JobTrackerQueue.java


示例10: getValues

import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入依赖的package包/类
@Override
public void getValues(MeasurementReport mr, Set<MeasurementScheduleRequest> msrs) throws Exception {
    if (map.isEmpty())
        getAvailability();
    for (Iterator<MeasurementScheduleRequest> i = msrs.iterator(); i.hasNext(); ) {
        MeasurementScheduleRequest msr = i.next();
        Object o = map.get(msr.getName());
        if (o != null) {
            if (msr.getDataType() == DataType.MEASUREMENT) {
                mr.addData(new MeasurementDataNumeric(msr, (Double)o));
            } else {
                mr.addData(new MeasurementDataTrait(msr, o.toString()));
            }
        }
    }
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:17,代码来源:HbaseMasterInfoHtml.java


示例11: 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()));
        }
    }
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:23,代码来源:AppSubComponent.java


示例12: 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);
        }
    }
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:17,代码来源:MonitorComponent.java


示例13: 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 s = info.getProperty(msr.getName());
        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("not found " + msr.getName());
        }
    }
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:17,代码来源:RedisComponent.java


示例14: 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)));
        }
    }
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:18,代码来源:CoordinatorComponent.java


示例15: 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));
        }
    }
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:23,代码来源:MBeanGroupComponent.java


示例16: 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) {
        Object o = stats.get(msr.getName());
        if (o != null) {
            if (msr.getDataType() == DataType.TRAIT) {
                mr.addData(new MeasurementDataTrait(msr, o.toString()));
            } else {
                Number n = (Number)o;
                mr.addData(new MeasurementDataNumeric(msr, n.doubleValue()));
            }
        } else {
            log.warn("not found " + msr.getName());
        }
    }
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:18,代码来源:MongoDBComponent.java


示例17: 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) {
        Object o = collection.getStats().get(msr.getName());
        if (o != null) {
            if (msr.getDataType() == DataType.TRAIT) {
                mr.addData(new MeasurementDataTrait(msr, o.toString()));
            } else {
                Number n = (Number)o;
                mr.addData(new MeasurementDataNumeric(msr, n.doubleValue()));
            }
        } else {
            log.warn("not found " + msr.getName());
        }
    }
}
 
开发者ID:genman,项目名称:rhq-plugins,代码行数:18,代码来源:MongoDBCollectionComponent.java


示例18: getValues

import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入依赖的package包/类
@Override
public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) {
    super.getValues(report, requests);
    // normalize percentage metric values to 0..1.0
    for (MeasurementDataNumeric dataNumeric : report.getNumericData()) {
        if (MEMORY_PERCENT_USAGE.equals(dataNumeric.getName()) && dataNumeric.getValue() != null) {
            dataNumeric.setValue(dataNumeric.getValue() / 100.0);
        }
    }
}
 
开发者ID:rh-messaging,项目名称:Artemis-JON-plugin,代码行数:11,代码来源:ArtemisResourceComponent.java


示例19: getValues

import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入依赖的package包/类
@Override
public void getValues(final MeasurementReport report, final Set<MeasurementScheduleRequest> requests) throws Exception {
    final OperationMetrics metrics = getOperationMetrics();
    if (metrics != null) {
        for (MeasurementScheduleRequest request: requests) {
            final MeasurementDataNumeric measurementData = getCommonMetric(request, metrics);
            if (measurementData != null) {
                report.addData(measurementData);
            } else if (LOG.isDebugEnabled()) {
                LOG.debug("Unable to collect Reference Operation measurement " + request.getName());
            }
        }
    }
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:15,代码来源:ReferenceOperationResourceComponent.java


示例20: getValues

import org.rhq.core.domain.measurement.MeasurementScheduleRequest; //导入依赖的package包/类
@Override
public void getValues(final MeasurementReport report, final Set<MeasurementScheduleRequest> requests) throws Exception {
    final ReferenceMetrics metrics = getReferenceMetrics();
    if (metrics != null) {
        for (MeasurementScheduleRequest request: requests) {
            final MeasurementDataNumeric measurementData = getCommonMetric(request, metrics);
            if (measurementData != null) {
                report.addData(measurementData);
            } else if (LOG.isDebugEnabled()) {
                LOG.debug("Unable to collect Reference measurement " + request.getName());
            }
        }
    }
}
 
开发者ID:jboss-switchyard,项目名称:switchyard,代码行数:15,代码来源:ReferenceResourceComponent.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HttpResponseStatus类代码示例发布时间:2022-05-22
下一篇:
Java AxisDirection类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap