Examples of PerfQuerySpec


Examples of com.vmware.vim25.PerfQuerySpec

                    double networkReadKBs=0;
                    double networkWriteKBs=0;
                    long sampleDuration=0;

                    if (vmNetworkMetrics.size() != 0) {
                        PerfQuerySpec qSpec = new PerfQuerySpec();
                        qSpec.setEntity(vmMor);
                        PerfMetricId[] availableMetricIds = (PerfMetricId[]) vmNetworkMetrics.toArray(new PerfMetricId[0]);
                        qSpec.setMetricId(availableMetricIds);
                        PerfQuerySpec[] qSpecs = new PerfQuerySpec[] {qSpec};
                        PerfEntityMetricBase[] values = service.queryPerf(perfMgr, qSpecs);

                        for(int i=0; i<values.length; ++i) {
                            PerfSampleInfo[]  infos = ((PerfEntityMetric)values[i]).getSampleInfo();
View Full Code Here

Examples of com.vmware.vim25.PerfQuerySpec

                    double networkReadKBs=0;
                    double networkWriteKBs=0;
                    long sampleDuration=0;

                    if (vmNetworkMetrics.size() != 0) {
                        PerfQuerySpec qSpec = new PerfQuerySpec();
                        qSpec.setEntity(vmMor);
                        PerfMetricId[] availableMetricIds = (PerfMetricId[]) vmNetworkMetrics.toArray(new PerfMetricId[0]);
                        qSpec.getMetricId().addAll(Arrays.asList(availableMetricIds));
                        List<PerfQuerySpec> qSpecs = new ArrayList<PerfQuerySpec>();
                        qSpecs.add(qSpec);
                        List<PerfEntityMetricBase> values = service.queryPerf(perfMgr, qSpecs);

                        for(int i=0; i<values.size(); ++i) {
View Full Code Here

Examples of com.vmware.vim25.PerfQuerySpec

                    double networkReadKBs=0;
                    double networkWriteKBs=0;
                    long sampleDuration=0;

                    if (vmNetworkMetrics.size() != 0) {
                        PerfQuerySpec qSpec = new PerfQuerySpec();
                        qSpec.setEntity(vmMor);
                        PerfMetricId[] availableMetricIds = (PerfMetricId[]) vmNetworkMetrics.toArray(new PerfMetricId[0]);
                        qSpec.getMetricId().addAll(Arrays.asList(availableMetricIds));
                        List<PerfQuerySpec> qSpecs = new ArrayList<PerfQuerySpec>();
                        qSpecs.add(qSpec);
                        List<PerfEntityMetricBase> values = service.queryPerf(perfMgr, qSpecs);

                        for(int i=0; i<values.size(); ++i) {
View Full Code Here

Examples of com.vmware.vim25.PerfQuerySpec

                    double networkReadKBs=0;
                    double networkWriteKBs=0;
                    long sampleDuration=0;

                    if (vmNetworkMetrics.size() != 0) {
                        PerfQuerySpec qSpec = new PerfQuerySpec();
                        qSpec.setEntity(vmMor);
                        PerfMetricId[] availableMetricIds = (PerfMetricId[]) vmNetworkMetrics.toArray(new PerfMetricId[0]);
                        qSpec.getMetricId().addAll(Arrays.asList(availableMetricIds));
                        List<PerfQuerySpec> qSpecs = new ArrayList<PerfQuerySpec>();
                        qSpecs.add(qSpec);
                        List<PerfEntityMetricBase> values = service.queryPerf(perfMgr, qSpecs);

                        for(int i=0; i<values.size(); ++i) {
View Full Code Here

Examples of com.vmware.vim25.PerfQuerySpec

                    double networkReadKBs = 0;
                    double networkWriteKBs = 0;
                    long sampleDuration = 0;

                    if (vmNetworkMetrics.size() != 0) {
                        PerfQuerySpec qSpec = new PerfQuerySpec();
                        qSpec.setEntity(vmMor);
                        PerfMetricId[] availableMetricIds = vmNetworkMetrics.toArray(new PerfMetricId[0]);
                        qSpec.getMetricId().addAll(Arrays.asList(availableMetricIds));
                        List<PerfQuerySpec> qSpecs = new ArrayList<PerfQuerySpec>();
                        qSpecs.add(qSpec);
                        List<PerfEntityMetricBase> values = service.queryPerf(perfMgr, qSpecs);

                        for (int i = 0; i < values.size(); ++i) {
View Full Code Here

Examples of com.vmware.vim25.PerfQuerySpec

                    double networkReadKBs=0;
                    double networkWriteKBs=0;
                    long sampleDuration=0;

                    if (vmNetworkMetrics.size() != 0) {
                        PerfQuerySpec qSpec = new PerfQuerySpec();
                        qSpec.setEntity(vmMor);
                        PerfMetricId[] availableMetricIds = (PerfMetricId[]) vmNetworkMetrics.toArray(new PerfMetricId[0]);
                        qSpec.setMetricId(availableMetricIds);
                        PerfQuerySpec[] qSpecs = new PerfQuerySpec[] {qSpec};
                        PerfEntityMetricBase[] values = service.queryPerf(perfMgr, qSpecs);

                        for(int i=0; i<values.length; ++i) {
                            PerfSampleInfo[]  infos = ((PerfEntityMetric)values[i]).getSampleInfo();
View Full Code Here

Examples of com.vmware.vim25.PerfQuerySpec

                    double networkReadKBs=0;
                    double networkWriteKBs=0;
                    long sampleDuration=0;

                    if (vmNetworkMetrics.size() != 0) {
                        PerfQuerySpec qSpec = new PerfQuerySpec();
                        qSpec.setEntity(vmMor);
                        PerfMetricId[] availableMetricIds = (PerfMetricId[]) vmNetworkMetrics.toArray(new PerfMetricId[0]);
                        qSpec.setMetricId(availableMetricIds);
                        PerfQuerySpec[] qSpecs = new PerfQuerySpec[] {qSpec};
                        PerfEntityMetricBase[] values = service.queryPerf(perfMgr, qSpecs);

                        for(int i=0; i<values.length; ++i) {
                            PerfSampleInfo[]  infos = ((PerfEntityMetric)values[i]).getSampleInfo();
View Full Code Here

Examples of com.vmware.vim25.PerfQuerySpec

    // retrieve all the available perf metrics for vm
    PerfMetricId[] pmis = perfMgr.queryAvailablePerfMetric(
        vm, null, null, refreshRate);

    PerfQuerySpec qSpec = createPerfQuerySpec(
        vm, pmis, 3, refreshRate);

    while(true)
    {
      PerfEntityMetricBase[] pValues = perfMgr.queryPerf(
View Full Code Here

Examples of com.vmware.vim25.PerfQuerySpec

  }

  static PerfQuerySpec createPerfQuerySpec(ManagedEntity me,
      PerfMetricId[] metricIds, int maxSample, int interval)
  {
    PerfQuerySpec qSpec = new PerfQuerySpec();
    qSpec.setEntity(me.getMOR());
    // set the maximum of metrics to be return
    // only appropriate in real-time performance collecting
    qSpec.setMaxSample(new Integer(maxSample));
//    qSpec.setMetricId(metricIds);
    // optionally you can set format as "normal"
    qSpec.setFormat("csv");
    // set the interval to the refresh rate for the entity
    qSpec.setIntervalId(new Integer(interval));
    return qSpec;
  }
View Full Code Here

Examples of com.vmware.vim25.PerfQuerySpec

    PerfMetricId[] pmis = perfMgr.queryAvailablePerfMetric(
        vm, null, null, perfInterval);
   
    Calendar curTime = si.currentTime();
   
    PerfQuerySpec qSpec = new PerfQuerySpec();
    qSpec.setEntity(vm.getRuntime().getHost());
    //metricIDs must be provided, or InvalidArgumentFault
    qSpec.setMetricId(pmis);
    qSpec.setFormat("normal"); //optional since it's default
    qSpec.setIntervalId(perfInterval);

    Calendar startTime = (Calendar) curTime.clone();
    startTime.roll(Calendar.DATE, -4);
    System.out.println("start:" + startTime.getTime());
    qSpec.setStartTime(startTime);
   
    Calendar endTime = (Calendar) curTime.clone();
    endTime.roll(Calendar.DATE, -3);
    System.out.println("end:" + endTime.getTime());
    qSpec.setEndTime(endTime);
   
    PerfCompositeMetric pv = perfMgr.queryPerfComposite(qSpec);
    if(pv != null)
    {
      printPerfMetric(pv.getEntity());
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.