congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MetricDatum.statisticValues
Code IndexAdd Tabnine to your IDE (free)

How to use
statisticValues
method
in
software.amazon.awssdk.services.cloudwatch.model.MetricDatum

Best Java code snippets using software.amazon.awssdk.services.cloudwatch.model.MetricDatum.statisticValues (Showing top 14 results out of 315)

origin: aws/aws-sdk-java-v2

/**
 * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
 * redacted from this string using a placeholder value.
 */
@Override
public String toString() {
  return ToString.builder("MetricDatum").add("MetricName", metricName()).add("Dimensions", dimensions())
      .add("Timestamp", timestamp()).add("Value", value()).add("StatisticValues", statisticValues())
      .add("Values", values()).add("Counts", counts()).add("Unit", unitAsString())
      .add("StorageResolution", storageResolution()).build();
}
origin: software.amazon.awssdk/cloudwatch

/**
 * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
 * redacted from this string using a placeholder value.
 */
@Override
public String toString() {
  return ToString.builder("MetricDatum").add("MetricName", metricName()).add("Dimensions", dimensions())
      .add("Timestamp", timestamp()).add("Value", value()).add("StatisticValues", statisticValues())
      .add("Values", values()).add("Counts", counts()).add("Unit", unitAsString())
      .add("StorageResolution", storageResolution()).build();
}
origin: aws/aws-sdk-java-v2

@Override
public int hashCode() {
  int hashCode = 1;
  hashCode = 31 * hashCode + Objects.hashCode(metricName());
  hashCode = 31 * hashCode + Objects.hashCode(dimensions());
  hashCode = 31 * hashCode + Objects.hashCode(timestamp());
  hashCode = 31 * hashCode + Objects.hashCode(value());
  hashCode = 31 * hashCode + Objects.hashCode(statisticValues());
  hashCode = 31 * hashCode + Objects.hashCode(values());
  hashCode = 31 * hashCode + Objects.hashCode(counts());
  hashCode = 31 * hashCode + Objects.hashCode(unitAsString());
  hashCode = 31 * hashCode + Objects.hashCode(storageResolution());
  return hashCode;
}
origin: aws/aws-sdk-java-v2

public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
  switch (fieldName) {
  case "MetricName":
    return Optional.ofNullable(clazz.cast(metricName()));
  case "Dimensions":
    return Optional.ofNullable(clazz.cast(dimensions()));
  case "Timestamp":
    return Optional.ofNullable(clazz.cast(timestamp()));
  case "Value":
    return Optional.ofNullable(clazz.cast(value()));
  case "StatisticValues":
    return Optional.ofNullable(clazz.cast(statisticValues()));
  case "Values":
    return Optional.ofNullable(clazz.cast(values()));
  case "Counts":
    return Optional.ofNullable(clazz.cast(counts()));
  case "Unit":
    return Optional.ofNullable(clazz.cast(unitAsString()));
  case "StorageResolution":
    return Optional.ofNullable(clazz.cast(storageResolution()));
  default:
    return Optional.empty();
  }
}
origin: software.amazon.awssdk/cloudwatch

@Override
public int hashCode() {
  int hashCode = 1;
  hashCode = 31 * hashCode + Objects.hashCode(metricName());
  hashCode = 31 * hashCode + Objects.hashCode(dimensions());
  hashCode = 31 * hashCode + Objects.hashCode(timestamp());
  hashCode = 31 * hashCode + Objects.hashCode(value());
  hashCode = 31 * hashCode + Objects.hashCode(statisticValues());
  hashCode = 31 * hashCode + Objects.hashCode(values());
  hashCode = 31 * hashCode + Objects.hashCode(counts());
  hashCode = 31 * hashCode + Objects.hashCode(unitAsString());
  hashCode = 31 * hashCode + Objects.hashCode(storageResolution());
  return hashCode;
}
origin: software.amazon.awssdk/cloudwatch

