public abstract class AbstractPerformanceStats<T extends IEventTypeEnumerator> extends java.lang.Object implements IPerformanceStats<T>
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_CONTEXT |
| Constructor and Description |
|---|
AbstractPerformanceStats() |
| Modifier and Type | Method and Description |
|---|---|
void |
closeAllParentContext()
Close all the context in
contextStackCall list and remove them from the list. |
void |
closeAndLogContext(java.lang.String context)
Close a context using name provided in argument and remove it from
contextStackCall list. |
void |
closeAndLogContext(java.lang.String context,
java.lang.Object blame)
Close a context using name provided in argument and remove it from
contextStackCall list. |
void |
closeAndLogCurrentContext()
Close the last context in
contextStackCall list and remove it from the list. |
void |
closeContext(java.lang.String context)
Close a context using name provided in argument and remove it from
context stack call list. |
boolean |
contextRunningTimeExceedTimeOut(java.lang.String context,
long timeOut)
Check if the running time for the context provided in argument exceed the timeout value provide in argument.
|
void |
endEvent(T enumerator,
java.lang.Object blameObject)
Stop the running time for the event referenced by the ID and the blame object under the current opened context .
|
void |
endEvent(T enumerator,
java.lang.Object blameObject,
java.lang.String context)
Stop the running time for the event referenced by the ID and the blame object under the provided context.
|
protected static boolean |
getBooleanOption(java.lang.String optionName,
boolean defaultValue) |
java.util.Collection<java.lang.String> |
getContextNames()
Return a list of all the context declared in the base.
|
long |
getContextRunningTime(java.lang.String context)
Return the context running time in millisecond.
|
StatsEvent |
getEventStat(T enumerator,
java.lang.Object blameObject,
java.lang.String context)
Return the
StatsEvent referenced by the ID and the blame object under the provided context. |
java.util.Map<java.lang.Integer,StatsEvent> |
getEventStats(T enumerator,
java.lang.String context)
Return all the
StatsEvent of this ID under the provided context. |
java.util.List<StatsEvent> |
getEventsTimeFailure()
Return a list of all the events triggered under any of the contexts,that are in time failure state.
|
protected int |
getIntOption(java.lang.String optionName,
int defaultValue) |
protected abstract java.lang.String |
getPluginId() |
java.util.List<StatsEvent> |
getTimeFailureEventsInContext(java.lang.String context)
Return a list of all the events under that context that are in time failure state.
|
boolean |
isContextEventsTimeFailure(java.lang.String context)
Check if there are events triggered under the context,that are in time failure state.
|
boolean |
isEnabled()
Return activation status for performanceStats framework.
|
boolean |
isEventsTimeFailure()
Check if there are events triggered under any of the contexts,that are in time failure state.
|
boolean |
isEventTimeFail(T enumerator,
java.lang.Object blameObject)
Test if an event triggered under default context has a running time exceeding timeout value defined in .option
file.
|
boolean |
isEventTimeFail(T enumerator,
java.lang.Object blameObject,
java.lang.String context)
Test if an event triggered under context has a running time exceeding timeout value defined in .option file.
|
boolean |
isEventTriggered() |
boolean |
isRegisteredContext(java.lang.String context)
Check if the context provided in argument has been declared and used.
|
int |
numberOfContextEventsTimeFailure(java.lang.String context)
Return the number of events triggered under the context,that are in time failure state.
|
int |
numberOfEventsTimeFailure(java.lang.String context)
Return the number of events triggered under any of the contexts,that are in time failure state.
|
void |
openContext(java.lang.String context)
Open a context using name provided in argument, and add it to the top of
contextStackCall
list. |
void |
openContext(java.lang.String context,
java.lang.Object blame)
Open a context using name provided in argument, and add it to the top of
contextStackCall
list. |
boolean |
openContextIfFirstOne(java.lang.String context) |
java.lang.String |
printAllStats()
Provided a string representing all data stored in the base.
|
java.lang.String |
printContextStats(java.lang.String context)
Provided a string representing all data stored in the base for one context.
|
java.lang.String |
printContextsTree()
Provided a string representing the tree architecture for all the contexts.
|
java.lang.String |
printContextTree(java.lang.String context)
Provided a string representing the tree architecture for one context.
|
java.lang.String |
printEventStat(T enumerator,
java.lang.Object blameObject,
java.lang.String context)
Provided a string representing data stored in the base for one event.
|
java.lang.String |
printEventStats(T enumerator,
java.lang.String context)
Provided a string representing data stored in the base for one ID type of event under a given context.
|
void |
removeAllStats()
Remove all contexts and events stored in the data base.
|
void |
removeContext(java.lang.String context)
Remove a context from the data base and all the events stored under that context.
|
void |
removeStat(T enumerator,
java.lang.Object blameObject,
java.lang.String context)
Remove a
StatsEvent object from the data base. |
void |
removeStatsForContext(java.lang.String context)
Remove all the events stored under that context from the data base.
|
void |
removeStatsForEvent(T enumerator,
java.lang.String context)
Remove all the events of one given ID stored under that context from the data base.
|
void |
startEvent(T enumerator,
java.lang.Object blameObject)
Start an event under the current opened context (default context if no context is opened).If an event with the
same ID and the same blame object has been previously triggered, the running time for this declaration
will be added to the current running time value and runCount parameter will be incremented.
|
void |
startEvent(T enumerator,
java.lang.Object blameObject,
java.lang.String context)
Start an event under the provided context (default context if the context is not opened).If an event with the
same ID and the same blame object has been previously triggered, the running time for this declaration
will be added to the current running time value and runCount parameter will be incremented.
|
void |
startNewEvent(T enumerator,
java.lang.Object blameObject)
Start a new event under the current opened context (default context if no context is opened).If an event with the
same ID and the same blame object has been previously triggered it will be replaced.
|
void |
startNewEvent(T enumerator,
java.lang.Object blameObject,
java.lang.String context)
Start a new event under the provided context (default context if the context is not opened).If an event with the
same ID and the same blame object has been previously triggered it will be replaced.
|
public boolean isEnabled()
IPerformanceStatsisEnabled in interface IPerformanceStats<T extends IEventTypeEnumerator>public boolean isEventTriggered()
isEventTriggered in interface IPerformanceStats<T extends IEventTypeEnumerator>public boolean openContextIfFirstOne(java.lang.String context)
openContextIfFirstOne in interface IPerformanceStats<T extends IEventTypeEnumerator>public void openContext(java.lang.String context,
java.lang.Object blame)
IPerformanceStatscontextStackCall
list. If context is open for the first time a new one is created and added. All the events triggered after the
call to openContext(String context) and before a call to
closeContext(String context) or closeCurrentContext() will be included in
this context.openContext in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context to open. This must not be null.public void openContext(java.lang.String context)
IPerformanceStatscontextStackCall
list. If context is open for the first time a new one is created and added. All the events triggered after the
call to openContext(String context) and before a call to
closeContext(String context) or closeCurrentContext() will be included in
this context.openContext in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context to open. This must not be null.public void closeAndLogContext(java.lang.String context,
java.lang.Object blame)
IPerformanceStatscontextStackCall list. In
runTime mode context description is logged after context is closed. If the option
org.eclipse.sphinx.platform/perf/jUnitOptions/resetEventBase in .option file is set
true all the events included in this context are removed from the base after logging.closeAndLogContext in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context to close. This must not be null.public void closeAndLogContext(java.lang.String context)
IPerformanceStatscontextStackCall list. In
runTime mode context description is logged after context is closed. If the option
org.eclipse.sphinx.platform/perf/jUnitOptions/resetEventBase in .option file is set
true all the events included in this context are removed from the base after logging.closeAndLogContext in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context to close. This must not be null.public void closeAndLogCurrentContext()
IPerformanceStatscontextStackCall list and remove it from the list. In runTime mode
context description is logged after context is closed. If the option
org.eclipse.sphinx.platform/perf/jUnitOptions/resetEventBase in .option file is set
true all the events included in this context are removed from the base after logging.closeAndLogCurrentContext in interface IPerformanceStats<T extends IEventTypeEnumerator>public void closeAllParentContext()
IPerformanceStatscontextStackCall list and remove them from the list. In runTime mode
context description of the first context in the list (the parent context)is logged. If the option
org.eclipse.sphinx.platform/perf/jUnitOptions/resetEventBase in .option file is set
true all the events included in this context are removed from the base after logging.closeAllParentContext in interface IPerformanceStats<T extends IEventTypeEnumerator>public void closeContext(java.lang.String context)
IPerformanceStatscontext stack call list.
All the events triggered after this call to the close method will be included in the previous opened context. If
there is no more opened context events are added to default context Global.closeContext in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context to close. This must not be null.protected static boolean getBooleanOption(java.lang.String optionName,
boolean defaultValue)
protected int getIntOption(java.lang.String optionName,
int defaultValue)
protected abstract java.lang.String getPluginId()
public void removeStat(T enumerator, java.lang.Object blameObject, java.lang.String context)
IPerformanceStatsStatsEvent object from the data base.removeStat in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.blameObject - An object responsible for the event.Can be a simple string. Must not be null.context - the context where the event has been triggered.public void removeContext(java.lang.String context)
IPerformanceStatsremoveContext in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context to remove.public void removeStatsForContext(java.lang.String context)
IPerformanceStatsremoveStatsForContext in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context.public void removeStatsForEvent(T enumerator, java.lang.String context)
IPerformanceStatsremoveStatsForEvent in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.context - the name of the context.public void removeAllStats()
IPerformanceStatsremoveAllStats in interface IPerformanceStats<T extends IEventTypeEnumerator>public boolean isEventTimeFail(T enumerator, java.lang.Object blameObject)
IPerformanceStatsisEventTimeFail in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.blameObject - An object responsible for the event.Can be a simple string. Must not be null.public boolean isEventTimeFail(T enumerator, java.lang.Object blameObject, java.lang.String context)
IPerformanceStatsisEventTimeFail in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.blameObject - An object responsible for the event.Can be a simple string. Must not be null.context - the name of the context.public void startNewEvent(T enumerator, java.lang.Object blameObject)
IPerformanceStatsstartNewEvent in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.blameObject - An object responsible for the event.Can be a simple string. Must not be null.public void startEvent(T enumerator, java.lang.Object blameObject)
IPerformanceStatsstartEvent in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.blameObject - An object responsible for the event.Can be a simple string. Must not be null.public void startNewEvent(T enumerator, java.lang.Object blameObject, java.lang.String context)
IPerformanceStatsstartNewEvent in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.blameObject - An object responsible for the event.Can be a simple string. Must not be null.public void startEvent(T enumerator, java.lang.Object blameObject, java.lang.String context)
IPerformanceStatsstartEvent in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.blameObject - An object responsible for the event.Can be a simple string. Must not be null.public void endEvent(T enumerator, java.lang.Object blameObject)
IPerformanceStatsendEvent in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.blameObject - An object responsible for the event.Can be a simple string. Must not be null.public void endEvent(T enumerator, java.lang.Object blameObject, java.lang.String context)
IPerformanceStatsendEvent in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.blameObject - An object responsible for the event.Can be a simple string. Must not be null.context - the name of the context containing the event.public StatsEvent getEventStat(T enumerator, java.lang.Object blameObject, java.lang.String context)
IPerformanceStatsStatsEvent referenced by the ID and the blame object under the provided context.getEventStat in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.blameObject - An object responsible for the event.Can be a simple string. Must not be null.context - the name of the context containing the event.StatsEventpublic java.util.Map<java.lang.Integer,StatsEvent> getEventStats(T enumerator, java.lang.String context)
IPerformanceStatsStatsEvent of this ID under the provided context.getEventStats in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.context - the name of the context containing the event.public java.util.Collection<java.lang.String> getContextNames()
IPerformanceStatsgetContextNames in interface IPerformanceStats<T extends IEventTypeEnumerator>public boolean contextRunningTimeExceedTimeOut(java.lang.String context,
long timeOut)
IPerformanceStatscontextRunningTimeExceedTimeOut in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context.timeOut - timeout value in millisecond.true if context has been declared false otherwise.public boolean isRegisteredContext(java.lang.String context)
IPerformanceStatsisRegisteredContext in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context.true if context has been declared false otherwise.public long getContextRunningTime(java.lang.String context)
IPerformanceStatsgetContextRunningTime in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context.public java.util.List<StatsEvent> getTimeFailureEventsInContext(java.lang.String context)
IPerformanceStatsgetTimeFailureEventsInContext in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context.public boolean isEventsTimeFailure()
IPerformanceStatsisEventsTimeFailure in interface IPerformanceStats<T extends IEventTypeEnumerator>true if at least one of all the events triggered is in time failure state.public int numberOfEventsTimeFailure(java.lang.String context)
IPerformanceStatsnumberOfEventsTimeFailure in interface IPerformanceStats<T extends IEventTypeEnumerator>public java.util.List<StatsEvent> getEventsTimeFailure()
IPerformanceStatsgetEventsTimeFailure in interface IPerformanceStats<T extends IEventTypeEnumerator>public boolean isContextEventsTimeFailure(java.lang.String context)
IPerformanceStatsisContextEventsTimeFailure in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context.true if at least one of all the events triggered under this context is in time failure
state.public int numberOfContextEventsTimeFailure(java.lang.String context)
IPerformanceStatsnumberOfContextEventsTimeFailure in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context.public java.lang.String printContextTree(java.lang.String context)
IPerformanceStatsprintContextTree in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context.public java.lang.String printContextsTree()
IPerformanceStatsprintContextsTree in interface IPerformanceStats<T extends IEventTypeEnumerator>public java.lang.String printAllStats()
IPerformanceStatsprintAllStats in interface IPerformanceStats<T extends IEventTypeEnumerator>public java.lang.String printContextStats(java.lang.String context)
IPerformanceStatsprintContextStats in interface IPerformanceStats<T extends IEventTypeEnumerator>context - the name of the context.public java.lang.String printEventStat(T enumerator, java.lang.Object blameObject, java.lang.String context)
IPerformanceStatsprintEventStat in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.blameObject - An object responsible for the event.Can be a simple string. Must not be null.context - the name of the context containing the event.public java.lang.String printEventStats(T enumerator, java.lang.String context)
IPerformanceStatsprintEventStats in interface IPerformanceStats<T extends IEventTypeEnumerator>enumerator - The ID of the event.Must be an enumerator provided by the enum declared in the concrete class of
AbstractPerformanceStats.context - the name of the context containing the event.