VirtualBox

Changeset 28005 in vbox


Ignore:
Timestamp:
Apr 6, 2010 1:52:45 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59712
Message:

Metrics updates

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

Legend:

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

    r27998 r28005  
    89458945
    89468946    /* Guest metrics */
    8947     mGuestHAL = new pm::CollectorGuestHAL(this);
     8947    mGuestHAL = new pm::CollectorGuestHAL(this, hal);
    89488948
    89498949    /* Create sub metrics */
  • trunk/src/VBox/Main/Performance.cpp

    r28004 r28005  
    173173                                      &mMemTotal, &mMemFree, &mMemBalloon, &ulMemBalloonTotal, &mMemCache,
    174174                                      &mPageTotal);
     175
     176        if (mHostHAL)
     177            mHostHAL->setBalloonSize(ulMemBalloonTotal);
     178
    175179        mLastTick = iTick;
    176180    }
     
    301305        mAvailable->put(available);
    302306    }
     307    mBallooned->put(mHAL->getBalloonSize());
    303308}
    304309
  • trunk/src/VBox/Main/include/Performance.h

    r28004 r28005  
    139139    {
    140140    public:
     141                 CollectorHAL() : mMemBalloonTotal(0) {};
    141142        virtual ~CollectorHAL() { };
    142143        virtual int preCollect(const CollectorHints& /* hints */, uint64_t /* iTick */) { return VINF_SUCCESS; }
     
    161162        /** Disable metrics collecting (if applicable) */
    162163        virtual int disable();
     164
     165        virtual int setBalloonSize(ULONG balloonsize)
     166        {
     167            mMemBalloonTotal = balloonsize;
     168            return S_OK;
     169        }
     170
     171        virtual ULONG getBalloonSize()
     172        {
     173            return mMemBalloonTotal;
     174        }
     175
     176    private:
     177        ULONG       mMemBalloonTotal;
    163178    };
    164179
     
    166181    {
    167182    public:
    168         CollectorGuestHAL(Machine *machine) : cEnabled(0), mMachine(machine), mConsole(NULL), mGuest(NULL), mLastTick(0),
     183        CollectorGuestHAL(Machine *machine, CollectorHAL *hostHAL) : CollectorHAL(), cEnabled(0), mMachine(machine), mConsole(NULL), mGuest(NULL), mLastTick(0),
    169184                                              mCpuUser(0), mCpuKernel(0), mCpuIdle(0), mMemTotal(0), mMemFree(0), mMemBalloon(0),
    170                                               mMemCache(0), mPageTotal(0) {};
     185                                              mMemCache(0), mPageTotal(0), mHostHAL(hostHAL) {};
    171186        ~CollectorGuestHAL();
    172187
     
    203218        ComPtr<IGuest>       mGuest;
    204219        uint64_t             mLastTick;
     220
     221        CollectorHAL        *mHostHAL;
    205222
    206223        ULONG                mCpuUser;
  • trunk/src/VBox/Main/win/PerformanceWin.cpp

    r27950 r28005  
    9999}
    100100
    101 CollectorWin::CollectorWin() : mhNtDll(0)
     101CollectorWin::CollectorWin() : CollectorHAL(), mhNtDll(0)
    102102{
    103103    mpfnGetSystemTimes = (PFNGST)GetProcAddress(
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