Class SessionStats
- java.lang.Object
-
- com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
-
- com.inductiveautomation.perspective.gateway.session.SessionStats
-
public class SessionStats extends AbstractLifecycle
-
-
Constructor Summary
Constructors Constructor Description SessionStats(PerspectiveContext context, java.util.UUID sessionId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiTimerContextbeginExpressionTimer()Use this for timing expressions to correctly update both the session timer and the shared global timerMultiTimerContextbeginScriptTimer()Use this for timing scripts to correctly update both the session timer and the shared global timerjava.util.Map<java.lang.String,com.codahale.metrics.Metric>getAllMetrics()com.codahale.metrics.TimergetExpressionTimer()The timer for expressions executed by this session.com.codahale.metrics.TimergetFetchTimer()com.codahale.metrics.MetergetMessagesRecv()com.codahale.metrics.MetergetMessagesSent()java.lang.StringgetPrefix()com.codahale.metrics.MetergetPropertyChanges()com.codahale.metrics.TimergetQueueTaskTimer()com.codahale.metrics.TimergetScriptTimer()The timer for scripts executed by this session.java.lang.Stringname(java.lang.String... names)MetricBuildernewBuilder(java.lang.String name)Returns a builder set up with the registry and correctly prefixed namevoidnotifyPropertyChanged()Call this whenever a property changes.voidnotifyReconnected()protected voidonShutdown()protected voidonStartup()voidregister(java.lang.String name, com.codahale.metrics.Metric metric)voidremove(java.lang.String name)-
Methods inherited from class com.inductiveautomation.ignition.common.lifecycle.AbstractLifecycle
isRunning, shutdown, startup
-
-
-
-
Constructor Detail
-
SessionStats
public SessionStats(PerspectiveContext context, java.util.UUID sessionId)
-
-
Method Detail
-
getPrefix
public java.lang.String getPrefix()
-
name
public java.lang.String name(java.lang.String... names)
-
register
public void register(java.lang.String name, com.codahale.metrics.Metric metric)
-
newBuilder
public MetricBuilder newBuilder(java.lang.String name)
Returns a builder set up with the registry and correctly prefixed name
-
remove
public void remove(java.lang.String name)
-
getMessagesRecv
public com.codahale.metrics.Meter getMessagesRecv()
-
getMessagesSent
public com.codahale.metrics.Meter getMessagesSent()
-
getQueueTaskTimer
public com.codahale.metrics.Timer getQueueTaskTimer()
-
getFetchTimer
public com.codahale.metrics.Timer getFetchTimer()
-
getPropertyChanges
public com.codahale.metrics.Meter getPropertyChanges()
-
notifyPropertyChanged
public void notifyPropertyChanged()
Call this whenever a property changes. Updates both the session property-change meter and the global one.
-
notifyReconnected
public void notifyReconnected()
-
getScriptTimer
public com.codahale.metrics.Timer getScriptTimer()
The timer for scripts executed by this session. See also @beginScriptTimer
-
getExpressionTimer
public com.codahale.metrics.Timer getExpressionTimer()
The timer for expressions executed by this session. See alsobeginExpressionTimer()
-
beginScriptTimer
public MultiTimerContext beginScriptTimer()
Use this for timing scripts to correctly update both the session timer and the shared global timer
-
beginExpressionTimer
public MultiTimerContext beginExpressionTimer()
Use this for timing expressions to correctly update both the session timer and the shared global timer
-
onStartup
protected void onStartup()
- Specified by:
onStartupin classAbstractLifecycle
-
onShutdown
protected void onShutdown()
- Specified by:
onShutdownin classAbstractLifecycle
-
getAllMetrics
public java.util.Map<java.lang.String,com.codahale.metrics.Metric> getAllMetrics()
-
-