@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
result = result && getValueCase().equals(other.getValueCase()); if (!result) return false; switch (valueCase_) { case 1: result = result && (getBoolValue() == other.getBoolValue()); break; case 2: result = result && (getInt64Value() == other.getInt64Value()); break; case 3: result = result && (java.lang.Double.doubleToLongBits(getDoubleValue()) == java.lang.Double.doubleToLongBits(other.getDoubleValue())); break; case 4: result = result && getStringValue().equals(other.getStringValue()); break; case 5: result = result && getDistributionValue().equals(other.getDistributionValue()); break; case 0:
@java.lang.Override public com.google.monitoring.v3.TypedValue buildPartial() { com.google.monitoring.v3.TypedValue result = new com.google.monitoring.v3.TypedValue(this); if (valueCase_ == 1) { result.value_ = value_; } if (valueCase_ == 2) { result.value_ = value_; } if (valueCase_ == 3) { result.value_ = value_; } if (valueCase_ == 4) { result.value_ = value_; } if (valueCase_ == 5) { if (distributionValueBuilder_ == null) { result.value_ = value_; } else { result.value_ = distributionValueBuilder_.build(); } } result.valueCase_ = valueCase_; onBuilt(); return result; }
hash = (19 * hash) + getDescriptor().hashCode(); switch (valueCase_) { case 1: hash = (37 * hash) + BOOL_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getBoolValue()); break; case 2: hash = (37 * hash) + INT64_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getInt64Value()); break; case 3: (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getDoubleValue())); break; case 4: hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; hash = (53 * hash) + getStringValue().hashCode(); break; case 5: hash = (37 * hash) + DISTRIBUTION_VALUE_FIELD_NUMBER; hash = (53 * hash) + getDistributionValue().hashCode(); break; case 0:
public Builder mergeFrom(com.google.monitoring.v3.TypedValue other) { if (other == com.google.monitoring.v3.TypedValue.getDefaultInstance()) return this; switch (other.getValueCase()) { case BOOL_VALUE: setBoolValue(other.getBoolValue()); break; setInt64Value(other.getInt64Value()); break; setDoubleValue(other.getDoubleValue()); break; mergeDistributionValue(other.getDistributionValue()); break;
hash = (19 * hash) + getDescriptorForType().hashCode(); switch (valueCase_) { case 1: hash = (37 * hash) + BOOL_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getBoolValue()); break; case 2: hash = (37 * hash) + INT64_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( getInt64Value()); break; case 3: hash = (37 * hash) + DOUBLE_VALUE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getDoubleValue())); break; case 4: hash = (37 * hash) + STRING_VALUE_FIELD_NUMBER; hash = (53 * hash) + getStringValue().hashCode(); break; case 5: hash = (37 * hash) + DISTRIBUTION_VALUE_FIELD_NUMBER; hash = (53 * hash) + getDistributionValue().hashCode(); break; case 0:
@java.lang.Override public com.google.monitoring.v3.TypedValue getDefaultInstanceForType() { return com.google.monitoring.v3.TypedValue.getDefaultInstance(); }
@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(); } } };
@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()); }
@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.TypedValue other) { if (other == com.google.monitoring.v3.TypedValue.getDefaultInstance()) return this; switch (other.getValueCase()) { case BOOL_VALUE: { setBoolValue(other.getBoolValue()); break; setInt64Value(other.getInt64Value()); break; setDoubleValue(other.getDoubleValue()); break; mergeDistributionValue(other.getDistributionValue()); break;
/** * * * <pre> * The value of the data point. * </pre> * * <code>.google.monitoring.v3.TypedValue value = 2;</code> */ public com.google.monitoring.v3.TypedValue getValue() { return value_ == null ? com.google.monitoring.v3.TypedValue.getDefaultInstance() : value_; } /**
@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; }
/** * * * <pre> * The value of the data point. * </pre> * * <code>.google.monitoring.v3.TypedValue value = 2;</code> */ public Builder mergeValue(com.google.monitoring.v3.TypedValue value) { if (valueBuilder_ == null) { if (value_ != null) { value_ = com.google.monitoring.v3.TypedValue.newBuilder(value_) .mergeFrom(value) .buildPartial(); } else { value_ = value; } onChanged(); } else { valueBuilder_.mergeFrom(value); } return this; } /**
result = result && getValueCase().equals( other.getValueCase()); if (!result) return false; switch (valueCase_) { case 1: result = result && (getBoolValue() == other.getBoolValue()); break; case 2: result = result && (getInt64Value() == other.getInt64Value()); break; case 3: result = result && ( java.lang.Double.doubleToLongBits(getDoubleValue()) == java.lang.Double.doubleToLongBits( other.getDoubleValue())); break; case 4: result = result && getStringValue() .equals(other.getStringValue()); break; case 5: result = result && getDistributionValue() .equals(other.getDistributionValue()); break; case 0:
/** * * * <pre> * The value of the data point. * </pre> * * <code>.google.monitoring.v3.TypedValue value = 2;</code> */ public com.google.monitoring.v3.TypedValue getValue() { if (valueBuilder_ == null) { return value_ == null ? com.google.monitoring.v3.TypedValue.getDefaultInstance() : value_; } else { return valueBuilder_.getMessage(); } } /**
public com.google.monitoring.v3.TypedValue buildPartial() { com.google.monitoring.v3.TypedValue result = new com.google.monitoring.v3.TypedValue(this); if (valueCase_ == 1) { result.value_ = value_; } if (valueCase_ == 2) { result.value_ = value_; } if (valueCase_ == 3) { result.value_ = value_; } if (valueCase_ == 4) { result.value_ = value_; } if (valueCase_ == 5) { if (distributionValueBuilder_ == null) { result.value_ = value_; } else { result.value_ = distributionValueBuilder_.build(); } } result.valueCase_ = valueCase_; onBuilt(); return result; }
.setEndTime(Timestamps.fromMillis(System.currentTimeMillis())) .build(); TypedValue value = TypedValue.newBuilder() .setDoubleValue(123.45) .build();
/** * * * <pre> * The value of the data point. * </pre> * * <code>.google.monitoring.v3.TypedValue value = 2;</code> */ public com.google.monitoring.v3.TypedValueOrBuilder getValueOrBuilder() { if (valueBuilder_ != null) { return valueBuilder_.getMessageOrBuilder(); } else { return value_ == null ? com.google.monitoring.v3.TypedValue.getDefaultInstance() : value_; } } /**
.setEndTime(Timestamps.fromMillis(System.currentTimeMillis())) .build(); TypedValue value = TypedValue.newBuilder() .setDoubleValue(123.45) .build();