Examples of CpuUtilization


Examples of com.google.apphosting.utils.config.AppEngineWebXml.CpuUtilization

      appendIfNotNull(builder, "  max_idle_instances: ", settings.getMaxIdleInstances());
      appendIfNotNull(builder, "  max_concurrent_requests: ", settings.getMaxConcurrentRequests());
      appendIfNotNull(builder, "  min_num_instances: ", settings.getMinNumInstances());
      appendIfNotNull(builder, "  max_num_instances: ", settings.getMaxNumInstances());
      appendIfNotNull(builder, "  cool_down_period_sec: ", settings.getCoolDownPeriodSec());
      CpuUtilization cpuUtil = settings.getCpuUtilization();
      if (cpuUtil != null
          && (cpuUtil.getTargetUtilization() != null
              || cpuUtil.getAggregationWindowLengthSec() != null)) {
        builder.append("  cpu_utilization:\n");
        appendIfNotNull(builder, "    target_utilization: ", cpuUtil.getTargetUtilization());
        appendIfNotNull(
            builder, "    aggregation_window_length_sec: ",
            cpuUtil.getAggregationWindowLengthSec());
      }
    }

    if (!appEngineWebXml.getManualScaling().isEmpty()) {
      builder.append("manual_scaling:\n");
View Full Code Here

Examples of com.google.apphosting.utils.config.AppEngineWebXml.CpuUtilization

  private void processCpuUtilizationNode(
      XmlParser.Node settingsNode, AutomaticScaling automaticScaling) {
    XmlParser.Node childNode = settingsNode.get("cpu-utilization");
    if (childNode != null) {
      CpuUtilization cpuUtilization = new CpuUtilization();
      Double targetUtilization = getChildNodeDouble(childNode, "target-utilization");
      if (targetUtilization != null) {
        if (targetUtilization <= 0 || targetUtilization > 1) {
          throw new AppEngineConfigException("target-utilization should be in range (0, 1].");
        }
        cpuUtilization.setTargetUtilization(targetUtilization);
      }

      cpuUtilization.setAggregationWindowLengthSec(
          getChildNodePositiveInteger(childNode, "aggregation-window-length-sec"));
      if (!cpuUtilization.isEmpty()) {
        automaticScaling.setCpuUtilization(cpuUtilization);
      }
    }
  }
View Full Code Here

Examples of org.rioproject.system.measurable.cpu.CpuUtilization

        if(cru==null)
            return "?";

       if(includeSystemInfo) {
            if(cName.equals(Constants.UTIL_PERCENT_CPU)) {
                CpuUtilization cpu = cru.getCpuUtilization();
                value = (cpu == null ? "?" : formatPercent(cpu.getValue()));

            } else if(cName.equals(Constants.UTIL_PERCENT_MEMORY)) {
                SystemMemoryUtilization mem = cru.getSystemMemoryUtilization();
                value = (mem == null ? "?" : formatPercent(mem.getValue()));
View Full Code Here

Examples of org.rioproject.system.measurable.cpu.CpuUtilization

    public void setThresholdValues(ThresholdValues tVals) {
        this.tVals = tVals;
    }

    public CpuUtilization getMeasuredResource() {
        return (new CpuUtilization(id, getValue(), tVals));
    }
View Full Code Here

Examples of org.rioproject.system.measurable.cpu.CpuUtilization

    public void setThresholdValues(ThresholdValues tVals) {
        this.tVals = tVals;
    }

    public CpuUtilization getMeasuredResource() {
        return (new CpuUtilization(id, getSystemUtilization(), tVals));
    }
View Full Code Here

Examples of org.rioproject.system.measurable.cpu.CpuUtilization

    @SuppressWarnings("unused")
    static double getMeasuredResourceValue(final String cName,
                                           final ComputeResourceUtilization cru) {
        double value = 0;
        if (cName.equals(Constants.UTIL_PERCENT_CPU)) {
            CpuUtilization cpu = cru.getCpuUtilization();
            value = (cpu == null ? 0 : cpu.getValue());

        } else if (cName.equals(Constants.UTIL_PERCENT_MEMORY)) {
            SystemMemoryUtilization mem = cru.getSystemMemoryUtilization();
            value = (mem == null ? 0 : mem.getValue());
View Full Code Here

Examples of org.rioproject.system.measurable.cpu.CpuUtilization

    public void setThresholdValues(ThresholdValues tVals) {
        this.tVals = tVals;
    }

    public CpuUtilization getMeasuredResource() {
        return (new CpuUtilization(id, getCpuUtilization(), tVals));
    }
View Full Code Here

Examples of org.rioproject.system.measurable.cpu.CpuUtilization

        if(altMonitor!=null)
            altMonitor.setThresholdValues(tVals);
    }

    public CpuUtilization getMeasuredResource() {
        CpuUtilization util;
        if(sigar!=null) {
            util = getSigarCpuUtilization();
        } else {
            if(jmxCPUUtilization!=null) {
                util = getJmxCpuUtilization();
View Full Code Here

Examples of org.rioproject.system.measurable.cpu.CpuUtilization

        if(altMonitor!=null)
            altMonitor.terminate();
    }

    private CpuUtilization getSigarCpuUtilization() {
        return new CpuUtilization(id,
                                   sigar.getSystemCpuPercentage(),
                                   sigar.getUserCpuPercentage(),
                                   sigar.getLoadAverage(),
                                   Runtime.getRuntime().availableProcessors(),
                                   tVals);
View Full Code Here

Examples of org.rioproject.system.measurable.cpu.CpuUtilization

            cpuUtilization = (Double)jmxCPUUtilization.invoke(opSysMBean);
            cpuUtilization = (cpuUtilization>0?cpuUtilization/100:cpuUtilization);
        } catch (Exception e) {
            logger.warn("Could not get SystemloadAverage using reflection on OperatingSystemMXBean.getSystemLoadAverage()", e);
        }
        return new CpuUtilization(id, cpuUtilization, tVals);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.