Class MeasurementsRestService


  • @Component
    @Scope("prototype")
    public class MeasurementsRestService
    extends Object
    The Measurements API provides read-only access to values persisted by the collectors. Measurements are referenced by combination of resource id and attribute name. Calculations may then be performed on these measurements using JEXL expressions. Units of time, including timestamps are expressed in milliseconds. This API is designed to be similar to the one provided by Newts.
    Author:
    Jesse White , Dustin Frisch
    • Constructor Detail

      • MeasurementsRestService

        public MeasurementsRestService()
    • Method Detail

      • simpleQuery

        @Transactional(readOnly=true)
        public QueryResponse simpleQuery​(String resourceId,
                                         String attribute,
                                         long start,
                                         long end,
                                         long step,
                                         int maxrows,
                                         String fallbackAttribute,
                                         String aggregation,
                                         boolean relaxed)
        Retrieves the measurements for a single attribute.
      • query

        @Transactional(readOnly=true)
        public QueryResponse query​(QueryRequest request)
        Retrieves the measurements of many resources and performs arbitrary calculations on these. This a read-only query, however we use a POST instead of GET since the request parameters are difficult to express in a query string.
      • getException

        protected static javax.ws.rs.WebApplicationException getException​(javax.ws.rs.core.Response.Status status,
                                                                          String msg,
                                                                          Object... params)
                                                                   throws javax.ws.rs.WebApplicationException
        Throws:
        javax.ws.rs.WebApplicationException
      • getException

        protected static javax.ws.rs.WebApplicationException getException​(javax.ws.rs.core.Response.Status status,
                                                                          Throwable t,
                                                                          String msg,
                                                                          Object... params)
                                                                   throws javax.ws.rs.WebApplicationException
        Throws:
        javax.ws.rs.WebApplicationException