Skip to content

Commit

Permalink
One more iteration for replacing numeric with gauge.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Negrea committed Apr 21, 2015
1 parent af77279 commit e6a9be1
Show file tree
Hide file tree
Showing 42 changed files with 581 additions and 584 deletions.
36 changes: 18 additions & 18 deletions api/metrics-api-jaxrs/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ POST /hawkular/metrics/tenants
{
"id": "com.acme.eng",
"retentions": {
"numeric": 100,
"gauge": 100,
"availability": 80
}
}
Expand All @@ -50,7 +50,7 @@ operations, like this one, it is specified in the request body.

`retentions` is like a template that specifies data retentions for metrics. The
values are integers and are interpreted as hours. For this example request body,
all numeric metric data will have a data retention of 100 hours by default.
all gauge metric data will have a data retention of 100 hours by default.
Availability metric data will have a data retention of 80 hours by defatult.

NOTE: Clients are not required to create explicitly create a tenant before
Expand Down Expand Up @@ -79,7 +79,7 @@ curl http://localhost:8080/hawkular/metrics/tenants
{
"id": "com.acme.eng",
"retentions": {
"numeric": 100,
"gauge": 100,
"availability": 80
}
},
Expand All @@ -96,11 +96,11 @@ Returns a list of tenants. Notice that the second object does not include a

== Metrics

=== Create Numeric Metric
=== Create Gauge Metric

*Request URI*

POST /hawkular/metrics/{tenantId}/numeric
POST /hawkular/metrics/{tenantId}/gauge

*Request Body*

Expand All @@ -119,12 +119,12 @@ POST /hawkular/metrics/{tenantId}/numeric
*Example Request*

----
curl http://localhost:8080/hawkular/metrics/{tenantId}/numeric -d@request.json -HContent-Type:application/json
curl http://localhost:8080/hawkular/metrics/{tenantId}/gauge -d@request.json -HContent-Type:application/json
----

*Description*

Creates a numeric metric. Only the `name` property is required. An error is
Creates a gauge metric. Only the `name` property is required. An error is
returned if a metric with `name` already exists. `metadata` is map of arbitary
key/value pairs that applies to the time series as a whole. The `dataRetention`
property specifies the data retention in hours and overrides the data retention
Expand All @@ -148,7 +148,7 @@ curl http://localhost:8080/hawkular/metrics/{tenantId}/availability -d@request.j

*Description*

The request body is the same as creating a numeric metric.
The request body is the same as creating a gauge metric.


=== Find Metrics
Expand All @@ -163,14 +163,14 @@ GET /hawkular/metrics/{tenantId}/metrics
|Name |Description

|type
|Accepted values are `num` and `avail`
|Accepted values are `gauge` and `avail`

|===

*Example Request*

----
curl http://localhost:8080/hawkular/metrics/{tenantId}/metrics?type=guage
curl http://localhost:8080/hawkular/metrics/{tenantId}/metrics?type=gauge
----

*Response Body*
Expand Down Expand Up @@ -201,7 +201,7 @@ Returns a list of metrics. The results do *not* include metric data points. The

*Request URI*

PUT /hawkular/metrics/{tenantId}/numeric/{id}/meta
PUT /hawkular/metrics/{tenantId}/gauge/{id}/meta

*Request Body*

Expand All @@ -226,11 +226,11 @@ either created or overwritten.

== Metric Data

=== Add Numeric Data for a Single Metric
=== Add Gauge Data for a Single Metric

*Request URI*

POST /hawkular/metrics/{tenantId}/numeric/{id}/data
POST /hawkular/metrics/{tenantId}/gauge/{id}/data

*Request Body*

Expand All @@ -246,12 +246,12 @@ POST /hawkular/metrics/{tenantId}/numeric/{id}/data
*Example Request*

----
curl -X POST http://localhost:8080/hawkular/metrics/{tenantId}/numeric/{id}/data -d@request.json -HContent-Type:application/json
curl -X POST http://localhost:8080/hawkular/metrics/{tenantId}/gauge/{id}/data -d@request.json -HContent-Type:application/json
----

*Description*

Inserts data for a single numeric metric. The request body is an array of data
Inserts data for a single gauge metric. The request body is an array of data
points where each one consists of `timestamp` and `value` properties.

=== Add Availability Data for a Single Metric
Expand Down Expand Up @@ -357,11 +357,11 @@ curl -X POST http://localhost:8080/hawkular/metrics/{tenantId}/availability/data

Insert data for multiple availability metrics.

=== Retrieve Numeric data
=== Retrieve Gauge data

*Request URI*

GET /hawkular/metrics/{tenantId}/numeric/{id}/data
GET /hawkular/metrics/{tenantId}/gauge/{id}/data

*Request Parameters*

Expand All @@ -384,7 +384,7 @@ start and end times, having max/min/avg calculated for each bucket.
*Example Request*

----
curl http://localhost:8080/hawkular/metrics/{tenantId}/numeric/{id}/data?start=1416857688195&end=1416857688195 -d@request.json -HContent-Type:application/json
curl http://localhost:8080/hawkular/metrics/{tenantId}/gauge/{id}/data?start=1416857688195&end=1416857688195 -d@request.json -HContent-Type:application/json
----

*Response Body*
Expand Down

0 comments on commit e6a9be1

Please sign in to comment.