<commit_before># CA APM MONGODB COLLECTOR

1. [DESCRIPTION](#description)
1. [PLATFORMS, PREREQUISITES, AND DEPENDENCIES](#deps)
1. [CHANGELOG](#changes)
1. [INSTALLATION](#install)
1. [CONFIGURATION](#config)
1. [CONTRIBUTING AND DEVELOPMENT](#dev)
1. [LICENSE](#license)

## <a name="description"></a>DESCRIPTION
The CA APM MongoDB Collector (hereafter Collector) extracts performance metrics from one or more MongoDB instances and send them to an APM Enterprise Manager via EPAgent.  It utilizes the RESTful API for EPAgent.

In addition to the Collector program, this bundle also contains example dashboards for display of MongoDB metrics in CA APM.  Screenshots can be found on the [repo wiki](https://github.com/CA-APM/ca-apm-fieldpack-mongodb/wiki).

The Collector can run on any machine (java enabled).  It makes client connections to configured MongoDB instances and retrieves all metrics available via [serverStatus](http://docs.mongodb.org/manual/reference/command/serverStatus/).  Metrics are then forwarded to a CA APM EPAgent via RESTful API.

## <a name="deps"></a>PLATFORMS, PREREQUISITES, AND DEPENDENCIES

This extension requires the following:

- All CA APM versions should work.  There are no version dependencies.

- CA APM EPAgent v9.7.1 or later (with REST interface).  The EPAgent can be running on any machine with an accessible HTTP listener.

- The ca-apm-fieldpack-mongodb program is self-contained except for a dependency on the
   - [Java MongoDB Driver](http://docs.mongodb.org/ecosystem/drivers/java/)
   - [google-gson](https://code.google.com/p/google-gson/)
  
- MongoDB versions supporting [serverStatus](http://docs.mongodb.org/manual/reference/command/serverStatus/) should work.  The Collector was built, tested, and certified against MongoDB v2.6.
 
## <a name="changes"></a>CHANGELOG

Please review the **CHANGELOG.md** file in this repository

## <a name="install"></a>INSTALLATION


### Running the Collector

With an appropriate property file and the mongo client jar, run the
program as follows:

`java -cp ca-apm-fieldpack-mongodb-1.0.jar:mongo-java-driver-2.12.3.jar:gson-2.2.4.jar
com.ca.apm.mongo.Collector <your-propfile>.props`

### Example Dashboard Setup

In order to view the example dashboards, you need to install a management module
and a calculator on a CA APM Enterprise Manager. To install:

* copy ./dashboard/MongoDB_MgtModule.jar <EM install path>/config/modules
* copy ./dashboard/MongoDBMemoryLeak.js <EM install path>/scripts

## <a name="config"></a>CONFIGURATION

All configuration of the Collector program is via property file -- *examples.props* for details.

##<a name="dev"></a>CONTRIBUTING AND DEVELOPMENT

If you plan to contribute changes, you need to read the **CONTRIBUTING.md** file in this repository for details on how to collaborate.

Development details follow:

### Builds

The repo includes a *pom.xml* for building via maven. A typical maven
build would be:
`mvn clean package`

This will resolve external dependencies, build source and test<commit_msg>Updated wording around dependent jars<commit_after># CA APM MONGODB COLLECTOR

1. [DESCRIPTION](#description)
1. [PLATFORMS, PREREQUISITES, AND DEPENDENCIES](#deps)
1. [CHANGELOG](#changes)
1. [INSTALLATION](#install)
1. [CONFIGURATION](#config)
1. [CONTRIBUTING AND DEVELOPMENT](#dev)
1. [LICENSE](#license)

## <a name="description"></a>DESCRIPTION
The CA APM MongoDB Collector (hereafter Collector) extracts performance metrics from one or more MongoDB instances and send them to an APM Enterprise Manager via EPAgent.  It utilizes the RESTful API for EPAgent.

In addition to the Collector program, this bundle also contains example dashboards for display of MongoDB metrics in CA APM.  Screenshots can be found on the [repo wiki](https://github.com/CA-APM/ca-apm-fieldpack-mongodb/wiki).

The Collector can run on any machine (java enabled).  It makes client connections to configured MongoDB instances and retrieves all metrics available via [serverStatus](http://docs.mongodb.org/manual/reference/command/serverStatus/).  Metrics are then forwarded to a CA APM EPAgent via RESTful API.

## <a name="deps"></a>PLATFORMS, PREREQUISITES, AND DEPENDENCIES

This extension requires the following:

- All CA APM versions should work.  There are no version dependencies.

- CA APM EPAgent v9.7.1 or later (with REST interface).  The EPAgent can be running on any machine with an accessible HTTP listener.

- The ca-apm-fieldpack-mongodb program is self-contained except for a dependency on the
   - [Java MongoDB Driver](http://docs.mongodb.org/ecosystem/drivers/java/)
   - [google-gson](https://code.google.com/p/google-gson/)
  
- MongoDB versions supporting [serverStatus](http://docs.mongodb.org/manual/reference/command/serverStatus/) should work.  The Collector was built, tested, and certified against MongoDB v2.6.
 
## <a name="changes"></a>CHANGELOG

Please review the **CHANGELOG.md** file in this repository

## <a name="install"></a>INSTALLATION


### Running the Collector

With an appropriate property file and the dependent jars, run the
program as follows:

`java -cp ca-apm-fieldpack-mongodb-1.0.jar:mongo-java-driver-2.12.3.jar:gson-2.2.4.jar
com.ca.apm.mongo.Collector <your-propfile>.props`

### Example Dashboard Setup

In order to view the example dashboards, you need to install a management module
and a calculator on a CA APM Enterprise Manager. To install:

* copy ./dashboard/MongoDB_MgtModule.jar <EM install path>/config/modules
* copy ./dashboard/MongoDBMemoryLeak.js <EM install path>/scripts

## <a name="config"></a>CONFIGURATION

All configuration of the Collector program is via property file -- *examples.props* for details.

##<a name="dev"></a>CONTRIBUTING AND DEVELOPMENT

If you plan to contribute changes, you need to read the **CONTRIBUTING.md** file in this repository for details on how to collaborate.

Development details follow:

### Builds

The repo includes a *pom.xml* for building via maven. A typical maven
build would be:
`mvn clean package`

This will resolve external dependencies, build source and test
{'fraction_non_alphanumeric': 0.09937684486716956, 'fraction_numerical': 0.006887504099704822, 'mean_word_length': 4.732142857142857, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2525008', 'n_tokens_mistral': 1900, 'n_tokens_neox': 1808, 'n_words': 686}