Add Devices Statistics to AbstractTagDriver

Hi @Kevin.Herron,

I would like to add Devices Statistics like for devices in Ignition 8.1.7 (Button Details)
My devices extends AbstractTagDriver.
Is it possible ? what is the process to add it ?

The device statistics implementation is not part of the SDK. If it ever does become part of the SDK it would only be for implementations against the 8.0 Device API, but I’m not sure it will happen.

You will have to roll your own implementation if you want them for now.

You can at least get the gateway status diagnostics page by implementing Driver::getSamplingMetrics, but there’s no way to get the OPC tags and you do still have to actually implement all the diagnostic gathering yourself.

I implemented (part of) it for my Modbus driver’s client connection mode. The key was supplying the histograms with nanoseconds from System.nanoTime().

It was a pain to add request tracking into the functional paths to obtain the timing information. ):

Yes, and there's no way around that. All of our polling driver implementations take care to track their requests, though we do have some shared code and implementations that make it easier.

Yeah, when I decided to implement, I burned a day looking for shortcuts. No shortcut.

ok I see.

@Kevin.Herron, @pturmel

How can we configure thread or thread pool in order the thread are counted in the Devices item of the Thread Performance by System histogram ?

Check out the docs for com.inductiveautomation.ignition.common.execution.TPC.

The easiest way when you are already creating a dedicated thread pool is to use TPC.newThreadFactory to create a ThreadFactory that you use with the pool.

Otherwise you just have to manually set/unset the context when doing work on a thread you know belongs to some system.

2 Likes

Learned something new today. Thanks, Kevin.

How are calculated diagnostics tags ActualThroughput and IdealThroughput ?
(I’ve found other diagnostics data with Histogram and Meter but nothing related to those 2 tags ?)

There’s a table on this page that describes the newer device diagnostic tags: OPC UA Drivers - Ignition User Manual 8.1 - Ignition Documentation

ActualThroughput is just the one minute rate from a Timer’s Meter.

1 Like

All the devices metrics are exposed by tags. It’s perfect !

It could be usefull to add a script function system.device.xxx to be able to retrieve the histogram data of a device, or directly the Histogram object.

The pupose is to be able to “reproduce” the device detail gateway web page in the vision or perpsective client !

Ignition 8.1.11

Hi Kevin,

I have a module based on the AbstractTagDriver.
I have a strange behavior about the metrics tag: [Diagnostics]/Sampling/MonitoredItemCount

If I don’t create it, the MonitoredItemCount value is well displayed in the gateway device diagnostics page, but I don’t have an opc tag for it.

If I create, it’s the same. I don’t have this tag created in Ignition OPC UA Server.

So, I don’t know if I have to create this tag on my side or not ?

oops, sorry I missed to fully create the [Diagnostics]/Sampling/MonitoredItemCount opc tag

AbstractTagDriver did not get updated with new diagnostics implementation. Looking at it, I’m not sure how you have any diagnostics tags or the diagnostic page at all, unless you’ve implemented them yourself.