VirtualBox

Changeset 13082 in vbox for trunk/src


Ignore:
Timestamp:
Oct 8, 2008 2:36:19 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
37570
Message:

PerfAPI: Backward compatibility broken. setup, enable, disable and query methods replaced with their Ex counterparts.

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r12668 r13082  
    77687768}
    77697769
    7770 static int countMatchingMetrics(ComPtr<IVirtualBox> aVirtualBox,
    7771                                 ComPtr<IPerformanceCollector> performanceCollector,
    7772                                 ComSafeArrayIn(INPTR BSTR, metrics),
    7773                                 ComSafeArrayIn(IUnknown *, objects),
    7774                                 bool listMatches)
    7775 {
    7776     HRESULT rc;
    7777     com::SafeIfaceArray<IPerformanceMetric> metricInfo;
    7778 
    7779     CHECK_ERROR(performanceCollector,
    7780         GetMetrics(ComSafeArrayInArg(metrics),
    7781                    ComSafeArrayInArg(objects),
    7782                    ComSafeArrayAsOutParam(metricInfo)));
    7783 
    7784     if (metricInfo.size())
    7785     {
    7786         if (listMatches)
    7787         {
    7788             ComPtr<IUnknown> object;
    7789             Bstr metricName;
    7790             RTPrintf("The following metrics will be collected:\n\n"
    7791                      "Object     Metric\n"
    7792                      "---------- --------------------\n");
    7793             for (size_t i = 0; i < metricInfo.size(); i++)
    7794             {
    7795                 CHECK_ERROR(metricInfo[i], COMGETTER(Object)(object.asOutParam()));
    7796                 CHECK_ERROR(metricInfo[i], COMGETTER(MetricName)(metricName.asOutParam()));
    7797                 RTPrintf("%-10ls %-20ls\n",
    7798                     getObjectName(aVirtualBox, object).raw(), metricName.raw());
    7799             }
    7800             RTPrintf("\n");
    7801         }
    7802     }
    7803     else
    7804     {
    7805         RTPrintf("No metrics match the specified filter!\n");
    7806     }
    7807     return metricInfo.size();
    7808 }
    7809 
    78107770static void listAffectedMetrics(ComPtr<IVirtualBox> aVirtualBox,
    78117771                                ComSafeArrayIn(IPerformanceMetric*, aMetrics))
     
    79347894        return 1;
    79357895
     7896    com::SafeIfaceArray<IPerformanceMetric> affectedMetrics;
     7897    CHECK_ERROR(performanceCollector,
     7898        SetupMetrics(ComSafeArrayAsInParam(metrics),
     7899                     ComSafeArrayAsInParam(objects), period, samples,
     7900                     ComSafeArrayAsOutParam(affectedMetrics)));
    79367901    if (listMatches)
    7937     {
    7938         com::SafeIfaceArray<IPerformanceMetric> affectedMetrics;
    7939         CHECK_ERROR(performanceCollector,
    7940             SetupMetricsEx(ComSafeArrayAsInParam(metrics),
    7941                            ComSafeArrayAsInParam(objects), period, samples,
    7942                            ComSafeArrayAsOutParam(affectedMetrics)));
    79437902        listAffectedMetrics(aVirtualBox,
    79447903                            ComSafeArrayAsInParam(affectedMetrics));
    7945     }
    7946     else
    7947     {
    7948         CHECK_ERROR(performanceCollector,
    7949             SetupMetrics(ComSafeArrayAsInParam(metrics),
    7950                          ComSafeArrayAsInParam(objects), period, samples));
    7951     }
    79527904   
    79537905    return 0;
     
    79757927    com::SafeArray<BSTR>          retNames;
    79767928    com::SafeIfaceArray<IUnknown> retObjects;
     7929    com::SafeArray<BSTR>          retUnits;
     7930    com::SafeArray<ULONG>         retScales;
     7931    com::SafeArray<ULONG>         retSequenceNumbers;
    79777932    com::SafeArray<ULONG>         retIndices;
    79787933    com::SafeArray<ULONG>         retLengths;
     
    79827937                                             ComSafeArrayAsOutParam(retNames),
    79837938                                             ComSafeArrayAsOutParam(retObjects),
     7939                                             ComSafeArrayAsOutParam(retUnits),
     7940                                             ComSafeArrayAsOutParam(retScales),
     7941                                             ComSafeArrayAsOutParam(retSequenceNumbers),
    79847942                                             ComSafeArrayAsOutParam(retIndices),
    79857943                                             ComSafeArrayAsOutParam(retLengths),
     
    79907948    for (unsigned i = 0; i < retNames.size(); i++)
    79917949    {
    7992         // Get info for the metric
    7993         com::SafeArray<BSTR> nameOfMetric(1);
    7994         Bstr tmpName(retNames[i]);
    7995         tmpName.detachTo (&nameOfMetric[0]);
    7996         com::SafeIfaceArray<IUnknown> anObject(1);
    7997         ComPtr<IUnknown> tmpObject(retObjects[i]);
    7998         tmpObject.queryInterfaceTo(&anObject[0]);
    7999         com::SafeIfaceArray <IPerformanceMetric> metricInfo;
    8000         CHECK_RC_BREAK (performanceCollector->GetMetrics( ComSafeArrayAsInParam(nameOfMetric),
    8001                                                ComSafeArrayAsInParam(anObject),
    8002                                                ComSafeArrayAsOutParam(metricInfo) ));
    8003         BSTR metricUnitBSTR;
    8004         CHECK_RC_BREAK (metricInfo[0]->COMGETTER(Unit) (&metricUnitBSTR));
    8005         Bstr metricUnit(metricUnitBSTR);
     7950        Bstr metricUnit(retUnits[i]);
    80067951        Bstr metricName(retNames[i]);
    8007         LONG minVal, maxVal;
    8008         CHECK_RC_BREAK (metricInfo[0]->COMGETTER(MinimumValue) (&minVal));
    8009         CHECK_RC_BREAK (metricInfo[0]->COMGETTER(MaximumValue) (&maxVal));
    80107952        RTPrintf("%-10ls %-20ls ", getObjectName(aVirtualBox, retObjects[i]).raw(), metricName.raw());
    80117953        const char *separator = "";
    80127954        for (unsigned j = 0; j < retLengths[i]; j++)
    80137955        {
    8014             if (strcmp((const char *)metricUnit.raw(), "%"))
     7956            if (retScales[i] == 1)
    80157957                RTPrintf("%s%d %ls", separator, retData[retIndices[i] + j], metricUnit.raw());
    80167958            else
    8017                 RTPrintf("%s%d.%02d%%", separator, retData[retIndices[i] + j] / 1000, (retData[retIndices[i] + j] / 10) % 100);
     7959                RTPrintf("%s%d.%02d%ls", separator, retData[retIndices[i] + j] / retScales[i],
     7960                         (retData[retIndices[i] + j] * 100 / retScales[i]) % 100, metricUnit.raw());
    80187961            separator = ", ";
    80197962        }
     
    81218064
    81228065
    8123     if (countMatchingMetrics(aVirtualBox, performanceCollector,
    8124                              ComSafeArrayAsInParam(metrics),
    8125                              ComSafeArrayAsInParam(objects),
    8126                              listMatches) == 0)
    8127         return 1;
    8128 
     8066    com::SafeIfaceArray<IPerformanceMetric> affectedMetrics;
    81298067    CHECK_ERROR(performanceCollector,
    81308068        SetupMetrics(ComSafeArrayAsInParam(baseMetrics),
    8131                      ComSafeArrayAsInParam(objects), period, samples));
     8069                     ComSafeArrayAsInParam(objects), period, samples,
     8070                     ComSafeArrayAsOutParam(affectedMetrics)));
     8071    if (listMatches)
     8072        listAffectedMetrics(aVirtualBox,
     8073                            ComSafeArrayAsInParam(affectedMetrics));
     8074    if (!affectedMetrics.size())
     8075        return 1;
    81328076
    81338077    if (isDetached)
     
    81538097        com::SafeArray<BSTR>          retNames;
    81548098        com::SafeIfaceArray<IUnknown> retObjects;
     8099        com::SafeArray<BSTR>          retUnits;
     8100        com::SafeArray<ULONG>         retScales;
     8101        com::SafeArray<ULONG>         retSequenceNumbers;
    81558102        com::SafeArray<ULONG>         retIndices;
    81568103        com::SafeArray<ULONG>         retLengths;
     
    81608107                                                 ComSafeArrayAsOutParam(retNames),
    81618108                                                 ComSafeArrayAsOutParam(retObjects),
     8109                                                 ComSafeArrayAsOutParam(retUnits),
     8110                                                 ComSafeArrayAsOutParam(retScales),
     8111                                                 ComSafeArrayAsOutParam(retSequenceNumbers),
    81628112                                                 ComSafeArrayAsOutParam(retIndices),
    81638113                                                 ComSafeArrayAsOutParam(retLengths),
     
    81658115        for (unsigned i = 0; i < retNames.size(); i++)
    81668116        {
    8167 
    8168             // Get info for the metric
    8169             com::SafeArray<BSTR> nameOfMetric(1);
    8170             Bstr tmpName(retNames[i]);
    8171             tmpName.detachTo (&nameOfMetric[0]);
    8172             com::SafeIfaceArray<IUnknown> anObject(1);
    8173             ComPtr<IUnknown> tmpObject(retObjects[i]);
    8174             tmpObject.queryInterfaceTo(&anObject[0]);
    8175             com::SafeIfaceArray <IPerformanceMetric> metricInfo;
    8176             CHECK_RC_BREAK (performanceCollector->GetMetrics( ComSafeArrayAsInParam(nameOfMetric),
    8177                                                    ComSafeArrayAsInParam(anObject),
    8178                                                    ComSafeArrayAsOutParam(metricInfo) ));
    8179             BSTR metricUnitBSTR;
    8180             CHECK_RC_BREAK (metricInfo[0]->COMGETTER(Unit) (&metricUnitBSTR));
    8181             Bstr metricUnit(metricUnitBSTR);
     8117            Bstr metricUnit(retUnits[i]);
    81828118            Bstr metricName(retNames[i]);
    8183             LONG minVal, maxVal;
    8184             CHECK_RC_BREAK (metricInfo[0]->COMGETTER(MinimumValue) (&minVal));
    8185             CHECK_RC_BREAK (metricInfo[0]->COMGETTER(MaximumValue) (&maxVal));
    81868119            RTPrintf("%-12s %-10ls %-20ls ", ts, getObjectName(aVirtualBox, retObjects[i]).raw(), metricName.raw());
    81878120            const char *separator = "";
    81888121            for (unsigned j = 0; j < retLengths[i]; j++)
    81898122            {
    8190                 if (strcmp((const char *)metricUnit.raw(), "%"))
     8123                if (retScales[i] == 1)
    81918124                    RTPrintf("%s%d %ls", separator, retData[retIndices[i] + j], metricUnit.raw());
    81928125                else
    8193                     RTPrintf("%s%d.%02d%%", separator, retData[retIndices[i] + j] / 1000, retData[retIndices[i] + j] % 100);
     8126                    RTPrintf("%s%d.%02d%ls", separator, retData[retIndices[i] + j] / retScales[i],
     8127                             (retData[retIndices[i] + j] * 100 / retScales[i]) % 100, metricUnit.raw());
    81948128                separator = ", ";
    81958129            }
  • trunk/src/VBox/Main/PerformanceImpl.cpp

    r12973 r13082  
    259259PerformanceCollector::SetupMetrics (ComSafeArrayIn (INPTR BSTR, metricNames),
    260260                                    ComSafeArrayIn (IUnknown *, objects),
    261                                     ULONG aPeriod, ULONG aCount)
    262 {
    263     LogFlowThisFuncEnter();
    264     com::SafeIfaceArray <IPerformanceMetric> tmp;
    265     return SetupMetricsInt(ComSafeArrayInArg(metricNames),
    266                            ComSafeArrayInArg(objects),
    267                            aPeriod, aCount,
    268                            false, ComSafeArrayAsOutParam(tmp));
    269 }
    270 
    271 STDMETHODIMP
    272 PerformanceCollector::SetupMetricsEx (ComSafeArrayIn (INPTR BSTR, metricNames),
    273                                       ComSafeArrayIn (IUnknown *, objects),
    274                                       ULONG aPeriod, ULONG aCount,
    275                                       ComSafeArrayOut (IPerformanceMetric *,
    276                                                        outMetrics))
    277 {
    278     LogFlowThisFuncEnter();
    279     return SetupMetricsInt(ComSafeArrayInArg(metricNames),
    280                            ComSafeArrayInArg(objects),
    281                            aPeriod, aCount,
    282                            true, ComSafeArrayOutArg(outMetrics));
    283 }
    284 
    285 HRESULT
    286 PerformanceCollector::SetupMetricsInt (ComSafeArrayIn (INPTR BSTR, metricNames),
    287                                        ComSafeArrayIn (IUnknown *, objects),
    288                                        ULONG aPeriod, ULONG aCount,
    289                                        bool reportAffected,
    290                                        ComSafeArrayOut (IPerformanceMetric *,
    291                                                         outMetrics))
     261                                    ULONG aPeriod, ULONG aCount,
     262                                    ComSafeArrayOut (IPerformanceMetric *,
     263                                                     outMetrics))
    292264{
    293265    AutoCaller autoCaller (this);
     
    320292                (*it)->enable();
    321293            }
    322             if (reportAffected)
    323                 filteredMetrics.push_back(*it);
     294            filteredMetrics.push_back(*it);
    324295        }
    325296       
    326     if (reportAffected)
    327     {
    328         com::SafeIfaceArray<IPerformanceMetric> retMetrics (filteredMetrics.size());
    329         int i = 0;
    330         for (it = filteredMetrics.begin();
    331              it != filteredMetrics.end() && SUCCEEDED (rc); ++it)
    332             rc = toIPerformanceMetric(*it, &retMetrics [i++]);
    333         retMetrics.detachTo (ComSafeArrayOutArg(outMetrics));
    334     }
     297    com::SafeIfaceArray<IPerformanceMetric> retMetrics (filteredMetrics.size());
     298    int i = 0;
     299    for (it = filteredMetrics.begin();
     300         it != filteredMetrics.end() && SUCCEEDED (rc); ++it)
     301        rc = toIPerformanceMetric(*it, &retMetrics [i++]);
     302    retMetrics.detachTo (ComSafeArrayOutArg(outMetrics));
     303
    335304    LogFlowThisFuncLeave();
    336305    return rc;
     
    339308STDMETHODIMP
    340309PerformanceCollector::EnableMetrics (ComSafeArrayIn (INPTR BSTR, metricNames),
    341                                      ComSafeArrayIn (IUnknown *, objects))
    342 {
    343     LogFlowThisFuncEnter();
    344     com::SafeIfaceArray <IPerformanceMetric> tmp;
    345     return EnableMetricsInt (ComSafeArrayInArg(metricNames),
    346                              ComSafeArrayInArg(objects),
    347                              false, ComSafeArrayAsOutParam(tmp));
    348 }
    349 
    350 STDMETHODIMP
    351 PerformanceCollector::EnableMetricsEx (ComSafeArrayIn (INPTR BSTR, metricNames),
    352                                        ComSafeArrayIn (IUnknown *, objects),
    353                                        ComSafeArrayOut (IPerformanceMetric *,
    354                                                         outMetrics))
    355 {
    356     LogFlowThisFuncEnter();
    357     return EnableMetricsInt (ComSafeArrayInArg(metricNames),
    358                              ComSafeArrayInArg(objects),
    359                              true, ComSafeArrayOutArg(outMetrics));
    360 }
    361 
    362 HRESULT
    363 PerformanceCollector::EnableMetricsInt (ComSafeArrayIn (INPTR BSTR, metricNames),
    364                                         ComSafeArrayIn (IUnknown *, objects),
    365                                         bool reportAffected,
    366                                         ComSafeArrayOut (IPerformanceMetric *,
    367                                                          outMetrics))
     310                                     ComSafeArrayIn (IUnknown *, objects),
     311                                     ComSafeArrayOut (IPerformanceMetric *,
     312                                                      outMetrics))
    368313{
    369314    AutoCaller autoCaller (this);
     
    384329        {
    385330            (*it)->enable();
    386             if (reportAffected)
    387                 filteredMetrics.push_back(*it);
     331            filteredMetrics.push_back(*it);
    388332        }
    389333
    390     if (reportAffected)
    391     {
    392         com::SafeIfaceArray<IPerformanceMetric> retMetrics (filteredMetrics.size());
    393         int i = 0;
    394         for (it = filteredMetrics.begin();
    395              it != filteredMetrics.end() && SUCCEEDED (rc); ++it)
    396             rc = toIPerformanceMetric(*it, &retMetrics [i++]);
    397         retMetrics.detachTo (ComSafeArrayOutArg(outMetrics));
    398     }
     334    com::SafeIfaceArray<IPerformanceMetric> retMetrics (filteredMetrics.size());
     335    int i = 0;
     336    for (it = filteredMetrics.begin();
     337         it != filteredMetrics.end() && SUCCEEDED (rc); ++it)
     338        rc = toIPerformanceMetric(*it, &retMetrics [i++]);
     339    retMetrics.detachTo (ComSafeArrayOutArg(outMetrics));
     340
    399341    LogFlowThisFuncLeave();
    400342    return rc;
     
    403345STDMETHODIMP
    404346PerformanceCollector::DisableMetrics (ComSafeArrayIn (INPTR BSTR, metricNames),
    405                                       ComSafeArrayIn (IUnknown *, objects))
    406 {
    407     LogFlowThisFuncEnter();
    408     com::SafeIfaceArray <IPerformanceMetric> tmp;
    409     return DisableMetricsInt (ComSafeArrayInArg(metricNames),
    410                               ComSafeArrayInArg(objects),
    411                               false, ComSafeArrayAsOutParam(tmp));
    412 }
    413 
    414 STDMETHODIMP
    415 PerformanceCollector::DisableMetricsEx (ComSafeArrayIn (INPTR BSTR, metricNames),
    416347                                      ComSafeArrayIn (IUnknown *, objects),
    417348                                      ComSafeArrayOut (IPerformanceMetric *,
    418349                                                       outMetrics))
    419 {
    420     LogFlowThisFuncEnter();
    421     return DisableMetricsInt (ComSafeArrayInArg(metricNames),
    422                               ComSafeArrayInArg(objects),
    423                               true, ComSafeArrayOutArg(outMetrics));
    424 }
    425 
    426 HRESULT
    427 PerformanceCollector::DisableMetricsInt (ComSafeArrayIn (INPTR BSTR, metricNames),
    428                                          ComSafeArrayIn (IUnknown *, objects),
    429                                          bool reportAffected,
    430                                          ComSafeArrayOut (IPerformanceMetric *,
    431                                                           outMetrics))
    432350{
    433351    AutoCaller autoCaller (this);
     
    448366        {
    449367            (*it)->disable();
    450             if (reportAffected)
    451                 filteredMetrics.push_back(*it);
     368            filteredMetrics.push_back(*it);
    452369        }
    453370
    454     if (reportAffected)
    455     {
    456         com::SafeIfaceArray<IPerformanceMetric> retMetrics (filteredMetrics.size());
    457         int i = 0;
    458         for (it = filteredMetrics.begin();
    459              it != filteredMetrics.end() && SUCCEEDED (rc); ++it)
    460             rc = toIPerformanceMetric(*it, &retMetrics [i++]);
    461         retMetrics.detachTo (ComSafeArrayOutArg(outMetrics));
    462     }
     371    com::SafeIfaceArray<IPerformanceMetric> retMetrics (filteredMetrics.size());
     372    int i = 0;
     373    for (it = filteredMetrics.begin();
     374         it != filteredMetrics.end() && SUCCEEDED (rc); ++it)
     375        rc = toIPerformanceMetric(*it, &retMetrics [i++]);
     376    retMetrics.detachTo (ComSafeArrayOutArg(outMetrics));
     377
    463378    LogFlowThisFuncLeave();
    464379    return rc;
     
    470385                                        ComSafeArrayOut (BSTR, outMetricNames),
    471386                                        ComSafeArrayOut (IUnknown *, outObjects),
     387                                        ComSafeArrayOut (BSTR, outUnits),
     388                                        ComSafeArrayOut (ULONG, outScales),
     389                                        ComSafeArrayOut (ULONG, outSequenceNumbers),
    472390                                        ComSafeArrayOut (ULONG, outDataIndices),
    473391                                        ComSafeArrayOut (ULONG, outDataLengths),
    474392                                        ComSafeArrayOut (LONG, outData))
    475 {
    476     com::SafeArray <BSTR> tmpUnits;
    477     com::SafeArray <ULONG> tmpScales;
    478     com::SafeArray <ULONG> tmpSequenceNumbers;
    479     return QueryMetricsDataEx(ComSafeArrayInArg(metricNames),
    480                               ComSafeArrayInArg(objects),
    481                               ComSafeArrayOutArg(outMetricNames),
    482                               ComSafeArrayOutArg(outObjects),
    483                               ComSafeArrayAsOutParam(tmpUnits),
    484                               ComSafeArrayAsOutParam(tmpScales),
    485                               ComSafeArrayAsOutParam(tmpSequenceNumbers),
    486                               ComSafeArrayOutArg(outDataIndices),
    487                               ComSafeArrayOutArg(outDataLengths),
    488                               ComSafeArrayOutArg(outData));
    489 }
    490 
    491 STDMETHODIMP
    492 PerformanceCollector::QueryMetricsDataEx (ComSafeArrayIn (INPTR BSTR, metricNames),
    493                                           ComSafeArrayIn (IUnknown *, objects),
    494                                           ComSafeArrayOut (BSTR, outMetricNames),
    495                                           ComSafeArrayOut (IUnknown *, outObjects),
    496                                           ComSafeArrayOut (BSTR, outUnits),
    497                                           ComSafeArrayOut (ULONG, outScales),
    498                                           ComSafeArrayOut (ULONG, outSequenceNumbers),
    499                                           ComSafeArrayOut (ULONG, outDataIndices),
    500                                           ComSafeArrayOut (ULONG, outDataLengths),
    501                                           ComSafeArrayOut (LONG, outData))
    502393{
    503394    AutoCaller autoCaller (this);
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r13079 r13082  
    1055710557    <method name="setupMetrics">
    1055810558      <desc>
    10559         Sets parameters of specified base metrics for a set of objects.
    10560         <note>
    10561           @c Null metrics array means all metrics. @c Null object array means
    10562           all existing objects.
     10559        Sets parameters of specified base metrics for a set of objects. Returns
     10560        an array of <link to="IPerformanceMetric" /> describing the metrics have
     10561        been affected.
     10562        <note>
     10563          @c Null or empty metric name array means all metrics. @c Null or empty
     10564          object array means all existing objects. If metric name array contains
     10565          a single element and object array contains many, the single metric
     10566          name array element is applied to each object array element to form
     10567          metric/object pairs.
    1056310568        </note>
    1056410569      </desc>
    1056510570      <param name="metricNames" type="wstring" dir="in" safearray="yes">
    1056610571        <desc>
    10567           Metric name filter. Currently, only a comma-separated list of metrics
    10568           is supported.
     10572          Metric name filter. Comma-separated list of metrics with wildcard
     10573          support.
    1056910574        </desc>
    1057010575      </param>
     
    1058610591        </desc>
    1058710592      </param>
     10593      <param name="affectedMetrics" type="IPerformanceMetric" dir="return" safearray="yes">
     10594        <desc>
     10595          Array of metrics that have been modified by the call to this method.
     10596        </desc>
     10597      </param>
    1058810598    </method>
    1058910599
    1059010600    <method name="enableMetrics">
    1059110601      <desc>
    10592         Turns on collecting specified base metrics.
    10593         <note>
    10594           @c Null metrics array means all metrics. @c Null object array means
    10595           all existing objects.
     10602        Turns on collecting specified base metrics. Returns an array of
     10603        <link to="IPerformanceMetric" /> describing the metrics have been
     10604        affected.
     10605        <note>
     10606          @c Null or empty metric name array means all metrics. @c Null or empty
     10607          object array means all existing objects. If metric name array contains
     10608          a single element and object array contains many, the single metric
     10609          name array element is applied to each object array element to form
     10610          metric/object pairs.
    1059610611        </note>
    1059710612      </desc>
    1059810613      <param name="metricNames" type="wstring" dir="in" safearray="yes">
    1059910614        <desc>
    10600           Metric name filter. Currently, only a comma-separated list of metrics
    10601           is supported.
     10615          Metric name filter. Comma-separated list of metrics with wildcard
     10616          support.
    1060210617        </desc>
    1060310618      </param>
     
    1060710622        </desc>
    1060810623      </param>
     10624      <param name="affectedMetrics" type="IPerformanceMetric" dir="return" safearray="yes">
     10625        <desc>
     10626          Array of metrics that have been modified by the call to this method.
     10627        </desc>
     10628      </param>
    1060910629    </method>
    1061010630
    1061110631    <method name="disableMetrics">
    1061210632      <desc>
    10613         Turns off collecting specified base metrics.
    10614         <note>
    10615           @c Null metrics array means all metrics. @c Null object array means
    10616           all existing objects.
     10633        Turns off collecting specified base metrics. Returns an array of
     10634        <link to="IPerformanceMetric" /> describing the metrics have been
     10635        affected.
     10636        <note>
     10637          @c Null or empty metric name array means all metrics. @c Null or empty
     10638          object array means all existing objects. If metric name array contains
     10639          a single element and object array contains many, the single metric
     10640          name array element is applied to each object array element to form
     10641          metric/object pairs.
    1061710642        </note>
    1061810643      </desc>
    1061910644      <param name="metricNames" type="wstring" dir="in" safearray="yes">
    1062010645        <desc>
    10621           Metric name filter. Currently, only a comma-separated list of metrics
    10622           is supported.
     10646          Metric name filter. Comma-separated list of metrics with wildcard
     10647          support.
    1062310648        </desc>
    1062410649      </param>
     
    1062810653        </desc>
    1062910654      </param>
    10630     </method>
    10631 
    10632     <method name="setupMetricsEx">
    10633       <desc>
    10634         Sets parameters of specified base metrics for a set of objects.
    10635         Indentical to <link to="IPerformanceCollector::setupMetrics" /> except
    10636         that it returns an array of <link to="IPerformanceMetric" /> describing
    10637         the metrics have been affected.
    10638         <note>
    10639           @c Null metrics array means all metrics. @c Null object array means
    10640           all existing objects.
    10641         </note>
    10642       </desc>
    10643       <param name="metricNames" type="wstring" dir="in" safearray="yes">
    10644         <desc>
    10645           Metric name filter. Currently, only a comma-separated list of metrics
    10646           is supported.
    10647         </desc>
    10648       </param>
    10649       <param name="objects" type="$unknown" dir="in" safearray="yes">
    10650         <desc>
    10651           Set of objects to setup metric parameters for.
    10652         </desc>
    10653       </param>
    10654       <param name="period" type="unsigned long" dir="in">
    10655         <desc>
    10656           Time interval in seconds between two consecutive samples of performace
    10657           data.
    10658         </desc>
    10659       </param>
    10660       <param name="count" type="unsigned long" dir="in">
    10661         <desc>
    10662           Number of samples to retain in performance data history. Older samples
    10663           get discarded.
    10664         </desc>
    10665       </param>
    1066610655      <param name="affectedMetrics" type="IPerformanceMetric" dir="return" safearray="yes">
    1066710656        <desc>
     
    1067110660    </method>
    1067210661
    10673     <method name="enableMetricsEx">
    10674       <desc>
    10675         Turns on collecting specified base metrics.
    10676         Indentical to <link to="IPerformanceCollector::enableMetrics" /> except
    10677         that it returns an array of <link to="IPerformanceMetric" /> describing
    10678         the metrics have been affected.
    10679         <note>
    10680           @c Null metrics array means all metrics. @c Null object array means
    10681           all existing objects.
    10682         </note>
    10683       </desc>
    10684       <param name="metricNames" type="wstring" dir="in" safearray="yes">
    10685         <desc>
    10686           Metric name filter. Currently, only a comma-separated list of metrics
    10687           is supported.
    10688         </desc>
    10689       </param>
    10690       <param name="objects" type="$unknown" dir="in" safearray="yes">
    10691         <desc>
    10692           Set of objects to enable metrics for.
    10693         </desc>
    10694       </param>
    10695       <param name="affectedMetrics" type="IPerformanceMetric" dir="return" safearray="yes">
    10696         <desc>
    10697           Array of metrics that have been modified by the call to this method.
    10698         </desc>
    10699       </param>
    10700     </method>
    10701 
    10702     <method name="disableMetricsEx">
    10703       <desc>
    10704         Turns off collecting specified base metrics.
    10705         Indentical to <link to="IPerformanceCollector::disableMetrics" /> except
    10706         that it returns an array of <link to="IPerformanceMetric" /> describing
    10707         the metrics have been affected.
    10708         <note>
    10709           @c Null metrics array means all metrics. @c Null object array means
    10710           all existing objects.
    10711         </note>
    10712       </desc>
    10713       <param name="metricNames" type="wstring" dir="in" safearray="yes">
    10714         <desc>
    10715           Metric name filter. Currently, only a comma-separated list of metrics
    10716           is supported.
    10717         </desc>
    10718       </param>
    10719       <param name="objects" type="$unknown" dir="in" safearray="yes">
    10720         <desc>
    10721           Set of objects to disable metrics for.
    10722         </desc>
    10723       </param>
    10724       <param name="affectedMetrics" type="IPerformanceMetric" dir="return" safearray="yes">
    10725         <desc>
    10726           Array of metrics that have been modified by the call to this method.
    10727         </desc>
    10728       </param>
    10729     </method>
    10730 
    1073110662    <method name="queryMetricsData">
    1073210663      <desc>
    1073310664        Queries collected metrics data for a set of objects.
    1073410665
    10735         The data itself and related metric information are returned in four
    10736         parallel and one flattened array of arrays. Elements of @c
    10737         returnMetricNames, @c returnObjects, @c returnDataIndices and @c
    10738         returnDataLengths with the same index describe one set of values
    10739         corresponding to a single metric.
    10740 
    10741         The @a returnData parameter is a flattened array of arrays. Each start
    10742         and length of a sub-array is indicated by @a returnDataIndices and @a
    10743         returnDataLengths. The first value for metric <tt>metricNames[i]</tt> is at
    10744         <tt> returnData[returnIndices[i]]</tt>.
    10745 
    10746         <note>
    10747           @c Null metrics array means all applicable metrics. @c Null object
    10748           array means all existing objects.
     10666        The data itself and related metric information are returned in seven
     10667        parallel and one flattened array of arrays. Elements of
     10668        <tt>returnMetricNames, returnObjects, returnUnits, returnScales,
     10669        returnSequenceNumbers, returnDataIndices and returnDataLengths</tt> with
     10670        the same index describe one set of values corresponding to a single
     10671        metric.
     10672
     10673        The <tt>returnData</tt> parameter is a flattened array of arrays. Each
     10674        start and length of a sub-array is indicated by
     10675        <tt>returnDataIndices</tt> and <tt>returnDataLengths</tt>. The first
     10676        value for metric <tt>metricNames[i]</tt> is at
     10677        <tt>returnData[returnIndices[i]]</tt>.
     10678
     10679        <note>
     10680          @c Null or empty metric name array means all metrics. @c Null or empty
     10681          object array means all existing objects. If metric name array contains
     10682          a single element and object array contains many, the single metric
     10683          name array element is applied to each object array element to form
     10684          metric/object pairs.
    1074910685        </note>
    1075010686        <note>
     
    1076210698      <param name="metricNames" type="wstring" dir="in" safearray="yes">
    1076310699        <desc>
    10764           Metric name filter. Currently, only a comma-separated list of metrics
    10765           is supported.
     10700          Metric name filter. Comma-separated list of metrics with wildcard
     10701          support.
    1076610702        </desc>
    1076710703      </param>
     
    1078110717        </desc>
    1078210718      </param>
     10719      <param name="returnUnits" type="wstring" dir="out" safearray="yes">
     10720         <desc>
     10721           Units of measurement for each returned metric.
     10722         </desc>
     10723       </param>
     10724       <param name="returnScales" type="unsigned long" dir="out" safearray="yes">
     10725         <desc>
     10726           Divisor that should be applied to return values in order to get
     10727           floating point values. For example:
     10728           <tt>(double)returnData[returnDataIndices[0]+i] / returnScales[0]</tt>
     10729           will retrieve the floating point value of i-th sample of the first
     10730           metric.
     10731         </desc>
     10732       </param>
     10733       <param name="returnSequenceNumbers" type="unsigned long" dir="out" safearray="yes">
     10734         <desc>
     10735           Sequence numbers of the first elements of value sequences of particular metrics
     10736           returned in @c returnData. For aggregate metrics it is the sequence number of
     10737           the sample the aggregate started calculation from.
     10738         </desc>
     10739       </param>
    1078310740      <param name="returnDataIndices" type="unsigned long" dir="out" safearray="yes">
    1078410741        <desc>
     
    1079910756      </param>
    1080010757    </method>
    10801 
    10802     <method name="queryMetricsDataEx">
    10803       <desc>
    10804         Queries collected metrics data for a set of objects.
    10805 
    10806         Indentical to <link to="IPerformanceCollector::queryMetricsData" /> except
    10807         that it returns three additional arrays: <tt>returnUnits</tt>,
    10808         <tt>returnScales</tt>, <tt>returnSequenceNumbers</tt>. All additional
    10809         arrays have the same size as <tt>returnMetricNames</tt>.
    10810         <note>
    10811           @c Null metrics array means all applicable metrics. @c Null object
    10812           array means all existing objects.
    10813         </note>
    10814       </desc>
    10815       <param name="metricNames" type="wstring" dir="in" safearray="yes">
    10816         <desc>
    10817           Metric name filter. Currently, only a comma-separated list of metrics
    10818           is supported.
    10819         </desc>
    10820       </param>
    10821       <param name="objects" type="$unknown" dir="in" safearray="yes">
    10822         <desc>
    10823           Set of objects to query metrics for.
    10824         </desc>
    10825       </param>
    10826       <param name="returnMetricNames" type="wstring" dir="out" safearray="yes">
    10827         <desc>
    10828           Names of metrics returned in @c returnData.
    10829         </desc>
    10830       </param>
    10831       <param name="returnObjects" type="$unknown" dir="out" safearray="yes">
    10832         <desc>
    10833           Objects associated with metrics returned in @c returnData.
    10834         </desc>
    10835       </param>
    10836      <param name="returnUnits" type="wstring" dir="out" safearray="yes">
    10837         <desc>
    10838           Units of measurement for each returned metric.
    10839         </desc>
    10840       </param>
    10841       <param name="returnScales" type="unsigned long" dir="out" safearray="yes">
    10842         <desc>
    10843           Divisor that should be applied to return values in order to get
    10844           floating point values. For example:
    10845           <tt>(double)returnData[returnDataIndices[0]+i] / returnScales[0]</tt>
    10846           will retrieve the floating point value of i-th sample of the first
    10847           metric.
    10848         </desc>
    10849       </param>
    10850       <param name="returnSequenceNumbers" type="unsigned long" dir="out" safearray="yes">
    10851         <desc>
    10852           Sequence numbers of the first elements of value sequences of particular metrics
    10853           returned in @c returnData. For aggregate metrics it is the sequence number of
    10854           the sample the aggregate started calculation from.
    10855         </desc>
    10856       </param>
    10857       <param name="returnDataIndices" type="unsigned long" dir="out" safearray="yes">
    10858         <desc>
    10859           Indices of the first elements of value sequences of particular metrics
    10860           returned in @c returnData.
    10861         </desc>
    10862       </param>
    10863       <param name="returnDataLengths" type="unsigned long" dir="out" safearray="yes">
    10864         <desc>
    10865           Lengths of value sequences of particular metrics.
    10866         </desc>
    10867       </param>
    10868       <param name="returnData" type="long" dir="return" safearray="yes">
    10869         <desc>
    10870           Flattened array of all metric data containing sequences of values for
    10871           each metric.
    10872         </desc>
    10873       </param>
    10874    </method>
    10875 
    1087610758
    1087710759  </interface>
  • trunk/src/VBox/Main/include/PerformanceImpl.h

    r12973 r13082  
    148148    STDMETHOD(SetupMetrics) (ComSafeArrayIn (INPTR BSTR, metricNames),
    149149                             ComSafeArrayIn (IUnknown *, objects),
    150                              ULONG aPeriod, ULONG aCount);
     150                             ULONG aPeriod, ULONG aCount,
     151                             ComSafeArrayOut (IPerformanceMetric *,
     152                                              outMetrics));
    151153    STDMETHOD(EnableMetrics) (ComSafeArrayIn (INPTR BSTR, metricNames),
    152                               ComSafeArrayIn (IUnknown *, objects));
     154                              ComSafeArrayIn (IUnknown *, objects),
     155                              ComSafeArrayOut (IPerformanceMetric *,
     156                                               outMetrics));
    153157    STDMETHOD(DisableMetrics) (ComSafeArrayIn (INPTR BSTR, metricNames),
    154                                ComSafeArrayIn (IUnknown *, objects));
     158                               ComSafeArrayIn (IUnknown *, objects),
     159                               ComSafeArrayOut (IPerformanceMetric *,
     160                                                outMetrics));
    155161    STDMETHOD(QueryMetricsData) (ComSafeArrayIn (INPTR BSTR, metricNames),
    156162                                 ComSafeArrayIn (IUnknown *, objects),
    157163                                 ComSafeArrayOut (BSTR, outMetricNames),
    158164                                 ComSafeArrayOut (IUnknown *, outObjects),
     165                                 ComSafeArrayOut (BSTR, outUnits),
     166                                 ComSafeArrayOut (ULONG, outScales),
     167                                 ComSafeArrayOut (ULONG, outSequenceNumbers),
    159168                                 ComSafeArrayOut (ULONG, outDataIndices),
    160169                                 ComSafeArrayOut (ULONG, outDataLengths),
    161170                                 ComSafeArrayOut (LONG, outData));
    162 
    163     STDMETHOD(SetupMetricsEx) (ComSafeArrayIn (INPTR BSTR, metricNames),
    164                                ComSafeArrayIn (IUnknown *, objects),
    165                                ULONG aPeriod, ULONG aCount,
    166                                ComSafeArrayOut (IPerformanceMetric *,
    167                                                 outMetrics));
    168     STDMETHOD(EnableMetricsEx) (ComSafeArrayIn (INPTR BSTR, metricNames),
    169                                 ComSafeArrayIn (IUnknown *, objects),
    170                                 ComSafeArrayOut (IPerformanceMetric *,
    171                                                  outMetrics));
    172     STDMETHOD(DisableMetricsEx) (ComSafeArrayIn (INPTR BSTR, metricNames),
    173                                  ComSafeArrayIn (IUnknown *, objects),
    174                                  ComSafeArrayOut (IPerformanceMetric *,
    175                                                   outMetrics));
    176     STDMETHOD(QueryMetricsDataEx) (ComSafeArrayIn (INPTR BSTR, metricNames),
    177                                    ComSafeArrayIn (IUnknown *, objects),
    178                                    ComSafeArrayOut (BSTR, outMetricNames),
    179                                    ComSafeArrayOut (IUnknown *, outObjects),
    180                                    ComSafeArrayOut (BSTR, outUnits),
    181                                    ComSafeArrayOut (ULONG, outScales),
    182                                    ComSafeArrayOut (ULONG, outSequenceNumbers),
    183                                    ComSafeArrayOut (ULONG, outDataIndices),
    184                                    ComSafeArrayOut (ULONG, outDataLengths),
    185                                    ComSafeArrayOut (LONG, outData));
    186171
    187172    // public methods only for internal purposes
     
    203188    HRESULT toIPerformanceMetric(pm::Metric *src, IPerformanceMetric **dst);
    204189    HRESULT toIPerformanceMetric(pm::BaseMetric *src, IPerformanceMetric **dst);
    205     HRESULT SetupMetricsInt(ComSafeArrayIn (INPTR BSTR, metricNames),
    206                             ComSafeArrayIn (IUnknown *, objects),
    207                             ULONG aPeriod, ULONG aCount, bool reportAffected,
    208                             ComSafeArrayOut (IPerformanceMetric *, outMetrics));
    209     HRESULT EnableMetricsInt (ComSafeArrayIn (INPTR BSTR, metricNames),
    210                               ComSafeArrayIn (IUnknown *, objects),
    211                               bool reportAffected,
    212                               ComSafeArrayOut (IPerformanceMetric *,
    213                                                outMetrics));
    214     HRESULT DisableMetricsInt (ComSafeArrayIn (INPTR BSTR, metricNames),
    215                                ComSafeArrayIn (IUnknown *, objects),
    216                                bool reportAffected,
    217                                ComSafeArrayOut (IPerformanceMetric *,
    218                                                 outMetrics));
    219190                           
    220191    static void staticSamplerCallback (RTTIMERLR hTimerLR, void *pvUser, uint64_t iTick);
  • trunk/src/VBox/Main/testcase/tstAPI.cpp

    r12668 r13082  
    970970        // Setup base metrics
    971971        // Note that one needs to set up metrics after a session is open for a machine.
     972        com::SafeIfaceArray<IPerformanceMetric> affectedMetrics;
    972973        com::SafeIfaceArray<IUnknown> objects(2);
    973974        host.queryInterfaceTo(&objects[0]);
    974975        machine.queryInterfaceTo(&objects[1]);
    975976        CHECK_ERROR_BREAK (collector, SetupMetrics(ComSafeArrayAsInParam(baseMetrics),
    976                                                    ComSafeArrayAsInParam(objects), 1u, 10u) );
     977                                                   ComSafeArrayAsInParam(objects), 1u, 10u,
     978                                                   ComSafeArrayAsOutParam(affectedMetrics)) );
     979        listAffectedMetrics(virtualBox,
     980                            ComSafeArrayAsInParam(affectedMetrics));
     981        affectedMetrics.setNull();
    977982
    978983        // Get console
     
    9961001        queryMetrics(virtualBox, collector, ComSafeArrayAsInParam(objects));
    9971002
    998         com::SafeIfaceArray<IPerformanceMetric> affectedMetrics;
    9991003        printf("\nDrop collected metrics: ----------------------------------------\n");
    10001004        CHECK_ERROR_BREAK (collector,
    1001             SetupMetricsEx(ComSafeArrayAsInParam(baseMetrics),
    1002                            ComSafeArrayAsInParam(objects),
    1003                            1u, 5u, ComSafeArrayAsOutParam(affectedMetrics)) );
     1005            SetupMetrics(ComSafeArrayAsInParam(baseMetrics),
     1006                         ComSafeArrayAsInParam(objects),
     1007                         1u, 5u, ComSafeArrayAsOutParam(affectedMetrics)) );
    10041008        listAffectedMetrics(virtualBox,
    10051009                            ComSafeArrayAsInParam(affectedMetrics));
     
    10121016        printf("\nDisable collection of VM metrics: ------------------------------\n");
    10131017        CHECK_ERROR_BREAK (collector,
    1014             DisableMetricsEx(ComSafeArrayAsInParam(baseMetrics),
    1015                              ComSafeArrayAsInParam(vmObject),
    1016                              ComSafeArrayAsOutParam(affectedMetrics)) );
     1018            DisableMetrics(ComSafeArrayAsInParam(baseMetrics),
     1019                           ComSafeArrayAsInParam(vmObject),
     1020                           ComSafeArrayAsOutParam(affectedMetrics)) );
    10171021        listAffectedMetrics(virtualBox,
    10181022                            ComSafeArrayAsInParam(affectedMetrics));
     
    10231027        printf("\nRe-enable collection of all metrics: ---------------------------\n");
    10241028        CHECK_ERROR_BREAK (collector,
    1025             EnableMetricsEx(ComSafeArrayAsInParam(baseMetrics),
    1026                             ComSafeArrayAsInParam(objects),
    1027                             ComSafeArrayAsOutParam(affectedMetrics)) );
     1029            EnableMetrics(ComSafeArrayAsInParam(baseMetrics),
     1030                          ComSafeArrayAsInParam(objects),
     1031                          ComSafeArrayAsOutParam(affectedMetrics)) );
    10281032        listAffectedMetrics(virtualBox,
    10291033                            ComSafeArrayAsInParam(affectedMetrics));
     
    10731077    com::SafeArray<BSTR>          retNames;
    10741078    com::SafeIfaceArray<IUnknown> retObjects;
     1079    com::SafeArray<BSTR>          retUnits;
     1080    com::SafeArray<ULONG>         retScales;
     1081    com::SafeArray<ULONG>         retSequenceNumbers;
    10751082    com::SafeArray<ULONG>         retIndices;
    10761083    com::SafeArray<ULONG>         retLengths;
     
    10801087                                             ComSafeArrayAsOutParam(retNames),
    10811088                                             ComSafeArrayAsOutParam(retObjects),
     1089                                             ComSafeArrayAsOutParam(retUnits),
     1090                                             ComSafeArrayAsOutParam(retScales),
     1091                                             ComSafeArrayAsOutParam(retSequenceNumbers),
    10821092                                             ComSafeArrayAsOutParam(retIndices),
    10831093                                             ComSafeArrayAsOutParam(retLengths),
     
    10871097    for (unsigned i = 0; i < retNames.size(); i++)
    10881098    {
    1089         // Get info for the metric
    1090         com::SafeArray<BSTR> nameOfMetric(1);
    1091         Bstr tmpName(retNames[i]);
    1092         tmpName.detachTo (&nameOfMetric[0]);
    1093         com::SafeIfaceArray<IUnknown> anObject(1);
    1094         ComPtr<IUnknown> tmpObject(retObjects[i]);
    1095         tmpObject.queryInterfaceTo(&anObject[0]);
    1096         com::SafeIfaceArray <IPerformanceMetric> metricInfo;
    1097         CHECK_RC_BREAK (collector->GetMetrics( ComSafeArrayAsInParam(nameOfMetric),
    1098                                                ComSafeArrayAsInParam(anObject),
    1099                                                ComSafeArrayAsOutParam(metricInfo) ));
    1100         BSTR metricUnitBSTR;
    1101         CHECK_RC_BREAK (metricInfo[0]->COMGETTER(Unit) (&metricUnitBSTR));
    1102         Bstr metricUnit(metricUnitBSTR);
     1099        Bstr metricUnit(retUnits[i]);
    11031100        Bstr metricName(retNames[i]);
    1104         LONG minVal, maxVal;
    1105         CHECK_RC_BREAK (metricInfo[0]->COMGETTER(MinimumValue) (&minVal));
    1106         CHECK_RC_BREAK (metricInfo[0]->COMGETTER(MaximumValue) (&maxVal));
    1107         RTPrintf("%-10ls %-20ls ", getObjectName(aVirtualBox, anObject[0]).raw(), metricName.raw());
     1101        RTPrintf("%-10ls %-20ls ", getObjectName(aVirtualBox, retObjects[i]).raw(), metricName.raw());
    11081102        const char *separator = "";
    11091103        for (unsigned j = 0; j < retLengths[i]; j++)
    11101104        {
    1111             if (strcmp((const char *)metricUnit.raw(), "%"))
     1105            if (retScales[i] == 1)
    11121106                RTPrintf("%s%d %ls", separator, retData[retIndices[i] + j], metricUnit.raw());
    11131107            else
    1114                 RTPrintf("%s%d.%02d%%", separator, retData[retIndices[i] + j] / 1000, (retData[retIndices[i] + j] / 10) % 100);
     1108                RTPrintf("%s%d.%02d%ls", separator, retData[retIndices[i] + j] / retScales[i],
     1109                         (retData[retIndices[i] + j] * 100 / retScales[i]) % 100, metricUnit.raw());
    11151110            separator = ", ";
    11161111        }
  • trunk/src/libs/xpcom18a4/python/sample/shellcommon.py

    r12942 r13082  
    2323        self.collector = vb.performanceCollector
    2424
    25     def _update_metric_params(self):
    26         metrics = self.collector.getMetrics(['*'], None)
    27         self.metrics = {}
    28         for m in metrics:
    29             self.metrics[str(m.object) + "/" + str(m.metricName)] = m
    30 
    3125    def setup(self, names, objects, period, nsamples):
    3226        """ Discards all previously collected values for the specified
     
    3529        """
    3630        self.collector.setupMetrics(names, objects, period, nsamples)
    37         self._update_metric_params()
    3831
    3932    def enable(self, names, objects):
     
    5851        'values_as_string': pre-processed values ready for 'print' statement
    5952        """
    60         (values, names_out, objects_out, indices, lengths) = self.collector.queryMetricsData(names, objects)
     53        (values, names_out, objects_out, units, scales, sequence_numbers,
     54            indices, lengths) = self.collector.queryMetricsData(names, objects)
    6155        out = []
    6256        for i in xrange(0, len(names_out)):
    63             metric = self.metrics[str(objects_out[i]) + "/" + str(names_out[i])]
    64             unit = str(metric.getUnit())
    65             if unit == '%':
    66                 scale = 1000.
     57            scale = int(scales[i])
     58            if scale != 1:
    6759                fmt = '%.2f%s'
    6860            else:
    69                 scale = 1
    7061                fmt = '%d %s'
    7162            out.append({
    7263                'name':str(names_out[i]),
    7364                'object':str(objects_out[i]),
    74                 'unit':str(metric.getUnit()),
     65                'unit':str(units[i]),
    7566                'scale':scale,
    7667                'values':[int(values[j]) for j in xrange(int(indices[i]), int(indices[i])+int(lengths[i]))],
    77                 'values_as_string':'['+', '.join([fmt % (int(values[j])/scale, unit) for j in xrange(int(indices[i]), int(indices[i])+int(lengths[i]))])+']'
     68                'values_as_string':'['+', '.join([fmt % (int(values[j])/scale, units[i]) for j in xrange(int(indices[i]), int(indices[i])+int(lengths[i]))])+']'
    7869            })
    7970        return out
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette