Skip to content

Commit

Permalink
Merge pull request #565 from hawkular/relativetime_release
Browse files Browse the repository at this point in the history
Add support for relative timestamps.
  • Loading branch information
jsanda committed Aug 10, 2016
2 parents c9ef05f + 0998bf9 commit f3b65f3
Show file tree
Hide file tree
Showing 13 changed files with 345 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ public class QueryRequest {

private List<String> ids;

private Long start;
private String start;

private Long end;
private String end;

private Integer limit;

Expand All @@ -41,19 +41,19 @@ public void setIds(List<String> ids) {
this.ids = ids;
}

public Long getStart() {
public String getStart() {
return start;
}

public void setStart(Long start) {
public void setStart(String start) {
this.start = start;
}

public Long getEnd() {
public String getEnd() {
return end;
}

public void setEnd(Long end) {
public void setEnd(String end) {
this.end = end;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public class StatsQueryRequest {

private Map<String, List<String>> metrics = new HashMap<>();

private Long start;
private String start;

private Long end;
private String end;

private Integer buckets;

Expand All @@ -53,19 +53,19 @@ public void setMetrics(Map<String, List<String>> metrics) {
this.metrics = metrics;
}

public Long getStart() {
public String getStart() {
return start;
}

public void setStart(Long start) {
public void setStart(String start) {
this.start = start;
}

public Long getEnd() {
public String getEnd() {
return end;
}

public void setEnd(Long end) {
public void setEnd(String end) {
this.end = end;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,8 @@ public void deprecatedAddAvailabilityData(
public void deprecatedFindAvailabilityData(
@Suspended AsyncResponse asyncResponse,
@PathParam("id") String id,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") Long start,
@ApiParam(value = "Defaults to now") @QueryParam("end") Long end,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") String start,
@ApiParam(value = "Defaults to now") @QueryParam("end") String end,
@ApiParam(value = "Total number of buckets") @QueryParam("buckets") Integer bucketsCount,
@ApiParam(value = "Bucket duration") @QueryParam("bucketDuration") Duration bucketDuration,
@ApiParam(value = "Set to true to return only distinct, contiguous values")
Expand Down Expand Up @@ -388,8 +388,8 @@ public void deprecatedFindAvailabilityData(
public void getMetricData(
@Suspended AsyncResponse asyncResponse,
@PathParam("id") String id,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") Long start,
@ApiParam(value = "Defaults to now") @QueryParam("end") Long end,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") String start,
@ApiParam(value = "Defaults to now") @QueryParam("end") String end,
@ApiParam(value = "Set to true to return only distinct, contiguous values")
@QueryParam("distinct") @DefaultValue("false") Boolean distinct,
@ApiParam(value = "Limit the number of data points returned") @QueryParam("limit") Integer limit,
Expand Down Expand Up @@ -435,8 +435,8 @@ public void getMetricData(
public void getMetricStats(
@Suspended AsyncResponse asyncResponse,
@PathParam("id") String id,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") Long start,
@ApiParam(value = "Defaults to now") @QueryParam("end") Long end,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") String start,
@ApiParam(value = "Defaults to now") @QueryParam("end") String end,
@ApiParam(value = "Total number of buckets") @QueryParam("buckets") Integer bucketsCount,
@ApiParam(value = "Bucket duration") @QueryParam("bucketDuration") Duration bucketDuration) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ public void deprecatedAddData(
public void deprecatedFindCounterData(
@Suspended AsyncResponse asyncResponse,
@PathParam("id") String id,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") Long start,
@ApiParam(value = "Defaults to now") @QueryParam("end") Long end,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") String start,
@ApiParam(value = "Defaults to now") @QueryParam("end") String end,
@ApiParam(value = "Use data from earliest received, subject to retention period")
@QueryParam("fromEarliest") Boolean fromEarliest,
@ApiParam(value = "Total number of buckets") @QueryParam("buckets") Integer bucketsCount,
Expand Down Expand Up @@ -459,8 +459,8 @@ public void deprecatedFindCounterData(
public void getMetricData(
@Suspended AsyncResponse asyncResponse,
@PathParam("id") String id,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") Long start,
@ApiParam(value = "Defaults to now") @QueryParam("end") Long end,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") String start,
@ApiParam(value = "Defaults to now") @QueryParam("end") String end,
@ApiParam(value = "Use data from earliest received, subject to retention period")
@QueryParam("fromEarliest") Boolean fromEarliest,
@ApiParam(value = "Limit the number of data points returned") @QueryParam("limit") Integer limit,
Expand Down Expand Up @@ -504,8 +504,8 @@ public void getMetricData(
public void getMetricStats(
@Suspended AsyncResponse asyncResponse,
@PathParam("id") String id,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") Long start,
@ApiParam(value = "Defaults to now") @QueryParam("end") Long end,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") String start,
@ApiParam(value = "Defaults to now") @QueryParam("end") String end,
@ApiParam(value = "Use data from earliest received, subject to retention period")
@QueryParam("fromEarliest") Boolean fromEarliest,
@ApiParam(value = "Total number of buckets") @QueryParam("buckets") Integer bucketsCount,
Expand Down Expand Up @@ -599,8 +599,8 @@ public void getMetricStats(
public void getMetricRate(
@Suspended AsyncResponse asyncResponse,
@PathParam("id") String id,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") Long start,
@ApiParam(value = "Defaults to now") @QueryParam("end") Long end,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") String start,
@ApiParam(value = "Defaults to now") @QueryParam("end") String end,
@ApiParam(value = "Limit the number of data points returned") @QueryParam("limit") Integer limit,
@ApiParam(value = "Data point sort order, based on timestamp") @QueryParam("order") Order order,
@Deprecated @ApiParam(value = "Total number of buckets") @QueryParam("buckets") Integer bucketsCount,
Expand Down Expand Up @@ -670,8 +670,8 @@ public void getMetricRate(
public void getMetricStatsRate(
@Suspended AsyncResponse asyncResponse,
@PathParam("id") String id,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") Long start,
@ApiParam(value = "Defaults to now") @QueryParam("end") Long end,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") String start,
@ApiParam(value = "Defaults to now") @QueryParam("end") String end,
@ApiParam(value = "Total number of buckets") @QueryParam("buckets") Integer bucketsCount,
@ApiParam(value = "Bucket duration") @QueryParam("bucketDuration") Duration bucketDuration,
@ApiParam(value = "Percentiles to calculate") @QueryParam("percentiles") Percentiles percentiles
Expand Down Expand Up @@ -723,8 +723,8 @@ public void getMetricStatsRate(
response = ApiError.class) })
public void getStats(
@Suspended AsyncResponse asyncResponse,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") final Long start,
@ApiParam(value = "Defaults to now") @QueryParam("end") final Long end,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") final String start,
@ApiParam(value = "Defaults to now") @QueryParam("end") final String end,
@ApiParam(value = "Total number of buckets") @QueryParam("buckets") Integer bucketsCount,
@ApiParam(value = "Bucket duration") @QueryParam("bucketDuration") Duration bucketDuration,
@ApiParam(value = "Percentiles to calculate") @QueryParam("percentiles") Percentiles percentiles,
Expand Down Expand Up @@ -781,8 +781,8 @@ public void getStats(
response = NumericBucketPoint.class, responseContainer = "List")
public void deprecatedFindCounterDataStats(
@Suspended AsyncResponse asyncResponse,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") final Long start,
@ApiParam(value = "Defaults to now") @QueryParam("end") final Long end,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") final String start,
@ApiParam(value = "Defaults to now") @QueryParam("end") final String end,
@ApiParam(value = "Total number of buckets") @QueryParam("buckets") Integer bucketsCount,
@ApiParam(value = "Bucket duration") @QueryParam("bucketDuration") Duration bucketDuration,
@ApiParam(value = "Percentiles to calculate") @QueryParam("percentiles") Percentiles percentiles,
Expand Down Expand Up @@ -810,8 +810,8 @@ public void deprecatedFindCounterDataStats(
response = ApiError.class) })
public void getRateStats(
@Suspended AsyncResponse asyncResponse,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") final Long start,
@ApiParam(value = "Defaults to now") @QueryParam("end") final Long end,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") final String start,
@ApiParam(value = "Defaults to now") @QueryParam("end") final String end,
@ApiParam(value = "Total number of buckets") @QueryParam("buckets") Integer bucketsCount,
@ApiParam(value = "Bucket duration") @QueryParam("bucketDuration") Duration bucketDuration,
@ApiParam(value = "Percentiles to calculate") @QueryParam("percentiles") Percentiles percentiles,
Expand Down Expand Up @@ -868,8 +868,8 @@ public void getRateStats(
response = NumericBucketPoint.class, responseContainer = "List")
public void deprecatedFindCounterRateDataStats(
@Suspended AsyncResponse asyncResponse,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") final Long start,
@ApiParam(value = "Defaults to now") @QueryParam("end") final Long end,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") final String start,
@ApiParam(value = "Defaults to now") @QueryParam("end") final String end,
@ApiParam(value = "Total number of buckets") @QueryParam("buckets") Integer bucketsCount,
@ApiParam(value = "Bucket duration") @QueryParam("bucketDuration") Duration bucketDuration,
@ApiParam(value = "Percentiles to calculate") @QueryParam("percentiles") Percentiles percentiles,
Expand Down Expand Up @@ -897,8 +897,8 @@ public void deprecatedFindCounterRateDataStats(
public void getMetricStatsByTags(
@Suspended AsyncResponse asyncResponse,
@PathParam("id") String id,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") Long start,
@ApiParam(value = "Defaults to now") @QueryParam("end") Long end,
@ApiParam(value = "Defaults to now - 8 hours") @QueryParam("start") String start,
@ApiParam(value = "Defaults to now") @QueryParam("end") String end,
@ApiParam(value = "Percentiles to calculate") @QueryParam("percentiles") Percentiles percentiles,
@ApiParam(value = "Tags") @PathParam("tags") Tags tags
) {
Expand Down

0 comments on commit f3b65f3

Please sign in to comment.