Changeset 61361 in vbox
- Timestamp:
- Jun 1, 2016 7:59:04 AM (8 years ago)
- Location:
- trunk/src/VBox/Main/webservice
- Files:
-
- 2 edited
-
vboxweb.cpp (modified) (4 diffs)
-
vboxweb.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/webservice/vboxweb.cpp
r60865 r61361 1446 1446 WEBDEBUG(("Watchdog thread started\n")); 1447 1447 1448 uint32_t tNextStat = 0; 1449 1448 1450 while (g_fKeepRunning) 1449 1451 { … … 1451 1453 RTThreadSleep(g_iWatchdogCheckInterval * 1000); 1452 1454 1453 time_t tNow; 1454 time(&tNow); 1455 uint32_t tNow = RTTimeProgramSecTS(); 1455 1456 1456 1457 // we're messing with websessions, so lock them … … 1482 1483 pSystemProperties->COMSETTER(WebServiceAuthLibrary)(com::Bstr(g_pcszAuthentication).raw()); 1483 1484 } 1485 1486 // Log some MOR usage statistics every 5 minutes, but only if there's 1487 // something worth logging (at least one reference or a transition to 1488 // zero references). Avoids useless log spamming in idle webservice. 1489 if (tNow >= tNextStat) 1490 { 1491 size_t cMOR = 0; 1492 it = g_mapWebsessions.begin(); 1493 itEnd = g_mapWebsessions.end(); 1494 while (it != itEnd) 1495 { 1496 cMOR += it->second->CountRefs(); 1497 ++it; 1498 } 1499 static bool fLastZero = false; 1500 if (cMOR || !fLastZero) 1501 LogRel(("Statistics: %zu websessions, %zu references\n", 1502 g_mapWebsessions.size(), cMOR)); 1503 fLastZero = (cMOR == 0); 1504 while (tNextStat <= tNow) 1505 tNextStat += 5 * 60; /* 5 minutes */ 1506 } 1484 1507 } 1485 1508 … … 2012 2035 void WebServiceSession::touch() 2013 2036 { 2014 time(&_tLastObjectLookup); 2037 _tLastObjectLookup = RTTimeProgramSecTS(); 2038 } 2039 2040 /** 2041 * Counts the number of managed object references in this websession. 2042 */ 2043 size_t WebServiceSession::CountRefs() 2044 { 2045 return _pp->_mapManagedObjectsById.size(); 2015 2046 } 2016 2047 -
trunk/src/VBox/Main/webservice/vboxweb.h
r59654 r61361 3 3 * header file for "real" web server code. 4 4 * 5 * Copyright (C) 2006-201 5Oracle Corporation5 * Copyright (C) 2006-2016 Oracle Corporation 6 6 * 7 7 * This file is part of VirtualBox Open Source Edition (OSE), as … … 104 104 bool _fDestructing; 105 105 106 time_t_tLastObjectLookup;106 uint32_t _tLastObjectLookup; 107 107 108 108 // hide the copy constructor because we're not copyable … … 133 133 void touch(); 134 134 135 time_t getLastObjectLookup() const135 uint32_t getLastObjectLookup() const 136 136 { 137 137 return _tLastObjectLookup; … … 140 140 static WebServiceSession* findWebsessionFromRef(const WSDLT_ID &id); 141 141 142 void DumpRefs();142 size_t CountRefs(); 143 143 }; 144 144
Note:
See TracChangeset
for help on using the changeset viewer.

