Hi, I've added some comments to the issue about the current api :) I think we should not relying on log messages as the communication between a HC and the result. The HC should create a proper result object, and the status should be a field in that object.
I think a boolean value (failed/ok) might bot be sufficient, so I think an enum with more values inbetween (like Jörg's API has) is better. For the range stuff, I think we don't need this. If we make the Result a class with setter methods, we can later on add additional stuff if required without breaking anything. Carsten 2013/8/9 Bertrand Delacretaz <bdelacre...@apache.org> > Hi, > > Following up on SLING-2987 I'm wondering about the best way to > represent the results of health checks. > > Right now the health check Result just provides a boolean isOk() > method, along with a getStatus() that's similar to a log level (ok, > warn, error etc.). > > I haven't been using the status so far, so for now it's just a > pass/fail (along with a mini-log that provides unstructured details). > > Another model that might be more useful (or YAGNI...hence this > question) would be: > > public interface ResultThatHasAValue { > // The output value of this health check > public object getValue(); > > // The acceptable range of our value > public String getRange(); > > // True if our value is in range > public boolean isInRange(); > > // + logs as now > } > > The advantage of this value-based result is that it can also be used > to aggregate values that might be analyzed in a finer way by external > JMX tools (as the healthcheck results are now available via JMX). > > The range can be a simple mini-language with ranges like "true", > "between 12 and 41", "> 16", "some.*Regexp", etc. > > WDYT, does anyone have a concrete use case for ResultThatHasAValue? > Otherwise I'll stick with the current pass/fail (+logs) results. > > Note that the docs at [1] are out of date now, but if you want to play > with the health check just build and install the two bundles found > under contrib/extensions/healthcheck and open > /system/console/healthcheck > > -Bertrand > > [1] > http://sling.apache.org/documentation/bundles/sling-health-check-tool.html > -- Carsten Ziegeler cziege...@apache.org