Class StandardTelemetryDatabase

java.lang.Object
com.pnfsoftware.jeb.client.telemetry.StandardTelemetryDatabase
All Implemented Interfaces:
ITelemetryDatabase

public class StandardTelemetryDatabase extends Object implements ITelemetryDatabase
Standard telemetry database for JEB clients.
  • Constructor Details

    • StandardTelemetryDatabase

      public StandardTelemetryDatabase(String dbpath, ITelemetryEndpoint endpoint) throws IOException, TelemetryException
      Create a new or open an existing JEB telemetry database. Default dump period: 5 minutes. The dumper thread is not started.
      Parameters:
      dbpath - database path
      endpoint - the telemetry endpoint to submit the telemetry logs
      Throws:
      IOException
      TelemetryException
    • StandardTelemetryDatabase

      public StandardTelemetryDatabase(String dbpath, ITelemetryEndpoint endpoint, boolean startDumperThread) throws IOException, TelemetryException
      Create a new or open an existing JEB telemetry database. Default dump period: 5 minutes.
      Parameters:
      dbpath - database path
      endpoint - the telemetry endpoint to submit the telemetry logs
      startDumperThread -
      Throws:
      IOException
      TelemetryException
  • Method Details

    • startDumperThread

      public void startDumperThread()
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • close

      public void close() throws TelemetryException
      Description copied from interface: ITelemetryDatabase
      Close the telemetry database.
      Specified by:
      close in interface ITelemetryDatabase
      Throws:
      TelemetryException
    • setDumpPeriod

      public void setDumpPeriod(int dumpPeriodSeconds)
    • getDumpPeriod

      public int getDumpPeriod()
    • setPurgeThreshold

      public void setPurgeThreshold(int purgeThreshold)
    • getPurgeThreshold

      public int getPurgeThreshold()
    • record

      public boolean record(String eventName)
      Description copied from interface: ITelemetryDatabase
      Convenience method. Record a telemetry event without properties.
      Specified by:
      record in interface ITelemetryDatabase
      Returns:
    • record

      public boolean record(String eventName, String key0, String value0)
      Description copied from interface: ITelemetryDatabase
      Convenience method. Record a telemetry event with a single property.
      Specified by:
      record in interface ITelemetryDatabase
      Returns:
    • record

      public boolean record(String eventName, String key0, String value0, String key1, String value1)
      Description copied from interface: ITelemetryDatabase
      Convenience method. Record a telemetry event with two properties.
      Specified by:
      record in interface ITelemetryDatabase
      Returns:
    • record

      public boolean record(String eventName, Map<String,String> properties)
      Description copied from interface: ITelemetryDatabase
      Record a telemetry event with some properties. This method should never throw and should execute as quickly as possible.
      Specified by:
      record in interface ITelemetryDatabase
      Returns:
    • size

      public int size()
    • clear

      public boolean clear()
    • dump

      public boolean dump()
      Dump the database records to an endpoint. Called from separate thread. Do not perform network operations when locking on this object, otherwise normal ops (dump, etc.) will unnecessarily be delayed.
      Returns: