VirtualBox

Changeset 32911 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 5, 2010 12:47:02 PM (14 years ago)
Author:
vboxsync
Message:

crOpenGL: add sent bytes counter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_clear.c

    r32909 r32911  
    2727    uint32_t *mpaBytes;
    2828
     29    uint64_t mBytesSentSum;
     30    uint32_t *mpaBytesSent;
     31
    2932    uint64_t mCallsSum;
    3033    uint32_t *mpaCalls;
     
    3740    pFps->mpaPeriods = crCalloc(sizeof (pFps->mpaPeriods[0]) * cPeriods);
    3841    pFps->mpaBytes = crCalloc(sizeof (pFps->mpaBytes[0]) * cPeriods);
     42    pFps->mpaBytesSent = crCalloc(sizeof (pFps->mpaBytesSent[0]) * cPeriods);
    3943    pFps->mpaCalls = crCalloc(sizeof (pFps->mpaCalls[0]) * cPeriods);
    4044}
     
    5054{
    5155    uint64_t cur = RTTimeNanoTS();
    52     uint64_t curBytes, curCalls;
     56    uint64_t curBytes, curBytesSent, curCalls;
    5357    int i;
    5458
    5559    curBytes = 0;
     60    curBytesSent = 0;
    5661    curCalls = 0;
    5762
     
    6166        {
    6267            curBytes += cr_server.clients[i]->conn->total_bytes_recv;
     68            curBytesSent += cr_server.clients[i]->conn->total_bytes_sent;
    6369            curCalls += cr_server.clients[i]->conn->recv_count;
    6470            cr_server.clients[i]->conn->total_bytes_recv = 0;
     71            cr_server.clients[i]->conn->total_bytes_sent = 0;
    6572            cr_server.clients[i]->conn->recv_count = 0;
    6673        }
     
    7784        pFps->mpaBytes[pFps->miPeriod] = curBytes;
    7885
     86        pFps->mBytesSentSum += curBytesSent - pFps->mpaBytesSent[pFps->miPeriod];
     87        pFps->mpaBytesSent[pFps->miPeriod] = curBytesSent;
     88
    7989        pFps->mCallsSum += curCalls - pFps->mpaCalls[pFps->miPeriod];
    8090        pFps->mpaCalls[pFps->miPeriod] = curCalls;
     
    100110{
    101111    return vboxCrFpsGetFps(pFps) * pFps->mBytesSum / pFps->mcPeriods;
     112}
     113
     114double vboxCrFpsGetBpsSent(PVBOXCRFPS pFps)
     115{
     116    return vboxCrFpsGetFps(pFps) * pFps->mBytesSentSum / pFps->mcPeriods;
    102117}
    103118
     
    164179      double fps = vboxCrFpsGetFps(&Fps);
    165180      double bps = vboxCrFpsGetBps(&Fps);
     181      double bpsSent = vboxCrFpsGetBpsSent(&Fps);
    166182      double cps = vboxCrFpsGetCps(&Fps);
    167       crDebug("fps: %f, Mbps: %.1f, cps: %.1f", fps, bps/(1024.0*1024.0), cps);
     183      crDebug("fps: %f, rec Mbps: %.1f, send Mbps: %.1f, cps: %.1f", fps, bps/(1024.0*1024.0), bpsSent/(1024.0*1024.0), cps);
    168184  }
    169185#endif
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