<commit_before>.. 
.. Copyright 2015 Comcast Cable Communications Management, LLC
.. 
.. Licensed under the Apache License, Version 2.0 (the "License");
.. you may not use this file except in compliance with the License.
.. You may obtain a copy of the License at
.. 
..     http://www.apache.org/licenses/LICENSE-2.0
.. 
.. Unless required by applicable law or agreed to in writing, software
.. distributed under the License is distributed on an "AS IS" BASIS,
.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
.. See the License for the specific language governing permissions and
.. limitations under the License.
.. 

Traffic Monitor
***************
Introduction
============
Traffic Monitor is a Java Tomcat application that...  

Software Requirements
=====================
To work on Traffic Monitor you need a \*nix (MacOS and Linux are most commonly used) environment that has the following installed:

* ?
* Maven ?.??

Traffic Monitor Project Tree Overview
=====================================

Java Formatting Conventions 
===========================

Installing The Developer Environment
====================================
To install the Traffic Ops Developer environment:

1. Clone the traffic_control repository using Git.

Test Cases
==========
The test harness ... 

API
===

:ref:`reference-tm-api`

.. toctree:: 
  :hidden:
  :maxdepth: 1
<commit_msg>Updated developer documentation for traffic_monitor.<commit_after>.. 
.. Copyright 2015 Comcast Cable Communications Management, LLC
.. 
.. Licensed under the Apache License, Version 2.0 (the "License");
.. you may not use this file except in compliance with the License.
.. You may obtain a copy of the License at
.. 
..     http://www.apache.org/licenses/LICENSE-2.0
.. 
.. Unless required by applicable law or agreed to in writing, software
.. distributed under the License is distributed on an "AS IS" BASIS,
.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
.. See the License for the specific language governing permissions and
.. limitations under the License.
.. 

Traffic Monitor
***************
Introduction
============
Traffic Monitor is a Java Tomcat application that monitors caches, provides health state information to Traffic Router, and collects statistics for use in tools such as Traffic Ops and Traffic Stats.  The health state provided by Traffic Monitor is used by Traffic Router to control which caches are available on the CDN.

Software Requirements
=====================
To work on Traffic Monitor you need a \*nix (MacOS and Linux are most commonly used) environment that has the following installed:

* Eclipse >= Kepler SR2 (or another Java IDE)
* Maven >= 3.3.1
* JDK >= 6.0

Traffic Monitor Project Tree Overview
=====================================

Java Formatting Conventions 
===========================
None at this time.  The codebase will eventually be formatted per Java standards.

Installing The Developer Environment
====================================
To install the Traffic Ops Developer environment:

1. Clone the traffic_control repository using Git.
2. Edit the following parameters in src/test/resources/conf/traffic_monitor_config.js:

+-----------------+--------------------------------------------------+
|    Parameter    |                      Value                       |
+=================+==================================================+
| ``tm.hostname`` | FQDN of the Traffic Ops instance.                |
+-----------------+--------------------------------------------------+
| ``tm.username`` | Admin username for Traffic Ops                   |
+-----------------+--------------------------------------------------+
| ``tm.password`` | <PASSWORD>                          |
+-----------------+--------------------------------------------------+
| ``cdnName``     | Name of the CDN this Traffic Router will monitor |
+-----------------+--------------------------------------------------+

3. Import the existing git repo into Eclipse:

	a. File -> Import -> Git -> Projects from Git; Next
	b. Existing local repository; Next
	c. Add -> browse to find traffic_control; Add
	d. Select traffic_control; Next
	e. Ensure "Import existing projects" is selected, expand traffic_control, select traffic_monitor; Next
	f. Ensure traffic_monitor is checked; Finish


Test Cases
==========
Unit tests can be executed using Maven by running ``mvn test`` at the root of the traffic_monitor project.

API
===

:ref:`reference-tm-api`

.. toctree:: 
  :hidden:
  :maxdepth: 1

{'fraction_non_alphanumeric': 0.2220026350461133, 'fraction_numerical': 0.006148440931049627, 'mean_word_length': 2.7366694011484825, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4218703', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1011, 'n_words': 488}