Class GreetingStatistics

java.lang.Object
org.gcube.service.helloworld.statistics.GreetingStatistics
All Implemented Interfaces:
org.gcube.common.health.api.Statistics

public class GreetingStatistics extends Object implements org.gcube.common.health.api.Statistics
An example of a group of public statistics of a service: SmartGears finds the class by its annotation, computes it every refresh() on a thread of its own and serves the last result, with no token, at /smartgears/<service>/statistics. A real service computes here the figures of its domain, aggregate numbers only, e.g. by querying its backend.
Author:
Luca Frosini (ISTI-CNR)
  • Constructor Details

    • GreetingStatistics

      public GreetingStatistics()
  • Method Details

    • greeted

      public static void greeted()
      Counts one greeting.
    • id

      public String id()
      Specified by:
      id in interface org.gcube.common.health.api.Statistics
    • title

      public String title()
      Specified by:
      title in interface org.gcube.common.health.api.Statistics
    • description

      public String description()
      Specified by:
      description in interface org.gcube.common.health.api.Statistics
    • refresh

      public Duration refresh()
      Computed again every five minutes instead of the default thirty: it costs nothing.
      Specified by:
      refresh in interface org.gcube.common.health.api.Statistics
    • compute

      public List<org.gcube.common.health.api.Figure> compute()
      Specified by:
      compute in interface org.gcube.common.health.api.Statistics