VirtualBox

Changeset 4316

Show
Ignore:
Timestamp:
08/23/07 17:02:45 (1 year ago)
Author:
vboxsync
Message:

Skeleton for guest statistics

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/VBox/Main/GuestImpl.cpp

    r4314 r4316  
    199199} 
    200200 
     201STDMETHODIMP Guest::GetGuestStatistic(GuestStatisticType_T statistic, ULONG *aStatVal) 
     202{ 
     203    if (!aStatVal) 
     204        return E_INVALIDARG; 
     205 
     206    switch(statistic) 
     207    { 
     208    case GuestStatisticType_CPULoad: 
     209    case GuestStatisticType_Threads: 
     210    case GuestStatisticType_Processes: 
     211    case GuestStatisticType_PhysMemTotal: 
     212    case GuestStatisticType_PhysMemAvailable: 
     213    case GuestStatisticType_PageFileSize: 
     214        *aStatVal = 0; 
     215        break; 
     216 
     217    default: 
     218        AssertFailed(); 
     219        return E_INVALIDARG; 
     220    } 
     221    return S_OK; 
     222} 
     223 
     224STDMETHODIMP Guest::SetGuestStatistic(GuestStatisticType_T statistic, ULONG aStatVal) 
     225{ 
     226    switch(statistic) 
     227    { 
     228    case GuestStatisticType_CPULoad: 
     229    case GuestStatisticType_Threads: 
     230    case GuestStatisticType_Processes: 
     231    case GuestStatisticType_PhysMemTotal: 
     232    case GuestStatisticType_PhysMemAvailable: 
     233    case GuestStatisticType_PageFileSize: 
     234        break; 
     235 
     236    default: 
     237        AssertFailed(); 
     238        return E_INVALIDARG; 
     239    } 
     240    return S_OK; 
     241} 
    201242 
    202243// public methods only for internal purposes 
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r4314 r4316  
    407407  </enum> 
    408408 
     409  <enum 
     410     name="GuestStatisticType" 
     411     uuid="da89a1b7-e602-45ac-84b7-29c9d12b92d5" 
     412     > 
     413    <const name="CPULoad"              value="0"> 
     414      <desc> 
     415        Current CPU load (0-100%). 
     416      </desc> 
     417    </const> 
     418    <const name="Threads"              value="1"> 
     419      <desc> 
     420        Total number of threads in the system. 
     421      </desc> 
     422    </const> 
     423    <const name="Processes"            value="2"> 
     424      <desc> 
     425        Total number of processes in the system. 
     426      </desc> 
     427    </const> 
     428    <const name="PhysMemTotal"         value="3"> 
     429      <desc> 
     430        Total physical memory in megabytes. 
     431      </desc> 
     432    </const> 
     433    <const name="PhysMemAvailable"     value="4"> 
     434      <desc> 
     435        Free physical memory in megabytes. 
     436      </desc> 
     437    </const> 
     438    <const name="PageFileSize"         value="5"> 
     439      <desc> 
     440        Pagefile size in megabytes. 
     441      </desc> 
     442    </const> 
     443  </enum> 
     444  
    409445  <!-- 
    410446  // IVirtualBoxErrorInfo 
     
    44014437    </method> 
    44024438 
     4439    <method name="getGuestStatistic"> 
     4440      <desc> 
     4441        Query specified guest statistics as reported by the VirtualBox Additions. 
     4442      </desc> 
     4443      <param name="statistic" type="GuestStatisticType" dir="in"> 
     4444        <desc>Statistic type.</desc> 
     4445      </param> 
     4446      <param name="statVal" type="unsigned long" dir="out"> 
     4447        <desc>Statistics value</desc> 
     4448      </param> 
     4449    </method> 
     4450 
    44034451  </interface> 
    44044452 
  • trunk/src/VBox/Main/include/GuestImpl.h

    r4314 r4316  
    6262    STDMETHOD(SetCredentials)(INPTR BSTR aUserName, INPTR BSTR aPassword, 
    6363                              INPTR BSTR aDomain, BOOL aAllowInteractiveLogon); 
     64    STDMETHOD(GetGuestStatistic)(GuestStatisticType_T statistic, ULONG *aStatVal); 
    6465 
    6566    // public methods that are not in IDL 
     
    6768 
    6869    void setSupportsSeamless (BOOL aSupportsSeamless); 
     70 
     71    STDMETHOD(SetGuestStatistic)(GuestStatisticType_T statistic, ULONG aStatVal); 
    6972 
    7073    // for VirtualBoxSupportErrorInfoImpl 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy