VirtualBox

Ignore:
Timestamp:
Oct 4, 2012 12:24:20 PM (12 years ago)
Author:
vboxsync
Message:

Main/Metrics: Host network interface metrics for Solaris (#6345)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp

    r43507 r43538  
    8989void HostNetworkInterface::registerMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr)
    9090{
    91     LogFlowThisFunc(("mInterfaceName={%ls}, mGuid={%s}\n",
    92                       mInterfaceName.raw(), mGuid.toString().c_str()));
     91    LogFlowThisFunc(("mShortName={%ls}, mInterfaceName={%ls}, mGuid={%s}, mSpeedMbits=%u\n",
     92                     mShortName.raw(), mInterfaceName.raw(), mGuid.toString().c_str(), m.speedMbits));
    9393    pm::CollectorHAL *hal = aCollector->getHAL();
    9494    /* Create sub metrics */
    95     Utf8StrFmt strName("Net/%ls/Load", mInterfaceName.raw());
     95    Utf8StrFmt strName("Net/%ls/Load", mShortName.raw());
    9696    pm::SubMetric *networkLoadRx   = new pm::SubMetric(strName + "/Rx",
    9797        "Percentage of network interface bandwidth used.");
     
    100100
    101101    /* Create and register base metrics */
    102     pm::BaseMetric *networkLoad = new pm::HostNetworkLoadRaw(hal, objptr, strName, Utf8Str(mInterfaceName), m.speedMbytes, networkLoadRx, networkLoadTx);
     102    pm::BaseMetric *networkLoad = new pm::HostNetworkLoadRaw(hal, objptr, strName, Utf8Str(mShortName), m.speedMbits, networkLoadRx, networkLoadTx);
    103103    aCollector->registerBaseMetric(networkLoad);
    104104
     
    122122void HostNetworkInterface::unregisterMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr)
    123123{
    124     LogFlowThisFunc(("mInterfaceName={%ls}, mGuid={%s}\n",
    125                       mInterfaceName.raw(), mGuid.toString().c_str()));
    126     Utf8StrFmt name("Net/%ls/Load", mInterfaceName.raw());
     124    LogFlowThisFunc(("mShortName={%ls}, mInterfaceName={%ls}, mGuid={%s}\n",
     125                     mShortName.raw(), mInterfaceName.raw(), mGuid.toString().c_str()));
     126    Utf8StrFmt name("Net/%ls/Load", mShortName.raw());
    127127    aCollector->unregisterMetricsFor(objptr, name + "/*");
    128128    aCollector->unregisterBaseMetricsFor(objptr, name);
     
    150150        m.status = info.enmStatus;
    151151#endif /* !RT_OS_WINDOWS */
    152         m.speedMbytes = info.uSpeedMbytes;
     152        m.speedMbits = info.uSpeedMbits;
    153153        return S_OK;
    154154    }
     
    183183    unconst(mGuid) = pIf->Uuid;
    184184    if (pIf->szShortName[0])
     185    {
    185186        unconst(mNetworkName) = composeNetworkName(pIf->szShortName);
     187        unconst(mShortName)   = pIf->szShortName;
     188    }
    186189    else
     190    {
    187191        unconst(mNetworkName) = composeNetworkName(aInterfaceName);
     192        unconst(mShortName)   = aInterfaceName;
     193    }
    188194    mIfType = ifType;
    189195
     
    201207    m.status = pIf->enmStatus;
    202208#endif /* !RT_OS_WINDOWS */
    203     m.speedMbytes = pIf->uSpeedMbytes;
     209    m.speedMbits = pIf->uSpeedMbits;
    204210
    205211    /* Confirm a successful initialization */
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