Interface StructureStatisticsRecorder


@Internal public interface StructureStatisticsRecorder
  • Method Details

    • addUniqueUserCountAsync

      void addUniqueUserCountAsync(@NotNull String feature)
      Counts that the current logged-in user has used the specified feature. The resulting statistic will be the average amount of unique feature users per day.

      You may also want to count the average total amount of feature usages per day via addTotalCountAsync(String). Don't use the same feature ID for both total and unique user counts.

      The "async" part in the method name means that this object aggregates statistics and writes them to the backend in bulk.

    • addTotalCountAsync

      void addTotalCountAsync(@NotNull String feature)
      Counts that the specified feature was used. The resulting statistic will be the average amount of times the feature is used per day.

      You may also want to count the average total amount of feature usages per day via addUniqueUserCountAsync(String). Don't use the same feature ID for both total and unique user counts.

      The "async" part in the method name means that this object aggregates statistics and writes them to the backend in bulk.

    • addTotalCountAsync

      void addTotalCountAsync(@NotNull String stat, double value)
      Adds the specified value to the specified statistic. The resulting statistic will be the average sum of recorded values per day. This sum, or "count", is "total" in the sense that it does not account for the distribution of these values on users.

      The "async" part in the method name means that this object aggregates statistics and writes them to the backend in bulk.

    • addToIntValueDistrAsync

      void addToIntValueDistrAsync(@NotNull String statPrefix, int value, @NotNull int... bins)
      Adds 1 to the statistics with the ID equal to statPrefix.<bin>, where bin is the least element of the bins array greater than value or "inf" if all of the elements are less than value.

      In other words, if there are n bins b_0, ... b_{n-1}, this method adds 1 to one of the n + 1 statistics, which correspond to these intervals:

      statistic statPrefix.b_0 statPrefix.b_1 ... statPrefix.b_{n-1} statPrefix.inf
      interval (-\inf, b_0] (b_0 b_1] ... (b_{n-2} b_{n-1}] (b_{n-1}, \inf)

      The resulting statistics sharing statPrefix contain the distribution of the measured integer value over the specified bins, averaged per day.

      The "async" part in the method name means that this object aggregates statistics and writes them to the backend in bulk.

    • addStatisticSource

      void addStatisticSource(StatisticSource source)
      Adds statistic source which is queried periodically for the statistic data
      Parameters:
      source - source to register
    • removeStatisticSource

      void removeStatisticSource(StatisticSource source)
      Removes statistic source which was previously registered
      Parameters:
      source - source to unregister
    • addTotalCountAndActiveUserAsync

      void addTotalCountAndActiveUserAsync(@NotNull String feature)
      Adds 1 to use count for feature (like addTotalCountAsync(String)) and adds the current user to activeUser.<feature> (like addUniqueUserCountAsync(String)).