Class MeasurementsRestService


  • @Component
    @Scope("prototype")
    public class MeasurementsRestService
    extends java.lang.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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static javax.ws.rs.WebApplicationException getException​(javax.ws.rs.core.Response.Status status, java.lang.String msg, java.lang.Object... params)  
      protected static javax.ws.rs.WebApplicationException getException​(javax.ws.rs.core.Response.Status status, java.lang.Throwable t, java.lang.String msg, java.lang.Object... params)  
      java.util.List<FilterMetaData> getFilterMetadata()  
      FilterMetaData getFilterMetadata​(java.lang.String name)  
      QueryResponse query​(QueryRequest request)
      Retrieves the measurements of many resources and performs arbitrary calculations on these.
      QueryResponse simpleQuery​(java.lang.String resourceId, java.lang.String attribute, long start, long end, long step, int maxrows, java.lang.String fallbackAttribute, java.lang.String aggregation, boolean relaxed)
      Retrieves the measurements for a single attribute.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MeasurementsRestService

        public MeasurementsRestService()
    • Method Detail

      • getFilterMetadata

        public java.util.List<FilterMetaData> getFilterMetadata()
      • getFilterMetadata

        public FilterMetaData getFilterMetadata​(java.lang.String name)
      • simpleQuery

        @Transactional(readOnly=true)
        public QueryResponse simpleQuery​(java.lang.String resourceId,
                                         java.lang.String attribute,
                                         long start,
                                         long end,
                                         long step,
                                         int maxrows,
                                         java.lang.String fallbackAttribute,
                                         java.lang.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,
                                                                          java.lang.String msg,
                                                                          java.lang.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,
                                                                          java.lang.Throwable t,
                                                                          java.lang.String msg,
                                                                          java.lang.Object... params)
                                                                   throws javax.ws.rs.WebApplicationException
        Throws:
        javax.ws.rs.WebApplicationException