Class APIUsageHelper

java.lang.Object
org.deltava.beans.stats.APIUsageHelper

public class APIUsageHelper extends Object
A utility class to predict API usage.
Since:
9.0
Version:
9.0
Author:
Luke
  • Method Details

    • predictUsage

      public static APIUsage predictUsage(Collection<APIUsage> history, String name)
      Calculates predicted API usage for the rest of the month, based on prior usage.
      Parameters:
      history - a Collection of APIUsage beans
      name - the API/method name
      Returns:
      an APIUsage with the expected total/anonymous usage for the month
    • predictToday

      public static APIUsage predictToday(APIUsage u)
      Calculates today's predicted API usage.
      Parameters:
      u - an APIUsage bean with today's use
      Returns:
      an APIUsage with today's predicted use
    • getDaysLeftInMonth

      public static int getDaysLeftInMonth()
      Returns the number of days remaining in the month, including today.
      Returns:
      the number of days