/** * * * <pre> * The associated metric. A fully-specified metric used to identify the time * series. * </pre> * * <code>.google.api.Metric metric = 1;</code> */ public Builder mergeMetric(com.google.api.Metric value) { if (metricBuilder_ == null) { if (metric_ != null) { metric_ = com.google.api.Metric.newBuilder(metric_).mergeFrom(value).buildPartial(); } else { metric_ = value; } onChanged(); } else { metricBuilder_.mergeFrom(value); } return this; } /**
/** * * * <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.Metric getMetric() { return metric_ == null ? com.google.api.Metric.getDefaultInstance() : metric_; } /**
/** * <pre> * An existing metric type, see [google.api.MetricDescriptor][google.api.MetricDescriptor]. * For example, `custom.googleapis.com/invoice/paid/amount`. * </pre> * * <code>string type = 3;</code> */ public Builder clearType() { type_ = getDefaultInstance().getType(); onChanged(); return this; } /**
public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.api.Metric prototype) {
@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; }
if (hasMetric()) { hash = (37 * hash) + METRIC_FIELD_NUMBER; hash = (53 * hash) + getMetric().hashCode();
public Builder mergeFrom(com.google.api.Metric other) { if (other == com.google.api.Metric.getDefaultInstance()) return this; if (!other.getType().isEmpty()) { type_ = other.type_; onChanged(); } internalGetMutableLabels().mergeFrom( other.internalGetLabels()); onChanged(); return this; }
public static Builder newBuilder(com.google.api.Metric prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() {
@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 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; }
Metric metric = Metric.newBuilder() .setType("custom.googleapis.com/stores/daily_sales") .putAllLabels(metricLabels)
/** * * * <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.Metric getMetric() { if (metricBuilder_ == null) { return metric_ == null ? com.google.api.Metric.getDefaultInstance() : metric_; } else { return metricBuilder_.getMessage(); } } /**
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
/** * * * <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() { if (metricBuilder_ != null) { return metricBuilder_.getMessageOrBuilder(); } else { return metric_ == null ? com.google.api.Metric.getDefaultInstance() : metric_; } } /**
Metric metric = Metric.newBuilder() .setType("custom.googleapis.com/my_metric") .putAllLabels(metricLabels)
/** * <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.Metric getMetric() { return metric_ == null ? com.google.api.Metric.getDefaultInstance() : metric_; } /**
@VisibleForTesting static Metric createMetric( io.opencensus.metrics.export.MetricDescriptor metricDescriptor, List<LabelValue> labelValues, String domain) { Metric.Builder builder = Metric.newBuilder(); builder.setType(generateType(metricDescriptor.getName(), domain)); Map<String, String> stringTagMap = Maps.newHashMap(); List<LabelKey> labelKeys = metricDescriptor.getLabelKeys(); for (int i = 0; i < labelValues.size(); i++) { String value = labelValues.get(i).getValue(); if (value == null) { continue; } stringTagMap.put(labelKeys.get(i).getKey(), value); } stringTagMap.put(OPENCENSUS_TASK, OPENCENSUS_TASK_VALUE_DEFAULT); builder.putAllLabels(stringTagMap); return builder.build(); }
public com.google.api.Metric getDefaultInstanceForType() { return com.google.api.Metric.getDefaultInstance(); }