Changeset 43538 in vbox for trunk/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp
- Timestamp:
- Oct 4, 2012 12:24:20 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp
r43507 r43538 89 89 void HostNetworkInterface::registerMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr) 90 90 { 91 LogFlowThisFunc(("m InterfaceName={%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)); 93 93 pm::CollectorHAL *hal = aCollector->getHAL(); 94 94 /* Create sub metrics */ 95 Utf8StrFmt strName("Net/%ls/Load", m InterfaceName.raw());95 Utf8StrFmt strName("Net/%ls/Load", mShortName.raw()); 96 96 pm::SubMetric *networkLoadRx = new pm::SubMetric(strName + "/Rx", 97 97 "Percentage of network interface bandwidth used."); … … 100 100 101 101 /* Create and register base metrics */ 102 pm::BaseMetric *networkLoad = new pm::HostNetworkLoadRaw(hal, objptr, strName, Utf8Str(m InterfaceName), m.speedMbytes, networkLoadRx, networkLoadTx);102 pm::BaseMetric *networkLoad = new pm::HostNetworkLoadRaw(hal, objptr, strName, Utf8Str(mShortName), m.speedMbits, networkLoadRx, networkLoadTx); 103 103 aCollector->registerBaseMetric(networkLoad); 104 104 … … 122 122 void HostNetworkInterface::unregisterMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr) 123 123 { 124 LogFlowThisFunc(("m InterfaceName={%ls}, mGuid={%s}\n",125 mInterfaceName.raw(), mGuid.toString().c_str()));126 Utf8StrFmt name("Net/%ls/Load", m InterfaceName.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()); 127 127 aCollector->unregisterMetricsFor(objptr, name + "/*"); 128 128 aCollector->unregisterBaseMetricsFor(objptr, name); … … 150 150 m.status = info.enmStatus; 151 151 #endif /* !RT_OS_WINDOWS */ 152 m.speedMb ytes = info.uSpeedMbytes;152 m.speedMbits = info.uSpeedMbits; 153 153 return S_OK; 154 154 } … … 183 183 unconst(mGuid) = pIf->Uuid; 184 184 if (pIf->szShortName[0]) 185 { 185 186 unconst(mNetworkName) = composeNetworkName(pIf->szShortName); 187 unconst(mShortName) = pIf->szShortName; 188 } 186 189 else 190 { 187 191 unconst(mNetworkName) = composeNetworkName(aInterfaceName); 192 unconst(mShortName) = aInterfaceName; 193 } 188 194 mIfType = ifType; 189 195 … … 201 207 m.status = pIf->enmStatus; 202 208 #endif /* !RT_OS_WINDOWS */ 203 m.speedMb ytes = pIf->uSpeedMbytes;209 m.speedMbits = pIf->uSpeedMbits; 204 210 205 211 /* Confirm a successful initialization */
Note:
See TracChangeset
for help on using the changeset viewer.