edu.ucsb.nceas.metacat

## Class MetacatProfiler

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

-     public class MetacatProfiler
      extends java.lang.Object

  Author:
    berkley Singleton to track metacat profile stats and print them to a CSV file

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `MetacatProfiler.Profile` container class for profile information

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static MetacatProfiler` | `getInstance()` get a singleton instance
    `java.util.Hashtable<java.lang.String,MetacatProfiler.Profile>` | `getProfiles()` return a hashtable of the profiles
    `void` | `printCSV(java.io.File f)` print the CSV file with no sorting
    `void` | `printLogMsg(java.lang.String msg)` print a message to the log in real-time
    `void` | `printSortedCSV(java.io.File f, java.lang.String sortKey)` print a sorted CSV file.
    `void` | `reset()` reset all times in the singleton
    `MetacatProfiler.Profile[]` | `sortProfiles(java.lang.String sortKey)` sort the profiles by "callorder", "callcount" or "total"
    `void` | `startTime(java.lang.String profileName)` start the timing on a profile
    `void` | `stopTime(java.lang.String profileName)` stop the timing on a profile

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getInstance

          public static MetacatProfiler getInstance()

      get a singleton instance
      Returns:

    - #### getProfiles

          public java.util.Hashtable<java.lang.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(java.lang.String msg)

      print a message to the log in real-time
      Parameters:
        `msg` -

    - #### startTime

          public void startTime(java.lang.String profileName)

      start the timing on a profile
      Parameters:
        `profileName` -

    - #### stopTime

          public void stopTime(java.lang.String profileName)

      stop the timing on a profile
      Parameters:
        `profileName` -

    - #### sortProfiles

          public MetacatProfiler.Profile[] sortProfiles(java.lang.String sortKey)

      sort the profiles by "callorder", "callcount" or "total"
      Parameters:
        `sortKey` -
      Returns:

    - #### printSortedCSV

          public void printSortedCSV(java.io.File f,
                                     java.lang.String sortKey)
                              throws java.io.IOException

      print a sorted CSV file. The sortKey can be "callorder", "callcount" or "total"
      Parameters:
        `f` -
        `sortKey` -
      Throws:
        `java.io.IOException`

    - #### printCSV

          public void printCSV(java.io.File f)
                        throws java.io.IOException

      print the CSV file with no sorting
      Parameters:
        `f` -
      Throws:
        `java.io.IOException`

Copyright © 2020 Regents of the University of California. All Rights Reserved.