VirtualBox

Changeset 43933 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Nov 22, 2012 7:43:47 AM (12 years ago)
Author:
vboxsync
Message:

Main/Metrics: Host link speed metric and the fix for base name extraction in VBoxManage (#6345)

File:
1 edited

Legend:

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

    r43629 r43933  
    9393    pm::CollectorHAL *hal = aCollector->getHAL();
    9494    /* Create sub metrics */
    95     Utf8StrFmt strName("Net/%ls/Load", mShortName.raw());
    96     pm::SubMetric *networkLoadRx   = new pm::SubMetric(strName + "/Rx",
     95    Utf8StrFmt strName("Net/%ls", mShortName.raw());
     96    pm::SubMetric *networkLoadRx   = new pm::SubMetric(strName + "/Load/Rx",
    9797        "Percentage of network interface receive bandwidth used.");
    98     pm::SubMetric *networkLoadTx   = new pm::SubMetric(strName + "/Tx",
     98    pm::SubMetric *networkLoadTx   = new pm::SubMetric(strName + "/Load/Tx",
    9999        "Percentage of network interface transmit bandwidth used.");
     100    pm::SubMetric *networkLinkSpeed = new pm::SubMetric(strName + "/LinkSpeed",
     101        "Physical link speed.");
    100102
    101103    /* Create and register base metrics */
    102     pm::BaseMetric *networkLoad = new pm::HostNetworkLoadRaw(hal, objptr, strName, Utf8Str(mShortName), Utf8Str(mInterfaceName), m.speedMbits, networkLoadRx, networkLoadTx);
     104    pm::BaseMetric *networkSpeed = new pm::HostNetworkSpeed(hal, objptr, strName + "/LinkSpeed", Utf8Str(mShortName), Utf8Str(mInterfaceName), m.speedMbits, networkLinkSpeed);
     105    aCollector->registerBaseMetric(networkSpeed);
     106    pm::BaseMetric *networkLoad = new pm::HostNetworkLoadRaw(hal, objptr, strName + "/Load", Utf8Str(mShortName), Utf8Str(mInterfaceName), m.speedMbits, networkLoadRx, networkLoadTx);
    103107    aCollector->registerBaseMetric(networkLoad);
     108
     109    aCollector->registerMetric(new pm::Metric(networkSpeed, networkLinkSpeed, 0));
     110    aCollector->registerMetric(new pm::Metric(networkSpeed, networkLinkSpeed,
     111                                              new pm::AggregateAvg()));
     112    aCollector->registerMetric(new pm::Metric(networkSpeed, networkLinkSpeed,
     113                                              new pm::AggregateMin()));
     114    aCollector->registerMetric(new pm::Metric(networkSpeed, networkLinkSpeed,
     115                                              new pm::AggregateMax()));
    104116
    105117    aCollector->registerMetric(new pm::Metric(networkLoad, networkLoadRx, 0));
     
    124136    LogFlowThisFunc(("mShortName={%ls}, mInterfaceName={%ls}, mGuid={%s}\n",
    125137                     mShortName.raw(), mInterfaceName.raw(), mGuid.toString().c_str()));
    126     Utf8StrFmt name("Net/%ls/Load", mShortName.raw());
     138    Utf8StrFmt name("Net/%ls", mShortName.raw());
    127139    aCollector->unregisterMetricsFor(objptr, name + "/*");
    128140    aCollector->unregisterBaseMetricsFor(objptr, name);
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