Examples of CounterResource


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

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

  @Override
  protected CounterResource instantiateResource(Counter entity) {
    return new CounterResource(entity.getName(), entity.getValue());
  }
View Full Code Here

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

  @CliCommand(value = DISPLAY_COUNTER, help = "Display the value of a counter")
  public String display(
      @CliOption(key = { "", "name" }, help = "the name of the counter to display", mandatory = true, optionContext = "existing-counter disable-string-converter") String name,
      @CliOption(key = "pattern", help = "the pattern used to format the value (see DecimalFormat)", mandatory = false, unspecifiedDefaultValue = NumberFormatConverter.DEFAULT) NumberFormat pattern) {
    CounterResource counter = counterOperations().retrieve(name);

    return pattern.format(counter.getValue());
  }
View Full Code Here

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

   * @return the count associated with the name.
   */
  public static long getCount(final URL adminServer, final String name) {
    Assert.notNull(adminServer, "The admin server must be specified.");
    Assert.hasText(name, "The name must not be empty nor null");
    CounterResource resource = createSpringXDTemplate(adminServer).
        counterOperations().retrieve(name);
    return resource.getValue();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.