Package org.gcube.common.health.api
Interface Statistics
public interface Statistics
One group of public statistics of an application, e.g. the Contexts of a registry: aggregate
numbers only, never a name of a Context, an identifier or a user. The class is annotated
StatisticsGroup and has a constructor without arguments.
SmartGears computes the group on a thread of its own, once the application is active and then
every refresh(): a request never computes and never waits. An exception keeps the previous
result and the group is computed again a minute later. The computation runs with the secret of the
container in the Context it publishes from.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DurationHow often a group is computed again, unless it says otherwise. -
Method Summary
Modifier and TypeMethodDescriptioncompute()Computes the group.Returns what the group describes, in one sentence.id()Returns the identifier of the group, its field in the document: lowerCamelCase, unique among the groups of the application.default Durationrefresh()Returns how often the group is computed again: a group that is expensive to compute declares a longer interval.title()Returns the title of the group, as a page shows it.
-
Field Details
-
DEFAULT_REFRESH
How often a group is computed again, unless it says otherwise.
-
-
Method Details
-
id
String id()Returns the identifier of the group, its field in the document: lowerCamelCase, unique among the groups of the application.- Returns:
- the identifier
-
title
String title()Returns the title of the group, as a page shows it.- Returns:
- the title
-
description
String description()Returns what the group describes, in one sentence.- Returns:
- the description
-
refresh
Returns how often the group is computed again: a group that is expensive to compute declares a longer interval.- Returns:
- the interval,
DEFAULT_REFRESHunless the group says otherwise
-
compute
Computes the group.- Returns:
- its figures, in the order a page shows them
- Throws:
Exception- when the group cannot be computed now: the previous result is kept
-