/** * * * <pre> * A distribution value. * </pre> * * <code>.google.api.Distribution distribution_value = 5;</code> */ public Builder mergeDistributionValue(com.google.api.Distribution value) { if (distributionValueBuilder_ == null) { if (valueCase_ == 5 && value_ != com.google.api.Distribution.getDefaultInstance()) { value_ = com.google.api.Distribution.newBuilder((com.google.api.Distribution) value_) .mergeFrom(value) .buildPartial(); } else { value_ = value; } onChanged(); } else { if (valueCase_ == 5) { distributionValueBuilder_.mergeFrom(value); } distributionValueBuilder_.setMessage(value); } valueCase_ = 5; return this; } /**
case 5: hash = (37 * hash) + DISTRIBUTION_VALUE_FIELD_NUMBER; hash = (53 * hash) + getDistributionValue().hashCode(); break; case 0:
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
public Builder mergeFrom(com.google.api.Distribution other) { if (other == com.google.api.Distribution.getDefaultInstance()) return this; if (other.getCount() != 0L) { setCount(other.getCount()); } if (other.getMean() != 0D) { setMean(other.getMean()); } if (other.getSumOfSquaredDeviation() != 0D) { setSumOfSquaredDeviation(other.getSumOfSquaredDeviation()); } if (other.hasRange()) { mergeRange(other.getRange()); } if (other.hasBucketOptions()) { mergeBucketOptions(other.getBucketOptions()); } if (!other.bucketCounts_.isEmpty()) { if (bucketCounts_.isEmpty()) { bucketCounts_ = other.bucketCounts_; bitField0_ = (bitField0_ & ~0x00000020); } else { ensureBucketCountsIsMutable(); bucketCounts_.addAll(other.bucketCounts_); } onChanged(); } onChanged(); return this; }
/** * * * <pre> * A distribution value. * </pre> * * <code>.google.api.Distribution distribution_value = 5;</code> */ public com.google.api.DistributionOrBuilder getDistributionValueOrBuilder() { if (valueCase_ == 5) { return (com.google.api.Distribution) value_; } return com.google.api.Distribution.getDefaultInstance(); }
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.api.Distribution prototype) {
break; case 5: result = result && getDistributionValue().equals(other.getDistributionValue()); break; case 0:
return Distribution.newBuilder() .setMean(timeDomain ? snapshot.mean(getBaseTimeUnit()) : snapshot.mean()) .setCount(snapshot.count())
/** * * * <pre> * A distribution value. * </pre> * * <code>.google.api.Distribution distribution_value = 5;</code> */ public com.google.api.Distribution getDistributionValue() { if (valueCase_ == 5) { return (com.google.api.Distribution) value_; } return com.google.api.Distribution.getDefaultInstance(); } /**
public static Builder newBuilder(com.google.api.Distribution prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() {
case 5: result = result && getDistributionValue() .equals(other.getDistributionValue()); break; case 0:
@VisibleForTesting static Distribution createDistribution(io.opencensus.metrics.export.Distribution distribution) { return Distribution.newBuilder() .setBucketOptions(createBucketOptions(distribution.getBucketOptions())) .addAllBucketCounts(createBucketCounts(distribution.getBuckets())) .setCount(distribution.getCount()) .setMean(distribution.getCount() == 0 ? 0 : distribution.getSum() / distribution.getCount()) .setSumOfSquaredDeviation(distribution.getSumOfSquaredDeviations()) .build(); }
/** * <pre> * A distribution value. * </pre> * * <code>optional .google.api.Distribution distribution_value = 5;</code> */ public Builder mergeDistributionValue(com.google.api.Distribution value) { if (distributionValueBuilder_ == null) { if (valueCase_ == 5 && value_ != com.google.api.Distribution.getDefaultInstance()) { value_ = com.google.api.Distribution.newBuilder((com.google.api.Distribution) value_) .mergeFrom(value).buildPartial(); } else { value_ = value; } onChanged(); } else { if (valueCase_ == 5) { distributionValueBuilder_.mergeFrom(value); } distributionValueBuilder_.setMessage(value); } valueCase_ = 5; return this; } /**
/** * * * <pre> * A distribution value. * </pre> * * <code>.google.api.Distribution distribution_value = 5;</code> */ public com.google.api.Distribution getDistributionValue() { if (distributionValueBuilder_ == null) { if (valueCase_ == 5) { return (com.google.api.Distribution) value_; } return com.google.api.Distribution.getDefaultInstance(); } else { if (valueCase_ == 5) { return distributionValueBuilder_.getMessage(); } return com.google.api.Distribution.getDefaultInstance(); } } /**
com.google.api.Distribution.Builder subBuilder = null; if (valueCase_ == 5) { subBuilder = ((com.google.api.Distribution) value_).toBuilder(); input.readMessage(com.google.api.Distribution.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((com.google.api.Distribution) value_);
case 5: hash = (37 * hash) + DISTRIBUTION_VALUE_FIELD_NUMBER; hash = (53 * hash) + getDistributionValue().hashCode(); break; case 0:
private Stream<TimeSeries> createFunctionTimer(Batch batch, FunctionTimer timer) { long count = (long) timer.count(); Distribution.Builder distribution = Distribution.newBuilder() .setMean(timer.mean(getBaseTimeUnit())) .setCount(count) .setBucketOptions(Distribution.BucketOptions.newBuilder() .setExplicitBuckets(Distribution.BucketOptions.Explicit.newBuilder() .addBounds(0.0) .build())) .addBucketCounts(0) .addBucketCounts(count); return Stream.of(batch.createTimeSeries(timer, distribution.build())); }
/** * * * <pre> * A distribution value. * </pre> * * <code>.google.api.Distribution distribution_value = 5;</code> */ public com.google.api.DistributionOrBuilder getDistributionValueOrBuilder() { if ((valueCase_ == 5) && (distributionValueBuilder_ != null)) { return distributionValueBuilder_.getMessageOrBuilder(); } else { if (valueCase_ == 5) { return (com.google.api.Distribution) value_; } return com.google.api.Distribution.getDefaultInstance(); } } /**
@Test public void createDistribution() { assertThat(StackdriverExportUtils.createDistribution(DISTRIBUTION)) .isEqualTo( com.google.api.Distribution.newBuilder() .setCount(3) .setMean(0.6666666666666666) .setBucketOptions(StackdriverExportUtils.createBucketOptions(BUCKET_OPTIONS)) .addAllBucketCounts(Arrays.asList(0L, 3L, 1L, 2L, 4L)) .setSumOfSquaredDeviation(14) .build()); }