<commit_before># Dropwizard Metrics listener for Pushy

This module is an implementation of Pushy's [`ApnsClientMetricsListener`](http://relayrides.github.io/pushy/apidocs/0.7/com/relayrides/pushy/apns/ApnsClientMetricsListener.html) interface that uses the [Dropwizard Metrics library](http://metrics.dropwizard.io/) to gather and report metrics. If you use [Maven](http://maven.apache.org/), you can add the listener to your project by adding the following dependency declaration to your POM:

```xml
<dependency>
    <groupId>com.relayrides</groupId>
    <artifactId>pushy-dropwizard-metrics-listener</artifactId>
    <version>0.7.3</version>
</dependency>
```

If you don't use Maven, you can add the `.jar` file and its dependencies to your classpath by the method of your choice. The Dropwizard Metrics listener for Pushy depends on Pushy itself (obviously enough) and version 3.1.0 of the [Dropwizard Metrics library](http://metrics.dropwizard.io/).

## Using the Dropwizard Metrics listener

Creating new Dropwizard Metrics listeners is straightforward. To get started, construct a new listener and pass it in when constructing a new client.

```java
final DropwizardApnsClientMetricsListener listener =
    new DropwizardApnsClientMetricsListener();

final ApnsClient<SimpleApnsPushNotification> apnsClient =
    new ApnsClientBuilder<SimpleApnsPushNotification>()
        .setClientCredentials(new File("/path/to/certificate.p12"), "<PASSWORD>")
        .setMetricsListener(listener)<commit_msg>Updated the README for the Dropwizard metrics listener.<commit_after># Dropwizard Metrics listener for Pushy

This module is an implementation of Pushy's [`ApnsClientMetricsListener`](http://relayrides.github.io/pushy/apidocs/0.10/com/relayrides/pushy/apns/ApnsClientMetricsListener.html) interface that uses the [Dropwizard Metrics library](http://metrics.dropwizard.io/) to gather and report metrics. If you use [Maven](http://maven.apache.org/), you can add the listener to your project by adding the following dependency declaration to your POM:

```xml
<dependency>
    <groupId>com.turo</groupId>
    <artifactId>pushy-dropwizard-metrics-listener</artifactId>
    <version>0.10</version>
</dependency>
```

If you don't use Maven, you can add the `.jar` file and its dependencies to your classpath by the method of your choice. The Dropwizard Metrics listener for Pushy depends on Pushy itself (obviously enough) and version 3.1.0 of the [Dropwizard Metrics library](http://metrics.dropwizard.io/).

## Using the Dropwizard Metrics listener

Creating new Dropwizard Metrics listeners is straightforward. To get started, construct a new listener and pass it in when constructing a new client.

```java
final DropwizardApnsClientMetricsListener listener =
    new DropwizardApnsClientMetricsListener();

final ApnsClient<SimpleApnsPushNotification> apnsClient =
    new ApnsClientBuilder<SimpleApnsPushNotification>()
        .setClientCredentials(new File("/path/to/certificate.p12"), "p12-file-password")
        .setMetricsListener(listener)
{'fraction_non_alphanumeric': 0.09171306911234851, 'fraction_numerical': 0.0075335735342286275, 'mean_word_length': 5.283950617283951, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4250604', 'n_tokens_mistral': 889, 'n_tokens_neox': 858, 'n_words': 284}