Record 'Recent Slow Response Events'

Is there a way to log or record the msgs that show up in the 'Recent Slow Response Events'? We are using 8.1.45 . These are found under Ign GW’s Status > Systems > Overview

I don’t expect a straightforward location to pick up these msgs but I have seen people here use things like “from com.inductiveautomation.ignition.gateway import IgnitionGateway” to expose things like ‘mod_mgr.resolveClass('com.inductiveautomation.perspective.gateway.api.PerspectiveContext')’ and do magic with it :star_struck: so was hoping there is a way to extract this info. If it can reach the GW webpage then we should be able to get it as well!

The Metrics Dashboard has the clock drift detector as a watchable value:

It would also be possible to monitor the value of that gauge programmatically, starting from a GatewayContext to retrieve the metrics registry.

1 Like

Any sample code that I could use to get started? I have no experience with this one

You can access the MetricRegistry:

Which is a class directly from a third party library.
You could ask it for the set of gauges it contains, which will return a dictionary:

The Guage object you get from that dictionary (at the ClockDriftDetector.driftGauge key) will have a getValue method: Gauge - metrics-core 4.0.3 javadoc

So it would look something like:

from com.inductiveautomation.ignition.gateway import IgnitionGateway

__gateway = IgnitionGateway.get()
__metrics = __gateway.metricRegistry
__driftGauge = __metrics.gauges["ClockDriftDetector.driftGauge"]

def getDriftValue():
	return __driftGauge.value
3 Likes