@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
hash = (19 * hash) + getDescriptor().hashCode(); if (hasMetric()) { hash = (37 * hash) + METRIC_FIELD_NUMBER; hash = (53 * hash) + getMetric().hashCode(); if (hasResource()) { hash = (37 * hash) + RESOURCE_FIELD_NUMBER; hash = (53 * hash) + getResource().hashCode(); if (hasMetadata()) { hash = (37 * hash) + METADATA_FIELD_NUMBER; hash = (53 * hash) + getMetadata().hashCode(); hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; hash = (53 * hash) + valueType_; if (getPointsCount() > 0) { hash = (37 * hash) + POINTS_FIELD_NUMBER; hash = (53 * hash) + getPointsList().hashCode();
@java.lang.Override public com.google.monitoring.v3.TimeSeries buildPartial() { com.google.monitoring.v3.TimeSeries result = new com.google.monitoring.v3.TimeSeries(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0;
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.TimeSeries)) { return super.equals(obj); } com.google.monitoring.v3.TimeSeries other = (com.google.monitoring.v3.TimeSeries) obj; boolean result = true; result = result && (hasMetric() == other.hasMetric()); if (hasMetric()) { result = result && getMetric().equals(other.getMetric()); } result = result && (hasResource() == other.hasResource()); if (hasResource()) { result = result && getResource().equals(other.getResource()); } result = result && (hasMetadata() == other.hasMetadata()); if (hasMetadata()) { result = result && getMetadata().equals(other.getMetadata()); } result = result && metricKind_ == other.metricKind_; result = result && valueType_ == other.valueType_; result = result && getPointsList().equals(other.getPointsList()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (metric_ != null) { output.writeMessage(1, getMetric()); } if (resource_ != null) { output.writeMessage(2, getResource()); } if (metricKind_ != com.google.api.MetricDescriptor.MetricKind.METRIC_KIND_UNSPECIFIED.getNumber()) { output.writeEnum(3, metricKind_); } if (valueType_ != com.google.api.MetricDescriptor.ValueType.VALUE_TYPE_UNSPECIFIED.getNumber()) { output.writeEnum(4, valueType_); } for (int i = 0; i < points_.size(); i++) { output.writeMessage(5, points_.get(i)); } if (metadata_ != null) { output.writeMessage(7, getMetadata()); } unknownFields.writeTo(output); }
public Builder mergeFrom(com.google.monitoring.v3.TimeSeries other) { if (other == com.google.monitoring.v3.TimeSeries.getDefaultInstance()) return this; if (other.hasMetric()) { mergeMetric(other.getMetric()); if (other.hasResource()) { mergeResource(other.getResource()); if (other.hasMetadata()) { mergeMetadata(other.getMetadata()); setMetricKindValue(other.getMetricKindValue()); setValueTypeValue(other.getValueTypeValue());
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasMetric()) { hash = (37 * hash) + METRIC_FIELD_NUMBER; hash = (53 * hash) + getMetric().hashCode(); } if (hasResource()) { hash = (37 * hash) + RESOURCE_FIELD_NUMBER; hash = (53 * hash) + getResource().hashCode(); } hash = (37 * hash) + METRIC_KIND_FIELD_NUMBER; hash = (53 * hash) + metricKind_; hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; hash = (53 * hash) + valueType_; if (getPointsCount() > 0) { hash = (37 * hash) + POINTS_FIELD_NUMBER; hash = (53 * hash) + getPointsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public Builder mergeFrom(com.google.monitoring.v3.TimeSeries other) { if (other == com.google.monitoring.v3.TimeSeries.getDefaultInstance()) return this; if (other.hasMetric()) { mergeMetric(other.getMetric()); if (other.hasResource()) { mergeResource(other.getResource()); setMetricKindValue(other.getMetricKindValue()); setValueTypeValue(other.getValueTypeValue());
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.TimeSeries)) { return super.equals(obj); } com.google.monitoring.v3.TimeSeries other = (com.google.monitoring.v3.TimeSeries) obj; boolean result = true; result = result && (hasMetric() == other.hasMetric()); if (hasMetric()) { result = result && getMetric() .equals(other.getMetric()); } result = result && (hasResource() == other.hasResource()); if (hasResource()) { result = result && getResource() .equals(other.getResource()); } result = result && metricKind_ == other.metricKind_; result = result && valueType_ == other.valueType_; result = result && getPointsList() .equals(other.getPointsList()); return result; }
@java.lang.Override public com.google.monitoring.v3.TimeSeries getDefaultInstanceForType() { return com.google.monitoring.v3.TimeSeries.getDefaultInstance(); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (metric_ != null) { output.writeMessage(1, getMetric()); } if (resource_ != null) { output.writeMessage(2, getResource()); } if (metricKind_ != com.google.api.MetricDescriptor.MetricKind.METRIC_KIND_UNSPECIFIED.getNumber()) { output.writeEnum(3, metricKind_); } if (valueType_ != com.google.api.MetricDescriptor.ValueType.VALUE_TYPE_UNSPECIFIED.getNumber()) { output.writeEnum(4, valueType_); } for (int i = 0; i < points_.size(); i++) { output.writeMessage(5, points_.get(i)); } }
@Test public void createTimeSeriesList_Distribution() { List<TimeSeries> timeSeriesList = StackdriverExportUtils.createTimeSeriesList( DISTRIBUTION_METRIC, DEFAULT_RESOURCE, CUSTOM_OPENCENSUS_DOMAIN); assertThat(timeSeriesList.size()).isEqualTo(1); TimeSeries timeSeries = timeSeriesList.get(0); assertThat(timeSeries.getPointsCount()).isEqualTo(1); assertThat(timeSeries.getPoints(0).getValue().getDistributionValue()) .isEqualTo( com.google.api.Distribution.newBuilder() .setCount(3) .setMean(0.6666666666666666) .setBucketOptions( BucketOptions.newBuilder() .setExplicitBuckets( Explicit.newBuilder() .addAllBounds(Arrays.asList(0.0, 1.0, 3.0, 5.0)) .build()) .build()) .addAllBucketCounts(Arrays.asList(0L, 3L, 1L, 2L, 4L)) .setSumOfSquaredDeviation(14) .build()); }
/** * Retrieves the latest value for the metric defined by {@link #CPU_METRIC}. * @return * @throws IOException */ Point getLatestValue() throws IOException { // [START get_bigtable_cpu] Timestamp now = timeXMinutesAgo(0); Timestamp fiveMinutesAgo = timeXMinutesAgo(5); TimeInterval interval = TimeInterval.newBuilder().setStartTime(fiveMinutesAgo).setEndTime(now).build(); String filter = "metric.type=\"" + CPU_METRIC + "\""; ListTimeSeriesPagedResponse response = metricServiceClient.listTimeSeries(projectName, filter, interval, TimeSeriesView.FULL); return response.getPage().getValues().iterator().next().getPointsList().get(0); // [END get_bigtable_cpu] }
/** * * * <pre> * The associated metric. A fully-specified metric used to identify the time * series. * </pre> * * <code>.google.api.Metric metric = 1;</code> */ public com.google.api.MetricOrBuilder getMetricOrBuilder() { return getMetric(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.CreateTimeSeriesError)) { return super.equals(obj); } com.google.monitoring.v3.CreateTimeSeriesError other = (com.google.monitoring.v3.CreateTimeSeriesError) obj; boolean result = true; result = result && (hasTimeSeries() == other.hasTimeSeries()); if (hasTimeSeries()) { result = result && getTimeSeries().equals(other.getTimeSeries()); } result = result && (hasStatus() == other.hasStatus()); if (hasStatus()) { result = result && getStatus().equals(other.getStatus()); } result = result && unknownFields.equals(other.unknownFields); return result; }
/** * * * <pre> * The time series, including the `Metric`, `MonitoredResource`, * and `Point`s (including timestamp and value) that resulted * in the error. This field provides all of the context that * would be needed to retry the operation. * </pre> * * <code>.google.monitoring.v3.TimeSeries time_series = 1;</code> */ public com.google.monitoring.v3.TimeSeries getTimeSeries() { return timeSeries_ == null ? com.google.monitoring.v3.TimeSeries.getDefaultInstance() : timeSeries_; } /**
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (metric_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getMetric()); } if (resource_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getResource()); } if (metricKind_ != com.google.api.MetricDescriptor.MetricKind.METRIC_KIND_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, metricKind_); } if (valueType_ != com.google.api.MetricDescriptor.ValueType.VALUE_TYPE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, valueType_); } for (int i = 0; i < points_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, points_.get(i)); } if (metadata_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getMetadata()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (metric_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getMetric()); } if (resource_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getResource()); } if (metricKind_ != com.google.api.MetricDescriptor.MetricKind.METRIC_KIND_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(3, metricKind_); } if (valueType_ != com.google.api.MetricDescriptor.ValueType.VALUE_TYPE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream .computeEnumSize(4, valueType_); } for (int i = 0; i < points_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(5, points_.get(i)); } memoizedSize = size; return size; }
/** * <pre> * The associated metric. A fully-specified metric used to identify the time * series. * </pre> * * <code>optional .google.api.Metric metric = 1;</code> */ public com.google.api.MetricOrBuilder getMetricOrBuilder() { return getMetric(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.CreateTimeSeriesError)) { return super.equals(obj); } com.google.monitoring.v3.CreateTimeSeriesError other = (com.google.monitoring.v3.CreateTimeSeriesError) obj; boolean result = true; result = result && (hasTimeSeries() == other.hasTimeSeries()); if (hasTimeSeries()) { result = result && getTimeSeries() .equals(other.getTimeSeries()); } result = result && (hasStatus() == other.hasStatus()); if (hasStatus()) { result = result && getStatus() .equals(other.getStatus()); } return result; }