<commit_before>========
Usage
========

To use Django Health Monitor in a project, there are three main steps:

1. Set up API endpoint to handle test result updates.
2. Create scoring logic to give test results relative weighting of significance.
3. Customize notification filters. (optional)


Set Up API
----------

The following steps with create an API with the following endpoints, where <uid>
is a unique identifier for the asset that is being tracked. The unique identifier
must be an integer. The <subscriber> tag is a required attribute that must be attached
to a test allowing unique combinations of tests. This will be described in the next section.

<start_time> and <end_time> must be passed in UTC and in the format
``'%Y-%m-%dT%H:%M:%SZ'``.

health/<uid>/read/
health/<uid>/history/<subscriber>/?start_time=<start_time>&end_time=<end_time>
health/<uid>/update/


1. Run ``python manage.py migrate health_monitor``

2. Add url routes.

Inside of ``urls.py`` add the following routes::

    from health_monitor import views as health_monitor_views

    urlpatterns = [
        ...
        url(r'^(?P<uid>[\w-]*)/$', health_monitor_views.read, name='read'),
        url(r'^(?P<uid>[\w-]*)/history/(?P<subscriber>[\w-]*)/$', health_monitor_views.history, name='history'),
        url(r'^(?P<uid>[\w-]*)/update/(?P<test_name>[\w-]*)/$', health_monitor_views.update, name='update'),
        ...
    ]


Create Scoring Logic
--------------------

TODO


Customize Notification Filters
------------------------------
<commit_msg>Update docs.<commit_after>========
Usage
========

To use Django Health Monitor in a project, there are three main steps:

1. Set up API endpoint to handle test result updates.
2. Configure scoring logic to give test results relative weighting of significance.
3. Customize notification filters. (optional)


Set Up API
----------

The following steps with create an API with the following endpoints, where <uid>
is a unique identifier for the asset that is being tracked. The unique identifier
must be an integer. The <subscriber> tag is a required attribute that must be attached
to a test allowing unique combinations of tests. This will be described in the next section.

<start_time> and <end_time> must be passed in UTC and in the format
``'%Y-%m-%dT%H:%M:%SZ'``.

- health/<uid>/read/
- health/<uid>/history/<subscriber>/?start_time=<start_time>&end_time=<end_time>
- health/<uid>/update/


1. Run ``python manage.py migrate health_monitor`` to create a new table to track
health instances.

2. Add url routes.

Inside of ``urls.py`` add the following routes::

    from health_monitor import views as health_monitor_views

    urlpatterns = [
        ...
        url(r'^health/(?P<uid>[\w-]*)/$', health_monitor_views.read, name='read'),
        url(r'^health/(?P<uid>[\w-]*)/history/(?P<subscriber>[\w-]*)/$', health_monitor_views.history, name='history'),
        url(r'^health/(?P<uid>[\w-]*)/update/(?P<test_name>[\w-]*)/$', health_monitor_views.update, name='update'),
        ...
    ]


Configure Scoring Logic
-----------------------

TODO


Customize Notification Filters
------------------------------

{'fraction_non_alphanumeric': 0.1714195183776933, 'fraction_numerical': 0.0031685678073510772, 'mean_word_length': 3.3305898491083674, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1918256', 'n_tokens_mistral': 958, 'n_tokens_neox': 918, 'n_words': 328}