Class MetacatProfiler

java.lang.Object
edu.ucsb.nceas.metacat.MetacatProfiler

public class MetacatProfiler extends Object
Author:
berkley Singleton to track metacat profile stats and print them to a CSV file
  • Method Details

    • getInstance

      public static MetacatProfiler getInstance()
      get a singleton instance
      Returns:
    • getProfiles

      public Hashtable<String,MetacatProfiler.Profile> getProfiles()
      return a hashtable of the profiles
      Returns:
    • reset

      public void reset()
      reset all times in the singleton
    • printLogMsg

      public void printLogMsg(String msg)
      print a message to the log in real-time
      Parameters:
      msg -
    • startTime

      public void startTime(String profileName)
      start the timing on a profile
      Parameters:
      profileName -
    • stopTime

      public void stopTime(String profileName)
      stop the timing on a profile
      Parameters:
      profileName -
    • sortProfiles

      public MetacatProfiler.Profile[] sortProfiles(String sortKey)
      sort the profiles by "callorder", "callcount" or "total"
      Parameters:
      sortKey -
      Returns:
    • printSortedCSV

      public void printSortedCSV(File f, String sortKey) throws IOException
      print a sorted CSV file. The sortKey can be "callorder", "callcount" or "total"
      Parameters:
      f -
      sortKey -
      Throws:
      IOException
    • printCSV

      public void printCSV(File f) throws IOException
      print the CSV file with no sorting
      Parameters:
      f -
      Throws:
      IOException