Package org.springframework.xd.rest.domain.metrics

Examples of org.springframework.xd.rest.domain.metrics.AggregateCountsResource


    return createResourceWithId(entity.getName(), entity);
  }

  @Override
  protected AggregateCountsResource instantiateResource(AggregateCount entity) {
    AggregateCountsResource result = new AggregateCountsResource(entity.getName());
    ReadablePeriod increment = entity.getResolution().unitPeriod;
    DateTime end = entity.getInterval().getEnd();
    int i = 0;
    for (DateTime when = entity.getInterval().getStart(); !when.isAfter(end); when = when.plus(increment)) {
      result.addValue(new Date(when.getMillis()), entity.getCounts()[i++]);
    }
    return result;
  }
View Full Code Here


          fromDate = null;
          break;
      }

      Date toDate = (to == null) ? null : dateFormat.parse(to);
      AggregateCountsResource aggResource = aggrCounterOperations().retrieve(name, fromDate, toDate, resolution);
      return displayAggrCounter(aggResource, pattern);
    }
    catch (ParseException pe) {
      throw new IllegalArgumentException(
          "Parse exception ocurred while parsing the 'from/to' options. The accepted date format is "
View Full Code Here

TOP

Related Classes of org.springframework.xd.rest.domain.metrics.AggregateCountsResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.