Changeset 28004 in vbox
- Timestamp:
- Apr 6, 2010 1:23:44 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 59711
- Location:
- trunk/src/VBox/Main
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/GuestImpl.cpp
r27998 r28004 38 38 #include <iprt/cpp/utils.h> 39 39 #include <iprt/getopt.h> 40 #include <VBox/pgm.h> 40 41 41 42 // defines … … 252 253 } 253 254 254 STDMETHODIMP Guest::InternalGetStatistics(ULONG aCpuId, ULONG*aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle,255 ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMem Cache,256 ULONG *a PageTotal)255 STDMETHODIMP Guest::InternalGetStatistics(ULONG *aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle, 256 ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMemBalloonTotal, 257 ULONG *aMemCache, ULONG *aPageTotal) 257 258 { 258 259 CheckComArgOutPointerValid(aCpuUser); … … 275 276 *aMemTotal = mCurrentGuestStat[GUESTSTATTYPE_MEMTOTAL]; 276 277 *aMemFree = mCurrentGuestStat[GUESTSTATTYPE_MEMFREE]; 277 *aMemBalloon = mCurrentGuestStat[GUESTSTATTYPE_MEMBALLOON]; 278 278 279 *aMemCache = mCurrentGuestStat[GUESTSTATTYPE_MEMCACHE]; 279 280 *aPageTotal = mCurrentGuestStat[GUESTSTATTYPE_PAGETOTAL]; 281 282 Console::SafeVMPtr pVM (mParent); 283 if (pVM.isOk()) 284 { 285 unsigned uBalloon, uBalloonTotal; 286 *aMemBalloon = 0; 287 *aMemBalloonTotal = 0; 288 int rc = PGMR3QueryBalloonSize(pVM.raw(), &uBalloon, &uBalloonTotal); 289 AssertRC(rc); 290 if (rc == VINF_SUCCESS) 291 { 292 *aMemBalloon = uBalloon; 293 *aMemBalloonTotal = uBalloonTotal; 294 } 295 } 296 else 297 { 298 *aMemBalloon = 0; 299 *aMemBalloonTotal = 0; 300 } 280 301 281 302 return S_OK; -
trunk/src/VBox/Main/HostImpl.cpp
r27797 r28004 2411 2411 pm::SubMetric *ramUsageFree = new pm::SubMetric("RAM/Usage/Free", 2412 2412 "Physical memory currently available to applications."); 2413 pm::SubMetric *ramUsageBalloon = new pm::SubMetric("RAM/Usage/Ballooned", 2414 "Physical memory currently available from guest balloons."); 2413 2415 /* Create and register base metrics */ 2414 2416 IUnknown *objptr; … … 2421 2423 aCollector->registerBaseMetric (cpuMhz); 2422 2424 pm::BaseMetric *ramUsage = new pm::HostRamUsage(hal, objptr, ramUsageTotal, ramUsageUsed, 2423 ramUsageFree );2425 ramUsageFree, ramUsageBalloon); 2424 2426 aCollector->registerBaseMetric (ramUsage); 2425 2427 … … 2479 2481 aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageFree, 2480 2482 new pm::AggregateMax())); 2483 2484 aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageBalloon, 0)); 2485 aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageBalloon, 2486 new pm::AggregateAvg())); 2487 aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageBalloon, 2488 new pm::AggregateMin())); 2489 aCollector->registerMetric(new pm::Metric(ramUsage, ramUsageBalloon, 2490 new pm::AggregateMax())); 2481 2491 }; 2482 2492 -
trunk/src/VBox/Main/Performance.cpp
r27998 r28004 168 168 && iTick != mLastTick) 169 169 { 170 mGuest->InternalGetStatistics(0, &mCpuUser, &mCpuKernel, &mCpuIdle, 171 &mMemTotal, &mMemFree, &mMemBalloon, &mMemCache, 170 ULONG ulMemBalloonTotal; 171 172 mGuest->InternalGetStatistics(&mCpuUser, &mCpuKernel, &mCpuIdle, 173 &mMemTotal, &mMemFree, &mMemBalloon, &ulMemBalloonTotal, &mMemCache, 172 174 &mPageTotal); 173 175 mLastTick = iTick; -
trunk/src/VBox/Main/PerformanceImpl.cpp
r27998 r28004 68 68 "RAM/Usage/Free:min", 69 69 "RAM/Usage/Free:max", 70 "RAM/Usage/Ballooned", 71 "RAM/Usage/Ballooned:avg", 72 "RAM/Usage/Ballooned:min", 73 "RAM/Usage/Ballooned:max", 70 74 "Guest/CPU/Load/User", 71 75 "Guest/CPU/Load/User:avg", -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r27998 r28004 8271 8271 <interface 8272 8272 name="IGuestOSType" extends="$unknown" 8273 uuid=" 8cec1502-8869-42e3-9d9c-45f0d1bb0861"8273 uuid="3fcf2078-3c69-45ca-bd5c-79c3e3c15362" 8274 8274 wsmap="struct" 8275 8275 > … … 8353 8353 <interface 8354 8354 name="IGuest" extends="$unknown" 8355 uuid=" a2c749bb-55df-46a4-8d88-567ee1503fff"8355 uuid="8e809ebd-c842-4952-8073-c9c07045c9a2" 8356 8356 wsmap="managed" 8357 8357 > … … 8426 8426 Internal method; do not use as it might change at any time 8427 8427 </desc> 8428 <param name="cpuId" type="unsigned long" dir="in">8429 <desc>Virtual CPU id</desc>8430 </param>8431 8428 <param name="cpuUser" type="unsigned long" dir="out"> 8432 8429 <desc>Percentage of processor time spent in user mode as seen by the guest</desc> … … 8446 8443 <param name="memBalloon" type="unsigned long" dir="out"> 8447 8444 <desc>Amount of ballooned physical guest RAM</desc> 8445 </param> 8446 <param name="memBalloonTotal" type="unsigned long" dir="out"> 8447 <desc>Amount of ballooned physical guest RAM for all running VMs</desc> 8448 8448 </param> 8449 8449 <param name="memCache" type="unsigned long" dir="out"> -
trunk/src/VBox/Main/include/GuestImpl.h
r27998 r28004 88 88 IN_BSTR aUserName, IN_BSTR aPassword, 89 89 ULONG aTimeoutMS, ULONG* aPID, IProgress **aProgress); 90 STDMETHOD(InternalGetStatistics)(ULONG aCpuId, ULONG*aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle,91 ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMem Cache,90 STDMETHOD(InternalGetStatistics)(ULONG *aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle, 91 ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMemBalloonTotal, ULONG *aMemCache, 92 92 ULONG *aPageTotal); 93 93 -
trunk/src/VBox/Main/include/Performance.h
r27998 r28004 189 189 void getGuestMemLoad(ULONG *pulMemTotal, ULONG *pulMemFree, ULONG *pulMemBalloon, ULONG *pulMemCache, ULONG *pulPageTotal) 190 190 { 191 *pulMemTotal = mMemTotal;192 *pulMemFree = mMemFree;193 *pulMemBalloon = mMemBalloon;194 *pulMemCache = mMemCache;195 *pulPageTotal = mPageTotal;191 *pulMemTotal = mMemTotal; 192 *pulMemFree = mMemFree; 193 *pulMemBalloon = mMemBalloon; 194 *pulMemCache = mMemCache; 195 *pulPageTotal = mPageTotal; 196 196 } 197 197 … … 318 318 { 319 319 public: 320 HostRamUsage(CollectorHAL *hal, ComPtr<IUnknown> object, SubMetric *total, SubMetric *used, SubMetric *available )321 : BaseMetric(hal, "RAM/Usage", object), mTotal(total), mUsed(used), mAvailable(available) {};322 ~HostRamUsage() { delete mTotal; delete mUsed; delete mAvailable; };320 HostRamUsage(CollectorHAL *hal, ComPtr<IUnknown> object, SubMetric *total, SubMetric *used, SubMetric *available, SubMetric *ballooned) 321 : BaseMetric(hal, "RAM/Usage", object), mTotal(total), mUsed(used), mAvailable(available), mBallooned(ballooned) {}; 322 ~HostRamUsage() { delete mTotal; delete mUsed; delete mAvailable; delete mBallooned; }; 323 323 324 324 void init(ULONG period, ULONG length); … … 333 333 SubMetric *mUsed; 334 334 SubMetric *mAvailable; 335 SubMetric *mBallooned; 335 336 }; 336 337
Note:
See TracChangeset
for help on using the changeset viewer.