com.intellectualcrafters.plot.util

## Class Metrics

- java.lang.Object
- - com.intellectualcrafters.plot.util.Metrics

-     public class Metrics
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Metrics.Graph` Represents a custom graph on the website
    `static class` | `Metrics.Plotter` Interface used to collect custom data for a plugin

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Metrics(org.bukkit.plugin.Plugin plugin)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addGraph(Metrics.Graph graph)` Add a Graph object to BukkitMetrics that represents data for the plugin that should be sent to the backend
    `Metrics.Graph` | `createGraph(java.lang.String name)` Construct and create a Graph that can be used to separate specific plotters to their own graphs on the metrics website.
    `void` | `disable()` Disables metrics for the server by setting "opt-out" to true in the config file and canceling the metrics task.
    `void` | `enable()` Enables metrics for the server by setting "opt-out" to false in the config file and starting the metrics task.
    `java.io.File` | `getConfigFile()` Gets the File object of the config file that should be used to store data such as the GUID and opt-out status
    `static byte[]` | `gzip(java.lang.String input)` GZip compress a string of bytes
    `boolean` | `isOptOut()` Has the server owner denied plugin metrics?
    `boolean` | `start()` Start measuring statistics.

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

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

- - ### Constructor Detail

    - #### Metrics

          public Metrics(org.bukkit.plugin.Plugin plugin)
                  throws java.io.IOException

      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### gzip

          public static byte[] gzip(java.lang.String input)

      GZip compress a string of bytes
      Parameters:
        `input` -
      Returns:

    - #### createGraph

          public Metrics.Graph createGraph(java.lang.String name)

      Construct and create a Graph that can be used to separate specific plotters to their own graphs on the metrics website. Plotters can be added to the graph object returned.
      Parameters:
        `name` - The name of the graph
      Returns:
        Graph object created. Will never return NULL under normal circumstances unless bad parameters are given

    - #### addGraph

          public void addGraph(Metrics.Graph graph)

      Add a Graph object to BukkitMetrics that represents data for the plugin that should be sent to the backend
      Parameters:
        `graph` - The name of the graph

    - #### start

          public boolean start()

      Start measuring statistics. This will immediately create an async repeating task as the plugin and send the initial data to the metrics backend, and then after that it will post in increments of PING_INTERVAL * 1200 ticks.
      Returns:
        True if statistics measuring is running, otherwise false.

    - #### isOptOut

          public boolean isOptOut()

      Has the server owner denied plugin metrics?
      Returns:
        true if metrics should be opted out of it

    - #### enable

          public void enable()
                      throws java.io.IOException

      Enables metrics for the server by setting "opt-out" to false in the config file and starting the metrics task.
      Throws:
        `java.io.IOException`

    - #### disable

          public void disable()
                       throws java.io.IOException

      Disables metrics for the server by setting "opt-out" to true in the config file and canceling the metrics task.
      Throws:
        `java.io.IOException`

    - #### getConfigFile

          public java.io.File getConfigFile()

      Gets the File object of the config file that should be used to store data such as the GUID and opt-out status
      Returns:
        the File object for the config file