Package com.xpn.xwiki.monitor.api
Class MonitorPlugin
- java.lang.Object
-
- com.xpn.xwiki.plugin.XWikiDefaultPlugin
-
- com.xpn.xwiki.monitor.api.MonitorPlugin
-
- All Implemented Interfaces:
XWikiPluginInterface
public class MonitorPlugin extends XWikiDefaultPlugin
-
-
Constructor Summary
Constructors Constructor Description MonitorPlugin(String name, String className, XWikiContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endRequest()
void
endTimer(String timername)
Map<Thread,MonitorData>
getActiveTimerData()
long
getDuration()
long
getDuration(String timer)
org.apache.commons.collections4.queue.CircularFifoQueue<MonitorData>
getLastTimerData()
org.apache.commons.collections4.queue.CircularFifoQueue<MonitorData>
getLastUnfinishedTimerData()
String
getName()
The name which can be used for accessing this plugin fromXWiki.getPlugin(String, XWikiContext)
.long
getNbCalls(String timer)
long
getRequests()
long
getRequests(String timer)
Map<String,MonitorTimerSummary>
getTimerSummaries()
void
init(XWikiContext context)
Global initialization, called when the platform is started and the plugin list is initialized.boolean
isActive()
void
reset(XWikiContext context)
void
setActive(boolean bActive)
void
setTimerDesc(String timername, String desc)
void
setWikiPage(String page)
void
startRequest(String page, String action, URL url)
void
startTimer(String timername)
void
startTimer(String timername, String desc)
-
Methods inherited from class com.xpn.xwiki.plugin.XWikiDefaultPlugin
beginParsing, beginRendering, commonTagsHandler, downloadAttachment, endParsing, endRendering, endRenderingHandler, flushCache, flushCache, getClassName, getLocalization, getPluginApi, insidePREHandler, localizePlainOrKey, outsidePREHandler, setClassName, setName, startRenderingHandler, virtualInit
-
-
-
-
Constructor Detail
-
MonitorPlugin
public MonitorPlugin(String name, String className, XWikiContext context)
-
-
Method Detail
-
init
public void init(XWikiContext context)
Description copied from interface:XWikiPluginInterface
Global initialization, called when the platform is started and the plugin list is initialized.- Specified by:
init
in interfaceXWikiPluginInterface
- Overrides:
init
in classXWikiDefaultPlugin
- Parameters:
context
- the current context, should not be stored since it will become mostly unreliable once the initial request is terminated
-
reset
public void reset(XWikiContext context)
-
getName
public String getName()
Description copied from interface:XWikiPluginInterface
The name which can be used for accessing this plugin fromXWiki.getPlugin(String, XWikiContext)
.- Specified by:
getName
in interfaceXWikiPluginInterface
- Overrides:
getName
in classXWikiDefaultPlugin
- Returns:
- the plugin name, usually a lowercase identifier
-
endRequest
public void endRequest()
-
setWikiPage
public void setWikiPage(String page)
-
getLastTimerData
public org.apache.commons.collections4.queue.CircularFifoQueue<MonitorData> getLastTimerData()
-
getLastUnfinishedTimerData
public org.apache.commons.collections4.queue.CircularFifoQueue<MonitorData> getLastUnfinishedTimerData()
-
startTimer
public void startTimer(String timername)
-
endTimer
public void endTimer(String timername)
-
getActiveTimerData
public Map<Thread,MonitorData> getActiveTimerData()
-
getTimerSummaries
public Map<String,MonitorTimerSummary> getTimerSummaries()
-
getDuration
public long getDuration()
-
getRequests
public long getRequests()
-
getDuration
public long getDuration(String timer)
-
getNbCalls
public long getNbCalls(String timer)
-
getRequests
public long getRequests(String timer)
-
isActive
public boolean isActive()
-
setActive
public void setActive(boolean bActive)
-
-