Class HTTPStatistics

java.lang.Object
org.deltava.beans.stats.HTTPStatistics
All Implemented Interfaces:
Serializable, Comparable<HTTPStatistics>

public class HTTPStatistics extends Object implements Serializable, Comparable<HTTPStatistics>
A class for storing daily HTTP server statistics.
Since:
1.0
Version:
7.0
Author:
Luke
See Also:
  • Constructor Details

    • HTTPStatistics

      public HTTPStatistics(Instant dt)
      Create a new Statistics entry for a particular date.
      Parameters:
      dt - the Date
      See Also:
  • Method Details

    • getDate

      public Instant getDate()
      Returns the date of these HTTP statistics.
      Returns:
      the Date of the statistics
    • getRequests

      public int getRequests()
      Returns the number of HTTP requests.
      Returns:
      the number of requests
      See Also:
    • getHomePageHits

      public int getHomePageHits()
      Returns the number of Home Page HTTP requests.
      Returns:
      the number of home page requests
      See Also:
    • getExecutionTime

      public long getExecutionTime()
      Returns the total time serving requests.
      Returns:
      the time in milliseconds
      See Also:
    • getBackEndTime

      public long getBackEndTime()
      Returns the total time executing database operations.
      Returns:
      the time in milliseconds
      See Also:
    • getBandwidth

      public long getBandwidth()
      Returns the total number of bytes served.
      Returns:
      the number of bytes served
      See Also:
    • setRequests

      public void setRequests(int reqs)
      Updates the number of HTTP requests.
      Parameters:
      reqs - the total number of requests
      See Also:
    • setHomePageHits

      public void setHomePageHits(int hits)
      Updates the number of home page HTTP requests.
      Parameters:
      hits - the number of home page requests
      See Also:
    • setExecutionTime

      public void setExecutionTime(long time)
      Updates the total serving time.
      Parameters:
      time - the total time serving requests in milliseconds
      See Also:
    • setBackEndTime

      public void setBackEndTime(long time)
      Updates the total database time.
      Parameters:
      time - the total database execution time in milliseconds
      See Also:
    • setBandwidth

      public void setBandwidth(long bytes)
      Updates the total bandwidth used.
      Parameters:
      bytes - the number of bytes served
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(HTTPStatistics s2)
      Compares two statistics objects by comparing their date.
      Specified by:
      compareTo in interface Comparable<HTTPStatistics>