JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
enhancement_small.png
CLOSED  Enhancement JPPF-579  -  Monitoring data providers: ability to configure a value converter for each datum
Posted Feb 13, 2019 - updated Feb 14, 2019
action_vote_minus_faded.png
0
Votes
action_vote_plus_faded.png
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Enhancement
  • Status
     
    Closed
  • Assigned to
     lolo4j
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     lolo4j
  • Owned by
    Not owned by anyone
  • Category
    Management / Monitoring
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Targetted for
    icon_milestones.png JPPF 6.1
Issue description
Monitoring data providers allow to define properties of various types that are monitored over time. However, there is currently no way to specify how these values should be displayed in the JVM health view of the desktop and web administration consoles. JPPF currently uses default conversions based on the type of each property, but this may not be always convenient.

For instance, let's say we want to monitor the JVM uptime. This value is expressed in millisecons as a long integer value. However, in the GUI we'd rather have it displayed as days:hours:minutes:seconds.millis.

We propose to implement the ability to configure a value converter for each defined property to this effect.

For instance (just for example purpose, this is not what the actual design will be):
public interface MonitoringValueConverter {
  String convert(String value);
}
 
public abstract class MonitoringDataProvider {
  ...
 
  public MonitoringDataProvider setConverter(String name, MonitoringValueConverter converter) {
    ...
  }
}
 
public class MyProvider extends MonitoringDataProvider {
  ...
 
  @Override
  public void defineProperties() {
    ...
    setLongProperty("time", -1L).setConverter("time", value -> new Date(Long.valueOf(value)).toString());
  }
}