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
|
manager
objectModel, parameters, resolver, source
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
Constructor and Description |
---|
ServersCacheStatsGenerator() |
dispose
setup
setConsumer, setContentHandler, setLexicalHandler
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setConsumer
protected 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 Serviceable
service
in class ServiceableGenerator
ServiceException
public void generate() throws IOException, SAXException, ProcessingException
public void recycle()
recycle
in interface Recyclable
recycle
in class AbstractGenerator
private List<ServersCacheStatsGenerator.RawStatsEntry> _getStatsFromDb(String siteName) throws ProcessingException
siteName
- The site nameServersCacheStatsGenerator.RawStatsEntry
ProcessingException
- if an error occursprivate List<ServersCacheStatsGenerator.RawStatsEntry> _processCacheStatsResultSet(List<Map<String,Object>> rawCacheStats) throws SQLException
SQLException
private 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
SAXException
private void _saxStatsEntry(String name, String path, Multimap<String,String> pathMap, Map<String,ServersCacheStatsGenerator.FrontFromHTTPServerStatsEntry> httpServerEntries, Map<String,ServersCacheStatsGenerator.FrontFromFrontStatsEntry> frontEntries) throws SAXException
SAXException
private void _saxStatsHTTPServerEntry(ServersCacheStatsGenerator.FrontFromHTTPServerStatsEntry httpServerEntry) throws SAXException
SAXException
private void _saxStatsFrontEntry(ServersCacheStatsGenerator.FrontFromFrontStatsEntry frontEntry) throws SAXException
SAXException
private void _saxStatsBackEntry(ServersCacheStatsGenerator.BackStatsEntry backEntry) throws SAXException
SAXException
private void _saxStatsOrphanEntries() throws SAXException
SAXException
private void __addAttrIfNotNull(AttributesImpl attrs, String localName, String value)
private void __addAttrIfNotNull(AttributesImpl attrs, String localName, Boolean value)