Changeset 27998 in vbox
- Timestamp:
- Apr 6, 2010 11:39:20 AM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/GuestImpl.cpp
r27996 r27998 254 254 STDMETHODIMP Guest::InternalGetStatistics(ULONG aCpuId, ULONG *aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle, 255 255 ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMemCache, 256 ULONG *aPageTotal , ULONG *aPageFree)256 ULONG *aPageTotal) 257 257 { 258 258 CheckComArgOutPointerValid(aCpuUser); … … 264 264 CheckComArgOutPointerValid(aMemCache); 265 265 CheckComArgOutPointerValid(aPageTotal); 266 CheckComArgOutPointerValid(aPageFree);267 266 268 267 AutoCaller autoCaller(this); … … 279 278 *aMemCache = mCurrentGuestStat[GUESTSTATTYPE_MEMCACHE]; 280 279 *aPageTotal = mCurrentGuestStat[GUESTSTATTYPE_PAGETOTAL]; 281 *aPageFree = mCurrentGuestStat[GUESTSTATTYPE_PAGEFREE];282 280 283 281 return S_OK; -
trunk/src/VBox/Main/MachineImpl.cpp
r27918 r27998 8962 8962 8963 8963 pm::SubMetric *guestPagedTotal = new pm::SubMetric("Guest/Pagefile/Usage/Total", "Total amount of space in the page file."); 8964 pm::SubMetric *guestPagedFree = new pm::SubMetric("Guest/Pagefile/Usage/Free", "Free amount of free space in the page file.");8965 8964 8966 8965 /* Create and register base metrics */ … … 8969 8968 8970 8969 pm::BaseMetric *guestCpuMem = new pm::GuestRamUsage(mGuestHAL, aMachine, guestMemTotal, guestMemFree, guestMemBalloon, 8971 guestMemCache, guestPagedTotal , guestPagedFree);8970 guestMemCache, guestPagedTotal); 8972 8971 aCollector->registerBaseMetric(guestCpuMem); 8973 8972 … … 9011 9010 aCollector->registerMetric(new pm::Metric(guestCpuMem, guestPagedTotal, new pm::AggregateMin())); 9012 9011 aCollector->registerMetric(new pm::Metric(guestCpuMem, guestPagedTotal, new pm::AggregateMax())); 9013 9014 aCollector->registerMetric(new pm::Metric(guestCpuMem, guestPagedFree, 0));9015 aCollector->registerMetric(new pm::Metric(guestCpuMem, guestPagedFree, new pm::AggregateAvg()));9016 aCollector->registerMetric(new pm::Metric(guestCpuMem, guestPagedFree, new pm::AggregateMin()));9017 aCollector->registerMetric(new pm::Metric(guestCpuMem, guestPagedFree, new pm::AggregateMax()));9018 9012 }; 9019 9013 -
trunk/src/VBox/Main/Performance.cpp
r27976 r27998 170 170 mGuest->InternalGetStatistics(0, &mCpuUser, &mCpuKernel, &mCpuIdle, 171 171 &mMemTotal, &mMemFree, &mMemBalloon, &mMemCache, 172 &mPageTotal , &mPageFree);172 &mPageTotal); 173 173 mLastTick = iTick; 174 174 } … … 408 408 mCache->init(mLength); 409 409 mPagedTotal->init(mLength); 410 mPagedFree->init(mLength);411 410 } 412 411 … … 418 417 void GuestRamUsage::collect() 419 418 { 420 ULONG ulMemTotal = 0, ulMemFree = 0, ulMemBalloon = 0, ulMemCache = 0, ulPageTotal = 0 , ulPageFree = 0;421 422 mGuestHAL->getGuestMemLoad(&ulMemTotal, &ulMemFree, &ulMemBalloon, &ulMemCache, &ulPageTotal , &ulPageFree);419 ULONG ulMemTotal = 0, ulMemFree = 0, ulMemBalloon = 0, ulMemCache = 0, ulPageTotal = 0; 420 421 mGuestHAL->getGuestMemLoad(&ulMemTotal, &ulMemFree, &ulMemBalloon, &ulMemCache, &ulPageTotal); 423 422 mTotal->put(ulMemTotal); 424 423 mFree->put(ulMemFree); … … 426 425 mCache->put(ulMemCache); 427 426 mPagedTotal->put(ulPageTotal); 428 mPagedFree->put(ulPageFree);429 427 } 430 428 -
trunk/src/VBox/Main/PerformanceImpl.cpp
r27930 r27998 68 68 "RAM/Usage/Free:min", 69 69 "RAM/Usage/Free:max", 70 "Guest/CPU/Load/User", 71 "Guest/CPU/Load/User:avg", 72 "Guest/CPU/Load/User:min", 73 "Guest/CPU/Load/User:max", 74 "Guest/CPU/Load/Kernel", 75 "Guest/CPU/Load/Kernel:avg", 76 "Guest/CPU/Load/Kernel:min", 77 "Guest/CPU/Load/Kernel:max", 78 "Guest/CPU/Load/Idle", 79 "Guest/CPU/Load/Idle:avg", 80 "Guest/CPU/Load/Idle:min", 81 "Guest/CPU/Load/Idle:max", 70 82 "Guest/RAM/Usage/Total", 71 83 "Guest/RAM/Usage/Total:avg", … … 88 100 "Guest/Pagefile/Usage/Total:min", 89 101 "Guest/Pagefile/Usage/Total:max", 90 "Guest/Pagefile/Usage/Free",91 "Guest/Pagefile/Usage/Free:avg",92 "Guest/Pagefile/Usage/Free:min",93 "Guest/Pagefile/Usage/Free:max",94 102 }; 95 103 -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r27996 r27998 8271 8271 <interface 8272 8272 name="IGuestOSType" extends="$unknown" 8273 uuid=" 3fcf2078-3c69-45ca-bd5c-79c3e3c15362"8273 uuid="8cec1502-8869-42e3-9d9c-45f0d1bb0861" 8274 8274 wsmap="struct" 8275 8275 > … … 8452 8452 <param name="pagedTotal" type="unsigned long" dir="out"> 8453 8453 <desc>Total amount of space in the page file</desc> 8454 </param>8455 <param name="pagedFree" type="unsigned long" dir="out">8456 <desc>Free amount of space in the page file</desc>8457 8454 </param> 8458 8455 </method> -
trunk/src/VBox/Main/include/GuestImpl.h
r27996 r27998 90 90 STDMETHOD(InternalGetStatistics)(ULONG aCpuId, ULONG *aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle, 91 91 ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMemCache, 92 ULONG *aPageTotal , ULONG *aPageFree);92 ULONG *aPageTotal); 93 93 94 94 // public methods that are not in IDL -
trunk/src/VBox/Main/include/Performance.h
r27942 r27998 168 168 CollectorGuestHAL(Machine *machine) : cEnabled(0), mMachine(machine), mConsole(NULL), mGuest(NULL), mLastTick(0), 169 169 mCpuUser(0), mCpuKernel(0), mCpuIdle(0), mMemTotal(0), mMemFree(0), mMemBalloon(0), 170 mMemCache(0), mPageTotal(0) , mPageFree(0){};170 mMemCache(0), mPageTotal(0) {}; 171 171 ~CollectorGuestHAL(); 172 172 … … 187 187 188 188 /** Return guest memory information in kb. */ 189 void getGuestMemLoad(ULONG *pulMemTotal, ULONG *pulMemFree, ULONG *pulMemBalloon, ULONG *pulMemCache, ULONG *pulPageTotal , ULONG *pulPageFree)189 void getGuestMemLoad(ULONG *pulMemTotal, ULONG *pulMemFree, ULONG *pulMemBalloon, ULONG *pulMemCache, ULONG *pulPageTotal) 190 190 { 191 191 *pulMemTotal = mMemTotal; … … 194 194 *pulMemCache = mMemCache; 195 195 *pulPageTotal = mPageTotal; 196 *pulPageFree = mPageFree;197 196 } 198 197 … … 213 212 ULONG mMemCache; 214 213 ULONG mPageTotal; 215 ULONG mPageFree;216 214 }; 217 215 … … 414 412 { 415 413 public: 416 GuestRamUsage(CollectorGuestHAL *hal, ComPtr<IUnknown> object, SubMetric *total, SubMetric *free, SubMetric *balloon, SubMetric *cache, SubMetric *pagedtotal , SubMetric *pagedfree)417 : BaseMetric(hal, "RAM/Usage", object), mTotal(total), mFree(free), mBallooned(balloon), mCache(cache), mPagedTotal(pagedtotal), m PagedFree(pagedfree), mGuestHAL(hal) {};418 ~GuestRamUsage() { delete mTotal; delete mFree; delete mBallooned; delete mCache; delete mPagedTotal; delete mPagedFree;};414 GuestRamUsage(CollectorGuestHAL *hal, ComPtr<IUnknown> object, SubMetric *total, SubMetric *free, SubMetric *balloon, SubMetric *cache, SubMetric *pagedtotal) 415 : BaseMetric(hal, "RAM/Usage", object), mTotal(total), mFree(free), mBallooned(balloon), mCache(cache), mPagedTotal(pagedtotal), mGuestHAL(hal) {}; 416 ~GuestRamUsage() { delete mTotal; delete mFree; delete mBallooned; delete mCache; delete mPagedTotal; }; 419 417 420 418 void init(ULONG period, ULONG length); … … 426 424 ULONG getScale() { return 1; } 427 425 private: 428 SubMetric *mTotal, *mFree, *mBallooned, *mCache, *mPagedTotal , *mPagedFree;426 SubMetric *mTotal, *mFree, *mBallooned, *mCache, *mPagedTotal; 429 427 CollectorGuestHAL *mGuestHAL; 430 428 };
Note:
See TracChangeset
for help on using the changeset viewer.