VirtualBox

Changeset 11583 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Aug 22, 2008 7:05:15 PM (16 years ago)
Author:
vboxsync
Message:

PerfAPI: New attribute PerformanceMetric::description

Location:
trunk/src/VBox/Main
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/HostImpl.cpp

    r11481 r11583  
    27362736    pm::MetricFactory *metricFactory = aCollector->getMetricFactory();
    27372737    /* Create sub metrics */
    2738     pm::SubMetric *cpuLoadUser   = new pm::SubMetric ("CPU/Load/User");
    2739     pm::SubMetric *cpuLoadKernel = new pm::SubMetric ("CPU/Load/Kernel");
    2740     pm::SubMetric *cpuLoadIdle   = new pm::SubMetric ("CPU/Load/Idle");
    2741     pm::SubMetric *cpuMhzSM      = new pm::SubMetric ("CPU/MHz");
    2742     pm::SubMetric *ramUsageTotal = new pm::SubMetric ("RAM/Usage/Total");
    2743     pm::SubMetric *ramUsageUsed  = new pm::SubMetric ("RAM/Usage/Used");
    2744     pm::SubMetric *ramUsageFree  = new pm::SubMetric ("RAM/Usage/Free");
     2738    pm::SubMetric *cpuLoadUser   = new pm::SubMetric ("CPU/Load/User",
     2739        "Percentage of processor time spent in user mode.");
     2740    pm::SubMetric *cpuLoadKernel = new pm::SubMetric ("CPU/Load/Kernel",
     2741        "Percentage of processor time spent in kernel mode.");
     2742    pm::SubMetric *cpuLoadIdle   = new pm::SubMetric ("CPU/Load/Idle",
     2743        "Percentage of processor time spent idling.");
     2744    pm::SubMetric *cpuMhzSM      = new pm::SubMetric ("CPU/MHz",
     2745        "Average of current frequency of all processors.");
     2746    pm::SubMetric *ramUsageTotal = new pm::SubMetric ("RAM/Usage/Total",
     2747        "Total physical memory installed.");
     2748    pm::SubMetric *ramUsageUsed  = new pm::SubMetric ("RAM/Usage/Used",
     2749        "Physical memory currently occupied.");
     2750    pm::SubMetric *ramUsageFree  = new pm::SubMetric ("RAM/Usage/Free",
     2751        "Physical memory currently available to applications.");
    27452752    /* Create and register base metrics */
    27462753    IUnknown *objptr;
  • trunk/src/VBox/Main/MachineImpl.cpp

    r11357 r11583  
    75837583    pm::MetricFactory *metricFactory = aCollector->getMetricFactory();
    75847584    /* Create sub metrics */
    7585     pm::SubMetric *cpuLoadUser = new pm::SubMetric ("CPU/Load/User");
    7586     pm::SubMetric *cpuLoadKernel = new pm::SubMetric ("CPU/Load/Kernel");
    7587     pm::SubMetric *ramUsageUsed  = new pm::SubMetric ("RAM/Usage/Used");
     7585    pm::SubMetric *cpuLoadUser = new pm::SubMetric ("CPU/Load/User",
     7586        "Percentage of processor time spent in user mode by VM process.");
     7587    pm::SubMetric *cpuLoadKernel = new pm::SubMetric ("CPU/Load/Kernel",
     7588        "Percentage of processor time spent in kernel mode by VM process.");
     7589    pm::SubMetric *ramUsageUsed  = new pm::SubMetric ("RAM/Usage/Used",
     7590        "Size of resident portion of VM process in memory.");
    75887591    /* Create and register base metrics */
    75897592    IUnknown *objptr;
  • trunk/src/VBox/Main/Performance.cpp

    r11571 r11583  
    2626 *
    2727 * 1) Detection of erroneous metric names
    28  * 2) Wildcards in metric names
    29  * 3) Darwin backend
    30  * 4) [OS/2 backend]
    3128 */
    3229
  • trunk/src/VBox/Main/PerformanceImpl.cpp

    r11481 r11583  
    510510HRESULT PerformanceMetric::init (pm::Metric *aMetric)
    511511{
    512     m.name   = aMetric->getName();
    513     m.object = aMetric->getObject();
    514     m.period = aMetric->getPeriod();
    515     m.count  = aMetric->getLength();
    516     m.unit   = aMetric->getUnit();
    517     m.min    = aMetric->getMinValue();
    518     m.max    = aMetric->getMaxValue();
     512    m.name        = aMetric->getName();
     513    m.object      = aMetric->getObject();
     514    m.description = aMetric->getDescription();
     515    m.period      = aMetric->getPeriod();
     516    m.count       = aMetric->getLength();
     517    m.unit        = aMetric->getUnit();
     518    m.min         = aMetric->getMinValue();
     519    m.max         = aMetric->getMaxValue();
    519520    return S_OK;
    520521}
     
    539540}
    540541
     542STDMETHODIMP PerformanceMetric::COMGETTER(Description) (BSTR *aDescription)
     543{
     544    m.description.cloneTo (aDescription);
     545    return S_OK;
     546}
     547
    541548STDMETHODIMP PerformanceMetric::COMGETTER(Period) (ULONG *aPeriod)
    542549{
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r11441 r11583  
    1032010320  <interface
    1032110321    name="IPerformanceMetric" extends="$unknown"
    10322     uuid="50831d4c-ed55-4221-836c-87b487d3b44a" wsmap="managed"
     10322    uuid="2a1a60ae-9345-4019-ad53-d34ba41cbfe9" wsmap="managed"
    1032310323  >
    1032410324    <desc>
     
    1033610336      <desc>
    1033710337        Object this metric belongs to.
     10338      </desc>
     10339    </attribute>
     10340
     10341    <attribute name="description" type="wstring" readonly="yes">
     10342      <desc>
     10343        Textual description of the metric.
    1033810344      </desc>
    1033910345    </attribute>
  • trunk/src/VBox/Main/include/Performance.h

    r11571 r11583  
    5353    {
    5454    public:
    55         SubMetric(const char *name)
    56         : mName(name) {};
     55        SubMetric(const char *name, const char *description)
     56        : mName(name), mDescription(description) {};
    5757        void query(ULONG *data);
    5858        const char *getName() { return mName; };
     59        const char *getDescription() { return mDescription; };
    5960    private:
    6061        const char *mName;
     62        const char *mDescription;
    6163    };
    6264
     
    271273        const char *getName() { return mName.c_str(); };
    272274        ComPtr<IUnknown> getObject() { return mBaseMetric->getObject(); };
     275        const char *getDescription()
     276            { return mAggregate ? "" : mSubMetric->getDescription(); };
    273277        const char *getUnit() { return mBaseMetric->getUnit(); };
    274278        ULONG getMinValue() { return mBaseMetric->getMinValue(); };
    275279        ULONG getMaxValue() { return mBaseMetric->getMaxValue(); };
    276280        ULONG getPeriod() { return mBaseMetric->getPeriod(); };
    277         ULONG getLength() { return mAggregate ? 1 : mBaseMetric->getLength(); };
     281        ULONG getLength()
     282            { return mAggregate ? 1 : mBaseMetric->getLength(); };
    278283        void query(ULONG **data, ULONG *count);
    279284
  • trunk/src/VBox/Main/include/PerformanceImpl.h

    r11321 r11583  
    7373    STDMETHOD(COMGETTER(MetricName)) (BSTR *aMetricName);
    7474    STDMETHOD(COMGETTER(Object)) (IUnknown **anObject);
     75    STDMETHOD(COMGETTER(Description)) (BSTR *aDescription);
    7576    STDMETHOD(COMGETTER(Period)) (ULONG *aPeriod);
    7677    STDMETHOD(COMGETTER(Count)) (ULONG *aCount);
     
    9596        Bstr             name;
    9697        ComPtr<IUnknown> object;
     98        Bstr             description;
    9799        ULONG            period;
    98100        ULONG            count;
Note: See TracChangeset for help on using the changeset viewer.

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