<commit_before>== Servlet that exposes a rest endpoint to add / retrive data

Example input as JSON
[source,json]
----
{
 "id":"foo",
 "timestamp":1234,
 "value":12.3
}
----

Example input as XML
[source,xml]
----
<idDataPoint>
  <id>foo</id>
  <timestamp>1234</timestamp>
  <value>12.3</value>
</idDataPoint>
----

=== Add data

Endpoint is http://localhost:8080/rhq-metrics/{id}

  $ curl -i -X POST http://localhost:8080/rhq-metrics/ -d@/tmp/fooX -HContent-Type:application/xml

or if the input contains a collection of metrics

  $ curl -i -X POST http://localhost:8080/rhq-metrics -d@/tmp/fooX -HContent-Type:application/xml

=== Retrieve data

Endpoint is http://localhost:8080/rest/metric/values/{id}

  $ curl -i http://localhost:8080/rest/metric/values/foo?start=0\&end=2000 -HAccept:application/json

or simply

  $ curl -i http://localhost:8080/rest/metric/values/foo

to receive data for the last 8 hours

Parameters are:

* start: defaults to now-8h
* end: defaults to now

=== List metric names

  $  curl -i http://localhost:8080/rest/metric/list -HAccept:application/json

=== Running

run `mvn install` to create the servlet and then drop it into a WildFly 8
instance into `standalone/deploy/` and start the server with `bin/standalone.sh`<commit_msg>Update endpoint info<commit_after>== Servlet that exposes a rest endpoint to add / retrive data

Example input as JSON
[source,json]
----
{
 "id":"foo",
 "timestamp":1234,
 "value":12.3
}
----

Example input as XML
[source,xml]
----
<idDataPoint>
  <id>foo</id>
  <timestamp>1234</timestamp>
  <value>12.3</value>
</idDataPoint>
----

=== Add data

Endpoint is http://localhost:8080/rhq-metrics/{id}/data for a single data item

  $ curl -i -X POST http://localhost:8080/rhq-metrics/ -d@/tmp/fooX -HContent-Type:application/xml

or if the input contains a collection of metrics

  $ curl -i -X POST http://localhost:8080/rhq-metrics -d@/tmp/fooX -HContent-Type:application/xml

=== Retrieve data

Endpoint is http://localhost:8080/rhq-metric/{id}/data

  $ curl -i http://localhost:8080/rhq-metric/foo/data?start=0\&end=2000 -HAccept:application/json

or simply

  $ curl -i http://localhost:8080/rhq-metric/values/foo

to receive data for the last 8 hours

Parameters are:

* start: defaults to now-8h
* end: defaults to now

=== List metric names

  $  curl -i http://localhost:8080/rhq-metric/list -HAccept:application/json

=== Running

run `mvn install` to create the servlet and then drop it into a WildFly 8
instance into `standalone/deploy/` and start the server with `bin/standalone.sh`
{'fraction_non_alphanumeric': 0.1463129145532579, 'fraction_numerical': 0.03901677721420211, 'mean_word_length': 3.7393715341959335, 'pattern_counts': {'":': 6, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '6240686', 'n_tokens_mistral': 938, 'n_tokens_neox': 849, 'n_words': 248}