Changeset 32940 in vbox for trunk/src/VBox/HostServices
- Timestamp:
- Oct 6, 2010 10:47:09 AM (14 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_clear.c
r32924 r32940 36 36 uint32_t *mpaOps; 37 37 38 uint64_t mTimeUsedSum; 39 uint64_t *mpaTimes; 38 40 } VBOXCRFPS, *PVBOXCRFPS; 39 41 … … 47 49 pFps->mpaCalls = crCalloc(sizeof (pFps->mpaCalls[0]) * cPeriods); 48 50 pFps->mpaOps = crCalloc(sizeof (pFps->mpaOps[0]) * cPeriods); 51 pFps->mpaTimes = crCalloc(sizeof (pFps->mpaTimes[0]) * cPeriods); 49 52 } 50 53 … … 59 62 { 60 63 uint64_t cur = RTTimeNanoTS(); 61 uint64_t curBytes, curBytesSent, curCalls, curOps ;64 uint64_t curBytes, curBytesSent, curCalls, curOps, curTimeUsed; 62 65 int i; 63 66 … … 66 69 curCalls = 0; 67 70 curOps = 0; 71 curTimeUsed = 0; 68 72 69 73 for (i = 0; i < cr_server.numClients; i++) … … 75 79 curCalls += cr_server.clients[i]->conn->recv_count; 76 80 curOps += cr_server.clients[i]->conn->opcodes_count; 81 curTimeUsed += cr_server.clients[i]->timeUsed; 77 82 cr_server.clients[i]->conn->total_bytes_recv = 0; 78 83 cr_server.clients[i]->conn->total_bytes_sent = 0; 79 84 cr_server.clients[i]->conn->recv_count = 0; 80 85 cr_server.clients[i]->conn->opcodes_count = 0; 86 cr_server.clients[i]->timeUsed = 0; 81 87 } 82 88 } … … 101 107 pFps->mpaOps[pFps->miPeriod] = curOps; 102 108 109 pFps->mTimeUsedSum += curTimeUsed - pFps->mpaTimes[pFps->miPeriod]; 110 pFps->mpaTimes[pFps->miPeriod] = curTimeUsed; 111 103 112 ++pFps->miPeriod; 104 113 pFps->miPeriod %= pFps->mcPeriods; … … 136 145 { 137 146 return vboxCrFpsGetFps(pFps) * pFps->mOpsSum / pFps->mcPeriods; 147 } 148 149 double vboxCrFpsGetTimeProcPercent(PVBOXCRFPS pFps) 150 { 151 return 100.0*pFps->mTimeUsedSum/pFps->mPeriodSum; 138 152 } 139 153 … … 198 212 double cps = vboxCrFpsGetCps(&Fps); 199 213 double ops = vboxCrFpsGetOps(&Fps); 200 crDebug("fps: %f, rec Mbps: %.1f, send Mbps: %.1f, cps: %.1f, ops: %.0f", fps, bps/(1024.0*1024.0), bpsSent/(1024.0*1024.0), cps, ops); 214 double tup = vboxCrFpsGetTimeProcPercent(&Fps); 215 crDebug("fps: %f, rec Mbps: %.1f, send Mbps: %.1f, cps: %.1f, ops: %.0f, host %.1f%%", 216 fps, bps/(1024.0*1024.0), bpsSent/(1024.0*1024.0), cps, ops, tup); 201 217 } 202 218 #endif -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r32420 r32940 25 25 #include <iprt/assert.h> 26 26 27 #ifdef VBOXCR_LOGFPS 28 #include <iprt/timer.h> 29 #endif 30 27 31 /** 28 32 * \mainpage CrServerLib … … 380 384 CRClient *pClient = NULL; 381 385 int32_t i; 386 #ifdef VBOXCR_LOGFPS 387 uint64_t tstart, tend; 388 #endif 382 389 383 390 /*crDebug("=>crServer: ClientWrite u32ClientID=%d", u32ClientID);*/ … … 395 402 396 403 if (!pClient->conn->vMajor) return VERR_NOT_SUPPORTED; 404 405 #ifdef VBOXCR_LOGFPS 406 tstart = RTTimeNanoTS(); 407 #endif 397 408 398 409 CRASSERT(pBuffer); … … 452 463 CRASSERT(!pClient->conn->allow_redir_ptr || crNetNumMessages(pClient->conn)==0); 453 464 465 #ifdef VBOXCR_LOGFPS 466 tend = RTTimeNanoTS(); 467 pClient->timeUsed += tend-tstart; 468 #endif 454 469 /*crDebug("<=crServer: ClientWrite u32ClientID=%d", u32ClientID);*/ 455 470
Note:
See TracChangeset
for help on using the changeset viewer.