@Controller @RequestMapping(value="/metrics/aggregate-counters") @ExposesResourceFor(value=AggregateCountsResource.class) public class AggregateCountersController extends java.lang.Object
AggregateCount
s.Modifier and Type | Field and Description |
---|---|
protected R |
repository |
protected org.springframework.hateoas.ResourceAssembler<M,MetricResource> |
shallowResourceAssembler |
Constructor and Description |
---|
AggregateCountersController(AggregateCounterRepository repository) |
Modifier and Type | Method and Description |
---|---|
protected void |
delete(java.lang.String name)
Deletes the metric from the repository
|
AggregateCountsResource |
display(java.lang.String name,
org.joda.time.DateTime from,
org.joda.time.DateTime to,
AggregateCountResolution resolution)
Retrieve counts for a given time interval, using some precision.
|
org.springframework.hateoas.PagedResources<? extends MetricResource> |
list(org.springframework.data.domain.Pageable pageable,
org.springframework.data.web.PagedResourcesAssembler<Counter> pagedAssembler,
boolean detailed,
org.joda.time.DateTime from,
org.joda.time.DateTime to,
AggregateCountResolution resolution)
List
AggregateCount s that match the given criteria. |
protected org.springframework.hateoas.PagedResources<? extends MetricResource> |
list(org.springframework.data.domain.Pageable pageable,
org.springframework.data.web.PagedResourcesAssembler<M> pagedAssembler,
org.springframework.hateoas.ResourceAssembler<M,? extends MetricResource> resourceAssembler)
Lists metric resources.
|
protected final R extends MetricRepository<M> repository
protected final org.springframework.hateoas.ResourceAssembler<M extends Metric,MetricResource> shallowResourceAssembler
@Autowired public AggregateCountersController(AggregateCounterRepository repository)
@ResponseBody @RequestMapping(value="", method=GET) public org.springframework.hateoas.PagedResources<? extends MetricResource> list(org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<Counter> pagedAssembler, @RequestParam(value="detailed",defaultValue="false") boolean detailed, @RequestParam(value="from",required=false)@DateTimeFormat(iso=DATE_TIME) org.joda.time.DateTime from, @RequestParam(value="to",required=false)@DateTimeFormat(iso=DATE_TIME) org.joda.time.DateTime to, @RequestParam(value="resolution",defaultValue="hour") AggregateCountResolution resolution)
AggregateCount
s that match the given criteria.@ResponseBody @RequestMapping(value="/{name}", method=GET, produces="application/json") public AggregateCountsResource display(@PathVariable(value="name") java.lang.String name, @RequestParam(value="from",required=false)@DateTimeFormat(iso=DATE_TIME) org.joda.time.DateTime from, @RequestParam(value="to",required=false)@DateTimeFormat(iso=DATE_TIME) org.joda.time.DateTime to, @RequestParam(value="resolution",defaultValue="hour") AggregateCountResolution resolution)
name
- the name of the aggregate counter we want to retrieve data fromfrom
- the start-time for the interval, default depends on the resolution (e.g. go back 1 day for hourly
buckets)to
- the end-time for the interval, default "now"resolution
- the size of buckets to aggregate, e.g. hourly, daily, etc. (default "hour")protected org.springframework.hateoas.PagedResources<? extends MetricResource> list(org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<M> pagedAssembler, org.springframework.hateoas.ResourceAssembler<M,? extends MetricResource> resourceAssembler)
pageable
- the PageablepagedAssembler
- the PagedResourcesAssemblerresourceAssembler
- the ResourceAssembler@RequestMapping(value="/{name}", method=DELETE) @ResponseStatus(value=OK) protected void delete(@PathVariable(value="name") java.lang.String name)
name
- the name of the metric to delete