net.i2p.router

## Class JobStats

- java.lang.Object
- - net.i2p.router.JobStats

-     public class JobStats
      extends Object

  Collects and maintains statistical data for job execution performance. Tracks run counts, execution times, drop rates, and pending time metrics for job queue monitoring and optimization. Public for router console only. For use by the router only. Not to be used by applications or plugins.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JobStats(String name)` Create statistics tracker for a named job type.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `getAvgPendingTime()` Get the average pending/wait time for this job type.
    `double` | `getAvgTime()` Get the average execution time for this job type.
    `long` | `getDropped()` Get the number of jobs that were dropped.
    `long` | `getMaxPendingTime()` Get the maximum pending/wait time for a single run of this job type.
    `long` | `getMaxTime()` Get the maximum execution time for a single run of this job type.
    `long` | `getMinPendingTime()` Get the minimum pending/wait time for a single run of this job type.
    `long` | `getMinTime()` Get the minimum execution time for a single run of this job type.
    `String` | `getName()` Get the name of this job type.
    `long` | `getRuns()` Get the total number of times this job type has run.
    `long` | `getTotalPendingTime()` Get the total pending/wait time for all runs of this job type.
    `long` | `getTotalTime()` Get the total execution time for all runs of this job type.
    `void` | `jobDropped()` Record that a job of this type was dropped due to overload.
    `void` | `jobRan(long runTime, long lag)` Record that a job of this type has executed.

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

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

- - ### Constructor Detail

    - #### JobStats

          public JobStats(String name)

      Create statistics tracker for a named job type.
      Parameters:
        `name` - the name identifier for this job type

  - ### Method Detail

    - #### getAvgPendingTime

          public double getAvgPendingTime()

      Get the average pending/wait time for this job type.
      Returns:
        average pending time in milliseconds per run, or 0 if never run

    - #### getAvgTime

          public double getAvgTime()

      Get the average execution time for this job type.
      Returns:
        average time in milliseconds per run, or 0 if never run

    - #### getDropped

          public long getDropped()

      Get the number of jobs that were dropped.
      Returns:
        the count of dropped jobs

    - #### getMaxPendingTime

          public long getMaxPendingTime()

      Get the maximum pending/wait time for a single run of this job type.
      Returns:
        maximum pending time in milliseconds, or -1 if never run

    - #### getMaxTime

          public long getMaxTime()

      Get the maximum execution time for a single run of this job type.
      Returns:
        maximum time in milliseconds, or -1 if never run

    - #### getMinPendingTime

          public long getMinPendingTime()

      Get the minimum pending/wait time for a single run of this job type.
      Returns:
        minimum pending time in milliseconds, or -1 if never run

    - #### getMinTime

          public long getMinTime()

      Get the minimum execution time for a single run of this job type.
      Returns:
        minimum time in milliseconds, or -1 if never run

    - #### getName

          public String getName()

      Get the name of this job type.
      Returns:
        the job name

    - #### getRuns

          public long getRuns()

      Get the total number of times this job type has run.
      Returns:
        the run count

    - #### getTotalPendingTime

          public long getTotalPendingTime()

      Get the total pending/wait time for all runs of this job type.
      Returns:
        total pending time in milliseconds

    - #### getTotalTime

          public long getTotalTime()

      Get the total execution time for all runs of this job type.
      Returns:
        total time in milliseconds

    - #### jobDropped

          public void jobDropped()

      Record that a job of this type was dropped due to overload.

    - #### jobRan

          public void jobRan(long runTime,
                             long lag)

      Record that a job of this type has executed.
      Parameters:
        `runTime` - the time in milliseconds the job took to execute
        `lag` - the time in milliseconds the job spent waiting in the queue