public <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
  switch (fieldName) {
  case "MetricName":
    return Optional.ofNullable(clazz.cast(metricName()));
  case "Dimensions":
    return Optional.ofNullable(clazz.cast(dimensions()));
  case "Timestamp":
    return Optional.ofNullable(clazz.cast(timestamp()));
  case "Value":
    return Optional.ofNullable(clazz.cast(value()));
  case "StatisticValues":
    return Optional.ofNullable(clazz.cast(statisticValues()));
  case "Values":
    return Optional.ofNullable(clazz.cast(values()));
  case "Counts":
    return Optional.ofNullable(clazz.cast(counts()));
  case "Unit":
    return Optional.ofNullable(clazz.cast(unitAsString()));
  case "StorageResolution":
    return Optional.ofNullable(clazz.cast(storageResolution()));
  default:
    return Optional.empty();
  }
}
origin: awslabs/amazon-kinesis-client

  @Override
  public void end() {
    StringBuilder output = new StringBuilder();
    output.append("Metrics:\n");

    output.append("Dimensions: ");
    boolean needsComma = false;
    for (Dimension dimension : getDimensions()) {
      output.append(String.format("%s[%s: %s]", needsComma ? ", " : "", dimension.name(), dimension.value()));
      needsComma = true;
    }
    output.append("\n");

    for (MetricDatum datum : data.values()) {
      StatisticSet statistics = datum.statisticValues();
      output.append(String.format("Name=%25s\tMin=%.2f\tMax=%.2f\tCount=%.2f\tSum=%.2f\tAvg=%.2f\tUnit=%s\n",
          datum.metricName(),
          statistics.minimum(),
          statistics.maximum(),
          statistics.sampleCount(),
          statistics.sum(),
          statistics.sum() / statistics.sampleCount(),
          datum.unit()));
    }

    log.info(output.toString());
  }
}
origin: aws/aws-sdk-java-v2

@Override
public boolean equals(Object obj) {
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (!(obj instanceof MetricDatum)) {
    return false;
  }
  MetricDatum other = (MetricDatum) obj;
  return Objects.equals(metricName(), other.metricName()) && Objects.equals(dimensions(), other.dimensions())
      && Objects.equals(timestamp(), other.timestamp()) && Objects.equals(value(), other.value())
      && Objects.equals(statisticValues(), other.statisticValues()) && Objects.equals(values(), other.values())
      && Objects.equals(counts(), other.counts()) && Objects.equals(unitAsString(), other.unitAsString())
      && Objects.equals(storageResolution(), other.storageResolution());
}
origin: software.amazon.awssdk/cloudwatch

