public class ServersCacheStatsGenerator extends ServiceableGenerator
| Modifier and Type | Class and Description |
|---|---|
protected class |
ServersCacheStatsGenerator.BackStatsEntry
Object model representing an entry of stats for a back resource (ie.
|
protected class |
ServersCacheStatsGenerator.FrontFromFrontStatsEntry
Object model representing an entry of stats for a front resource, coming
from the Front (direct request to tomcat, bypassing any HTTP server if any).
|
protected class |
ServersCacheStatsGenerator.FrontFromHTTPServerStatsEntry
Object model representing an entry of stats for a front resource, coming
from httpserver
|
protected class |
ServersCacheStatsGenerator.RawStatsEntry
Object model representing a raw entry of stats retrieved through the DB.
|
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,ServersCacheStatsGenerator.BackStatsEntry> |
_backStats
Map containing back stats entries classified by path
|
protected Map<String,Map<String,ServersCacheStatsGenerator.FrontFromFrontStatsEntry>> |
_fromFrontOnlyStats
Multimap containing (only) front stats entries classified by site name
and path
|
protected Map<String,Map<String,ServersCacheStatsGenerator.FrontFromHTTPServerStatsEntry>> |
_fromHTTPServerStats
Multimap containing httpserver stats entries classified by site name and path
|
protected Map<String,Multimap<String,String>> |
_pathMaps
Multimaps representing the all the paths to the resources in a recursive
way.
|
protected Multimap<String,String> |
_pathSanitizer
This multimap associates site names to a list of prefix.
|
protected ResourceStatisticsComponent |
_resourceStatisticsCmp
Resource statistics component
|
protected SiteManager |
_siteManager
Ametys resolver
|
protected static String[] |
_SPECIAL_PATH_PREFIXS
List of paths used to during the sanitize process of the server path
|
managerobjectModel, parameters, resolver, sourcecontentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer| Constructor and Description |
|---|
ServersCacheStatsGenerator() |
disposesetupsetConsumer, setContentHandler, setLexicalHandlerenableLogging, getLogger, setupLogger, setupLogger, setupLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetConsumerprotected static final String[] _SPECIAL_PATH_PREFIXS
protected ResourceStatisticsComponent _resourceStatisticsCmp
protected SiteManager _siteManager
protected Multimap<String,String> _pathSanitizer
protected Map<String,Multimap<String,String>> _pathMaps
protected Map<String,Map<String,ServersCacheStatsGenerator.FrontFromHTTPServerStatsEntry>> _fromHTTPServerStats
protected Map<String,Map<String,ServersCacheStatsGenerator.FrontFromFrontStatsEntry>> _fromFrontOnlyStats
protected Map<String,ServersCacheStatsGenerator.BackStatsEntry> _backStats
public ServersCacheStatsGenerator()
public void service(ServiceManager sm) throws ServiceException
service in interface Serviceableservice in class ServiceableGeneratorServiceExceptionpublic void generate() throws IOException, SAXException, ProcessingException
public void recycle()
recycle in interface Recyclablerecycle in class AbstractGeneratorprivate List<ServersCacheStatsGenerator.RawStatsEntry> _getStatsFromDb(String siteName) throws ProcessingException
siteName - The site nameServersCacheStatsGenerator.RawStatsEntryProcessingException - if an error occursprivate List<ServersCacheStatsGenerator.RawStatsEntry> _processCacheStatsResultSet(List<Map<String,Object>> rawCacheStats) throws SQLException
SQLExceptionprivate void _initializeStats(List<ServersCacheStatsGenerator.RawStatsEntry> rawStats)
rawStats - the raw statisticsprivate void _addToHTTPServerStats(ServersCacheStatsGenerator.FrontFromHTTPServerStatsEntry httpServerEntry)
private void _addToFrontOnlyStats(ServersCacheStatsGenerator.FrontFromFrontStatsEntry frontEntry)
private void _registerPath(String serverSite, String path)
private void _internalRegisterPath(Multimap<String,String> pathMap, String consumed, LinkedList<String> tail)
pathMap - Multimap representing the paths to the resources within a site.consumed - the consumed part of the current path being registered.tail - tail of the current path being registered. The tail will be consumed in the recursive nested calls of this internal function.private void _saxStatsBySite(Site site) throws SAXException
SAXExceptionprivate void _saxStatsEntry(String name, String path, Multimap<String,String> pathMap, Map<String,ServersCacheStatsGenerator.FrontFromHTTPServerStatsEntry> httpServerEntries, Map<String,ServersCacheStatsGenerator.FrontFromFrontStatsEntry> frontEntries) throws SAXException
SAXExceptionprivate void _saxStatsHTTPServerEntry(ServersCacheStatsGenerator.FrontFromHTTPServerStatsEntry httpServerEntry) throws SAXException
SAXExceptionprivate void _saxStatsFrontEntry(ServersCacheStatsGenerator.FrontFromFrontStatsEntry frontEntry) throws SAXException
SAXExceptionprivate void _saxStatsBackEntry(ServersCacheStatsGenerator.BackStatsEntry backEntry) throws SAXException
SAXExceptionprivate void _saxStatsOrphanEntries() throws SAXException
SAXExceptionprivate void __addAttrIfNotNull(AttributesImpl attrs, String localName, String value)
private void __addAttrIfNotNull(AttributesImpl attrs, String localName, Boolean value)