VirtualBox

Ignore:
Timestamp:
Jan 10, 2024 8:41:20 AM (11 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10501. Converting time stamps we get from OCI a bit earlier.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.cpp

    r102774 r102810  
    758758            int iDataIndex = qMin(labels->size() - 1, iTimeIndex - (m_iMaximumQueueSize - maxDataSize()));
    759759            if (iDataIndex >= 0)
    760                 strAxisText = UIVMActivityMonitorCloud::formatCloudTimeStamp(labels->at(iDataIndex));
     760                strAxisText = labels->at(iDataIndex);
    761761        }
    762762        else
     
    20602060}
    20612061
    2062 void UIVMActivityMonitorCloud::sltMetricDataReceived(KMetricType enmMetricType, QVector<QString> data, QVector<QString> timeStamps)
     2062void UIVMActivityMonitorCloud::sltMetricDataReceived(KMetricType enmMetricType,
     2063                                                     const QVector<QString> &data, const QVector<QString> &timeStamps)
    20632064{
    20642065    if (data.size() != timeStamps.size())
    20652066        return;
     2067    QVector<QString> newTimeStamps;
     2068    foreach (const QString &strTimeStamp, timeStamps)
     2069    {
     2070        if (strTimeStamp.isEmpty())
     2071            continue;
     2072        QDateTime dateTime = QDateTime::fromString(strTimeStamp, Qt::RFC2822Date);
     2073        if (!dateTime.isValid())
     2074            continue;
     2075        newTimeStamps << dateTime.time().toString("hh:mm");
     2076    }
     2077
    20662078    for (int i = 0; i < data.size(); ++i)
    20672079    {
     
    20692081        {
    20702082            float fValue = data[i].toFloat();
    2071             updateCPUChart((ULONG) fValue, timeStamps[i]);
     2083            updateCPUChart((ULONG) fValue, newTimeStamps[i]);
    20722084        }
    20732085        else if (enmMetricType == KMetricType_NetworksBytesOut)
    2074             cacheNetworkTransmit(timeStamps[i], (int)data[i].toFloat());
     2086            cacheNetworkTransmit(newTimeStamps[i], (int)data[i].toFloat());
    20752087        else if (enmMetricType == KMetricType_NetworksBytesIn)
    2076             cacheNetworkReceive(timeStamps[i], (int)data[i].toFloat());
     2088            cacheNetworkReceive(newTimeStamps[i], (int)data[i].toFloat());
    20772089        else if (enmMetricType == KMetricType_DiskBytesRead)
    2078             cacheDiskRead(timeStamps[i], (int)data[i].toFloat());
     2090            cacheDiskRead(newTimeStamps[i], (int)data[i].toFloat());
    20792091        else if (enmMetricType == KMetricType_DiskBytesWritten)
    2080             cacheDiskWrite(timeStamps[i], (int)data[i].toFloat());
     2092            cacheDiskWrite(newTimeStamps[i], (int)data[i].toFloat());
    20812093        else if (enmMetricType == KMetricType_MemoryUtilization)
    20822094        {
     
    20852097                /* calculate used RAM amount in kb: */
    20862098                quint64 iUsedRAM = data[i].toFloat() * (m_iTotalRAM / 100.f);
    2087                 updateRAMChart(iUsedRAM, timeStamps[i]);
     2099                updateRAMChart(iUsedRAM, newTimeStamps[i]);
    20882100            }
    20892101        }
  • trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.h

    r102774 r102810  
    325325
    326326    void sltMetricNameListingComplete(QVector<QString> metricNameList);
    327     void sltMetricDataReceived(KMetricType enmMetricType, QVector<QString> data, QVector<QString> timeStamps);
     327    void sltMetricDataReceived(KMetricType enmMetricType,
     328                               const QVector<QString> &data, const QVector<QString> &timeStamps);
    328329    void sltMachineStateUpdateTimeout();
    329330
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