Hi,
It may be interesting if we could have Previous State and Previous State Duration in logs.
It can be useful to work out Availabilty ... in a very simple manner.
Here is a try of an algorithm :
If current_log.type ="Service Alert" or "Host Alert"
and current_log.state != previous_log.state
then
Add previous state and duration in current log
I think that : before writing a new log, shinken has all needed informations to find last state and last state duration so that it should be easy to add it when writing the log than calculating it afterward.
What do you think ?