/** * * * <pre> * The value of the data point. * </pre> * * <code>.google.monitoring.v3.TypedValue value = 2;</code> */ public com.google.monitoring.v3.TypedValueOrBuilder getValueOrBuilder() { return getValue(); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (interval_ != null) { output.writeMessage(1, getInterval()); } if (value_ != null) { output.writeMessage(2, getValue()); } unknownFields.writeTo(output); }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (interval_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getInterval()); } if (value_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getValue()); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasInterval()) { hash = (37 * hash) + INTERVAL_FIELD_NUMBER; hash = (53 * hash) + getInterval().hashCode(); } if (hasValue()) { hash = (37 * hash) + VALUE_FIELD_NUMBER; hash = (53 * hash) + getValue().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.Point)) { return super.equals(obj); } com.google.monitoring.v3.Point other = (com.google.monitoring.v3.Point) obj; boolean result = true; result = result && (hasInterval() == other.hasInterval()); if (hasInterval()) { result = result && getInterval().equals(other.getInterval()); } result = result && (hasValue() == other.hasValue()); if (hasValue()) { result = result && getValue().equals(other.getValue()); } result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.google.monitoring.v3.Point other) { if (other == com.google.monitoring.v3.Point.getDefaultInstance()) return this; if (other.hasInterval()) { mergeInterval(other.getInterval()); } if (other.hasValue()) { mergeValue(other.getValue()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * <pre> * The value of the data point. * </pre> * * <code>optional .google.monitoring.v3.TypedValue value = 2;</code> */ public com.google.monitoring.v3.TypedValueOrBuilder getValueOrBuilder() { return getValue(); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (interval_ != null) { output.writeMessage(1, getInterval()); } if (value_ != null) { output.writeMessage(2, getValue()); } }
public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (interval_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getInterval()); } if (value_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getValue()); } memoizedSize = size; return size; }
@Override public void run() { try { // [START scale_bigtable] double latestValue = getLatestValue().getValue().getDoubleValue(); if (latestValue < CPU_PERCENT_TO_DOWNSCALE) { int clusterSize = clusterUtility.getClusterNodeCount(clusterId, zoneId); if (clusterSize > MIN_NODE_COUNT) { clusterUtility.setClusterSize(clusterId, zoneId, Math.max(clusterSize - SIZE_CHANGE_STEP, MIN_NODE_COUNT)); } } else if (latestValue > CPU_PERCENT_TO_UPSCALE) { int clusterSize = clusterUtility.getClusterNodeCount(clusterId, zoneId); if (clusterSize <= MAX_NODE_COUNT) { clusterUtility.setClusterSize(clusterId, zoneId, Math.min(clusterSize + SIZE_CHANGE_STEP, MAX_NODE_COUNT)); } } // [END scale_bigtable] } catch (Exception e) { e.printStackTrace(); } } };
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (hasInterval()) { hash = (37 * hash) + INTERVAL_FIELD_NUMBER; hash = (53 * hash) + getInterval().hashCode(); } if (hasValue()) { hash = (37 * hash) + VALUE_FIELD_NUMBER; hash = (53 * hash) + getValue().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.monitoring.v3.Point)) { return super.equals(obj); } com.google.monitoring.v3.Point other = (com.google.monitoring.v3.Point) obj; boolean result = true; result = result && (hasInterval() == other.hasInterval()); if (hasInterval()) { result = result && getInterval() .equals(other.getInterval()); } result = result && (hasValue() == other.hasValue()); if (hasValue()) { result = result && getValue() .equals(other.getValue()); } return result; }
public Builder mergeFrom(com.google.monitoring.v3.Point other) { if (other == com.google.monitoring.v3.Point.getDefaultInstance()) return this; if (other.hasInterval()) { mergeInterval(other.getInterval()); } if (other.hasValue()) { mergeValue(other.getValue()); } onChanged(); return this; }
@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()); }