The monitoring system within DataSource.NET allows your application to publish attributes and expose operations that can be invoked by any JMX application.
More...
The monitoring system within DataSource.NET allows your application to publish attributes and expose operations that can be invoked by any JMX application.
DataSource.NET is built using Caplin's DSDK which is a C library that can optionally embed a JVM to permit access from JMX clients to attributes and operations exposed by the library. All of the built-in monitoring within DSDK is also exposed by DataSource.NET.
The Monitoring namespace allows your application to add instrumentation to the same JMX implementation and thus allow your application to be controlled by JMX clients such as the Caplin Management Console.
using System.Collections.Generic;
namespace DataSourceExamples.Monitoring
{
public class ExampleMonitoringBean : MonitoringBean
{
public ExampleMonitoringBean()
: base("datasource.application.monitoring", "Example monitoring interface", "SINGLETON")
{
}
[MonitorableValue("string-array", Description = "String array", Active = true)]
public string[] Strings { get { return new string[] { "element1", "element1" }; } }
[MonitorableValue("int-array", Description = "Integer array", Active = true)]
public int[] Ints { get { return new int[] { 1, 2, 3, 4 }; } }
private int updatesSent = 0;
[MonitorableValue("updates-sent", Description = "Number of updates sent")]
public int UpdatesSent
{
get { return updatesSent; }
set { base.SetField(ref updatesSent, value, "updates-something"); }
}
[MonitorableValue("exec-something", Description = "Do something")]
public string MyFunc(int val, string bar)
{
return "FF";
}
}
}