using System.Collections.Generic;
namespace OwinFramework.InterfacesV1.Capability
{
///
/// Middleware that implements this interface gather statictics at
/// runtime about the requests that have been handled, and expose
/// this to allow other middleware to provide a 'dashboard' type
/// functionallity for the application developer or support
/// engineer to figure out issues with the way the system is
/// performing.
///
public interface IAnalysable
{
///
/// Returns a list of the statistics that this middleware provides for inclusion
/// on a dashboard. Typically the user will choose statistics to incluse on
/// the dashboard from this list
///
IList AvailableStatistics { get; }
///
/// Returns a statistic by its ID.
///
IStatistic GetStatistic(string id);
}
///
/// Static information about a statistic that does not change as the application rune
///
public interface IStatisticInformation
{
///
/// Persistent identifier for this statstic. This can be stored in dashboard
/// applications persistently to refer to this statistic. Once your middleware
/// is published you must support the old ID values in the future.
///
string Id { get; }
///
/// A short lingle line name of this statistic. This is used in drop-down lists
/// when the user is asked to choose a statistic.
/// See https://www.vicimediainc.com/google-analytics-cheat-sheet-2/
///
string Name { get; }
///
/// The units of measure for this statistic, For example seconds or
/// bytes per second.
///
string Units { get; }
///
/// A longer plain text description that can be mutiple lines
///
string Description { get; }
///
/// Returns a detailed explanation of how to interpret the numbers
///
string Explanation { get; }
}
///
/// Dynamic information about a statistic that changes as the application runs.
///
public interface IStatistic
{
///
/// The numerical value of this statistic. This is provided so that
/// a dashboard application can graph the results or calculate
/// trends.
///
float Value { get; }
///
/// When the value property is a ratio then this property contains
/// the denominator of that ratio. This allows the ratio calculation
/// to be reversed back into the original two values.
/// For example if the Value is in bytes/sec then this property
/// must contain the number of seconds so that Value*Deniminator
/// will result in the total number of bytes.
///
float Denominator { get; }
///
/// Returns the value formatted with units, and scaled for human
/// readability.
///
string Formatted { get; }
///
/// Updates all of the properties atomically with new values. If no
/// new values are available then the values will remain unchanged.
///
IStatistic Refresh();
}
}