@Override
public boolean equals(Object obj) {
  if (this == obj) {
    return true;
  }
  if (obj == null) {
    return false;
  }
  if (!(obj instanceof MetricDatum)) {
    return false;
  }
  MetricDatum other = (MetricDatum) obj;
  return Objects.equals(metricName(), other.metricName()) && Objects.equals(dimensions(), other.dimensions())
      && Objects.equals(timestamp(), other.timestamp()) && Objects.equals(value(), other.value())
      && Objects.equals(statisticValues(), other.statisticValues()) && Objects.equals(values(), other.values())
      && Objects.equals(counts(), other.counts()) && Objects.equals(unitAsString(), other.unitAsString())
      && Objects.equals(storageResolution(), other.storageResolution());
}
origin: software.amazon.kinesis/amazon-kinesis-client

  @Override
  public void end() {
    StringBuilder output = new StringBuilder();
    output.append("Metrics:\n");

    output.append("Dimensions: ");
    boolean needsComma = false;
    for (Dimension dimension : getDimensions()) {
      output.append(String.format("%s[%s: %s]", needsComma ? ", " : "", dimension.name(), dimension.value()));
      needsComma = true;
    }
    output.append("\n");

    for (MetricDatum datum : data.values()) {
      StatisticSet statistics = datum.statisticValues();
      output.append(String.format("Name=%25s\tMin=%.2f\tMax=%.2f\tCount=%.2f\tSum=%.2f\tAvg=%.2f\tUnit=%s\n",
          datum.metricName(),
          statistics.minimum(),
          statistics.maximum(),
          statistics.sampleCount(),
          statistics.sum(),
          statistics.sum() / statistics.sampleCount(),
          datum.unit()));
    }

    log.info(output.toString());
  }
}
origin: awslabs/amazon-kinesis-client

  private void accumulate(MetricDatumWithKey<KeyType> metricDatumWithKey, MetricDatum newDatum) {
    MetricDatum oldDatum = metricDatumWithKey.datum;
    if (!oldDatum.unit().equals(newDatum.unit())) {
      throw new IllegalArgumentException("Unit mismatch for datum named " + oldDatum.metricName());
    }

    StatisticSet oldStats = oldDatum.statisticValues();
    StatisticSet newStats = newDatum.statisticValues();

    StatisticSet statisticSet = oldStats.toBuilder().sum(oldStats.sum() + newStats.sum())
        .minimum(Math.min(oldStats.minimum(), newStats.minimum()))
        .maximum(Math.max(oldStats.maximum(), newStats.maximum()))
        .sampleCount(oldStats.sampleCount() + newStats.sampleCount()).build();

    MetricDatum datum = oldDatum.toBuilder().statisticValues(statisticSet).build();
    metricDatumWithKey.datum(datum);
  }
}
origin: software.amazon.kinesis/amazon-kinesis-client

  private void accumulate(MetricDatumWithKey<KeyType> metricDatumWithKey, MetricDatum newDatum) {
    MetricDatum oldDatum = metricDatumWithKey.datum;
    if (!oldDatum.unit().equals(newDatum.unit())) {
      throw new IllegalArgumentException("Unit mismatch for datum named " + oldDatum.metricName());
    }

    StatisticSet oldStats = oldDatum.statisticValues();
    StatisticSet newStats = newDatum.statisticValues();

    StatisticSet statisticSet = oldStats.toBuilder().sum(oldStats.sum() + newStats.sum())
        .minimum(Math.min(oldStats.minimum(), newStats.minimum()))
        .maximum(Math.max(oldStats.maximum(), newStats.maximum()))
        .sampleCount(oldStats.sampleCount() + newStats.sampleCount()).build();

    MetricDatum datum = oldDatum.toBuilder().statisticValues(statisticSet).build();
    metricDatumWithKey.datum(datum);
  }
}
origin: awslabs/amazon-kinesis-client

final StatisticSet oldStatisticSet = datum.statisticValues();
final StatisticSet statisticSet = oldStatisticSet.toBuilder()
    .maximum(Math.max(value, oldStatisticSet.maximum()))
origin: software.amazon.kinesis/amazon-kinesis-client

final StatisticSet oldStatisticSet = datum.statisticValues();
final StatisticSet statisticSet = oldStatisticSet.toBuilder()
    .maximum(Math.max(value, oldStatisticSet.maximum()))
software.amazon.awssdk.services.cloudwatch.modelMetricDatumstatisticValues

Javadoc

The statistical values for the metric.

Popular methods of MetricDatum

  • builder
  • dimensions
    The dimensions associated with the metric. Attempts to modify the collection returned by this met
  • metricName
    The name of the metric.
  • <init>
  • counts
    Array of numbers that is used along with the Values array. Each number in the Count array is the n
  • storageResolution
    Valid values are 1 and 60. Setting this to 1 specifies this metric as a high-resolution metric, so
  • timestamp
    The time the metric data was received, expressed as the number of milliseconds since Jan 1, 1970 00
  • toBuilder
  • unit
    The unit of the metric. If the service returns an enum value that is not available in the current
  • unitAsString
    The unit of the metric. If the service returns an enum value that is not available in the current
  • value
    The value for the metric. Although the parameter accepts numbers of type Double, CloudWatch rejec
  • values
    Array of numbers representing the values for the metric during the period. Each unique value is lis
  • value,
  • values

Popular in Java

  • Making http requests using okhttp
  • startActivity (Activity)
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now