Changeset 32911 in vbox for trunk/src/VBox
- Timestamp:
- Oct 5, 2010 12:47:02 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_clear.c
r32909 r32911 27 27 uint32_t *mpaBytes; 28 28 29 uint64_t mBytesSentSum; 30 uint32_t *mpaBytesSent; 31 29 32 uint64_t mCallsSum; 30 33 uint32_t *mpaCalls; … … 37 40 pFps->mpaPeriods = crCalloc(sizeof (pFps->mpaPeriods[0]) * cPeriods); 38 41 pFps->mpaBytes = crCalloc(sizeof (pFps->mpaBytes[0]) * cPeriods); 42 pFps->mpaBytesSent = crCalloc(sizeof (pFps->mpaBytesSent[0]) * cPeriods); 39 43 pFps->mpaCalls = crCalloc(sizeof (pFps->mpaCalls[0]) * cPeriods); 40 44 } … … 50 54 { 51 55 uint64_t cur = RTTimeNanoTS(); 52 uint64_t curBytes, cur Calls;56 uint64_t curBytes, curBytesSent, curCalls; 53 57 int i; 54 58 55 59 curBytes = 0; 60 curBytesSent = 0; 56 61 curCalls = 0; 57 62 … … 61 66 { 62 67 curBytes += cr_server.clients[i]->conn->total_bytes_recv; 68 curBytesSent += cr_server.clients[i]->conn->total_bytes_sent; 63 69 curCalls += cr_server.clients[i]->conn->recv_count; 64 70 cr_server.clients[i]->conn->total_bytes_recv = 0; 71 cr_server.clients[i]->conn->total_bytes_sent = 0; 65 72 cr_server.clients[i]->conn->recv_count = 0; 66 73 } … … 77 84 pFps->mpaBytes[pFps->miPeriod] = curBytes; 78 85 86 pFps->mBytesSentSum += curBytesSent - pFps->mpaBytesSent[pFps->miPeriod]; 87 pFps->mpaBytesSent[pFps->miPeriod] = curBytesSent; 88 79 89 pFps->mCallsSum += curCalls - pFps->mpaCalls[pFps->miPeriod]; 80 90 pFps->mpaCalls[pFps->miPeriod] = curCalls; … … 100 110 { 101 111 return vboxCrFpsGetFps(pFps) * pFps->mBytesSum / pFps->mcPeriods; 112 } 113 114 double vboxCrFpsGetBpsSent(PVBOXCRFPS pFps) 115 { 116 return vboxCrFpsGetFps(pFps) * pFps->mBytesSentSum / pFps->mcPeriods; 102 117 } 103 118 … … 164 179 double fps = vboxCrFpsGetFps(&Fps); 165 180 double bps = vboxCrFpsGetBps(&Fps); 181 double bpsSent = vboxCrFpsGetBpsSent(&Fps); 166 182 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); 168 184 } 169 185 #endif
Note:
See TracChangeset
for help on using the changeset viewer.