./gradlew goJF
This commit is contained in:
parent
9cb3ad5eb7
commit
3bd0e1e522
|
|
@ -23,8 +23,8 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
import openconsensus.metrics.MetricRegistry;
|
import openconsensus.metrics.MetricRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a function that produces a double-valued result. See {@link
|
* Represents a function that produces a double-valued result. See {@link MetricRegistry} for an
|
||||||
* MetricRegistry} for an example of its use.
|
* example of its use.
|
||||||
*
|
*
|
||||||
* <p>Note: This class is based on the java.util.ToDoubleFunction class added in Java 1.8. We cannot
|
* <p>Note: This class is based on the java.util.ToDoubleFunction class added in Java 1.8. We cannot
|
||||||
* use the Function from Java 1.8 because this library is Java 1.6 compatible.
|
* use the Function from Java 1.8 because this library is Java 1.6 compatible.
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
import openconsensus.metrics.MetricRegistry;
|
import openconsensus.metrics.MetricRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a function that produces a long-valued result. See {@link
|
* Represents a function that produces a long-valued result. See {@link MetricRegistry} for an
|
||||||
* MetricRegistry} for an example of its use.
|
* example of its use.
|
||||||
*
|
*
|
||||||
* <p>Note: This class is based on the java.util.ToLongFunction class added in Java 1.8. We cannot
|
* <p>Note: This class is based on the java.util.ToLongFunction class added in Java 1.8. We cannot
|
||||||
* use the Function from Java 1.8 because this library is Java 1.6 compatible.
|
* use the Function from Java 1.8 because this library is Java 1.6 compatible.
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
package openconsensus.internal;
|
package openconsensus.internal;
|
||||||
|
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.common.Clock;
|
import openconsensus.common.Clock;
|
||||||
import openconsensus.common.Timestamp;
|
import openconsensus.common.Timestamp;
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/** A {@link Clock} that always returns 0. */
|
/** A {@link Clock} that always returns 0. */
|
||||||
@Immutable
|
@Immutable
|
||||||
|
|
|
||||||
|
|
@ -23,4 +23,4 @@
|
||||||
@Internal
|
@Internal
|
||||||
package openconsensus.internal;
|
package openconsensus.internal;
|
||||||
|
|
||||||
import openconsensus.common.Internal;
|
import openconsensus.common.Internal;
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,11 @@
|
||||||
|
|
||||||
package openconsensus.metrics;
|
package openconsensus.metrics;
|
||||||
|
|
||||||
import openconsensus.common.ToDoubleFunction;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
import openconsensus.common.ToDoubleFunction;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/*>>>
|
/*>>>
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,11 @@
|
||||||
|
|
||||||
package openconsensus.metrics;
|
package openconsensus.metrics;
|
||||||
|
|
||||||
import openconsensus.common.ToLongFunction;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.lang.ref.WeakReference;
|
import java.lang.ref.WeakReference;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
import openconsensus.common.ToLongFunction;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/*>>>
|
/*>>>
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
package openconsensus.metrics;
|
package openconsensus.metrics;
|
||||||
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Double Gauge metric, to report instantaneous measurement of a double value. Gauges can go both up
|
* Double Gauge metric, to report instantaneous measurement of a double value. Gauges can go both up
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@
|
||||||
package openconsensus.metrics;
|
package openconsensus.metrics;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.ExperimentalApi;
|
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The key of a {@code Label} associated with a {@code MetricDescriptor}.
|
* The key of a {@code Label} associated with a {@code MetricDescriptor}.
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@
|
||||||
package openconsensus.metrics;
|
package openconsensus.metrics;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.ExperimentalApi;
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value of a {@code Label} associated with a {@code TimeSeries}.
|
* The value of a {@code Label} associated with a {@code TimeSeries}.
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
package openconsensus.metrics;
|
package openconsensus.metrics;
|
||||||
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Long Gauge metric, to report instantaneous measurement of an int64 value. Gauges can go both up
|
* Long Gauge metric, to report instantaneous measurement of an int64 value. Gauges can go both up
|
||||||
|
|
|
||||||
|
|
@ -16,18 +16,17 @@
|
||||||
|
|
||||||
package openconsensus.metrics;
|
package openconsensus.metrics;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import openconsensus.common.ExperimentalApi;
|
import openconsensus.common.ExperimentalApi;
|
||||||
import openconsensus.common.ToDoubleFunction;
|
import openconsensus.common.ToDoubleFunction;
|
||||||
import openconsensus.common.ToLongFunction;
|
import openconsensus.common.ToLongFunction;
|
||||||
import openconsensus.internal.Utils;
|
import openconsensus.internal.Utils;
|
||||||
import java.util.List;
|
|
||||||
import openconsensus.metrics.export.MetricProducer;
|
import openconsensus.metrics.export.MetricProducer;
|
||||||
import openconsensus.metrics.export.MetricProducerManager;
|
import openconsensus.metrics.export.MetricProducerManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and manages your application's set of metrics. The default implementation of this creates
|
* Creates and manages your application's set of metrics. The default implementation of this creates
|
||||||
* a {@link MetricProducer} and registers it to the global {@link
|
* a {@link MetricProducer} and registers it to the global {@link MetricProducerManager}.
|
||||||
* MetricProducerManager}.
|
|
||||||
*
|
*
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,13 @@
|
||||||
|
|
||||||
package openconsensus.metrics;
|
package openconsensus.metrics;
|
||||||
|
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import openconsensus.common.ExperimentalApi;
|
import openconsensus.common.ExperimentalApi;
|
||||||
import openconsensus.internal.DefaultVisibilityForTesting;
|
import openconsensus.internal.DefaultVisibilityForTesting;
|
||||||
import openconsensus.internal.Provider;
|
import openconsensus.internal.Provider;
|
||||||
import openconsensus.metrics.export.ExportComponent;
|
import openconsensus.metrics.export.ExportComponent;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import openconsensus.metrics.export.MetricProducerManager;
|
import openconsensus.metrics.export.MetricProducerManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -49,8 +49,7 @@ public final class Metrics {
|
||||||
/**
|
/**
|
||||||
* Returns the global {@link MetricRegistry}.
|
* Returns the global {@link MetricRegistry}.
|
||||||
*
|
*
|
||||||
* <p>This {@code MetricRegistry} is already added to the global {@link
|
* <p>This {@code MetricRegistry} is already added to the global {@link MetricProducerManager}.
|
||||||
* MetricProducerManager}.
|
|
||||||
*
|
*
|
||||||
* @return the global {@code MetricRegistry}.
|
* @return the global {@code MetricRegistry}.
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,12 @@
|
||||||
package openconsensus.metrics.data;
|
package openconsensus.metrics.data;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.Timestamp;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.Timestamp;
|
||||||
|
|
||||||
/*>>>
|
/*>>>
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
|
||||||
|
|
@ -25,4 +25,4 @@
|
||||||
@ExperimentalApi
|
@ExperimentalApi
|
||||||
package openconsensus.metrics.data;
|
package openconsensus.metrics.data;
|
||||||
|
|
||||||
import openconsensus.common.ExperimentalApi;
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
|
|
||||||
|
|
@ -17,16 +17,16 @@
|
||||||
package openconsensus.metrics.export;
|
package openconsensus.metrics.export;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.ExperimentalApi;
|
|
||||||
import openconsensus.common.Function;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import openconsensus.metrics.data.Exemplar;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
import openconsensus.common.Function;
|
||||||
import openconsensus.common.Functions;
|
import openconsensus.common.Functions;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
import openconsensus.metrics.data.Exemplar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link Distribution} contains summary statistics for a population of values. It optionally
|
* {@link Distribution} contains summary statistics for a population of values. It optionally
|
||||||
|
|
|
||||||
|
|
@ -17,16 +17,16 @@
|
||||||
package openconsensus.metrics.export;
|
package openconsensus.metrics.export;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.common.ExperimentalApi;
|
import openconsensus.common.ExperimentalApi;
|
||||||
import openconsensus.internal.Utils;
|
import openconsensus.internal.Utils;
|
||||||
import openconsensus.metrics.export.Value.ValueDistribution;
|
import openconsensus.metrics.export.Value.ValueDistribution;
|
||||||
import openconsensus.metrics.export.Value.ValueDouble;
|
import openconsensus.metrics.export.Value.ValueDouble;
|
||||||
import openconsensus.metrics.export.Value.ValueLong;
|
import openconsensus.metrics.export.Value.ValueLong;
|
||||||
import openconsensus.metrics.export.Value.ValueSummary;
|
import openconsensus.metrics.export.Value.ValueSummary;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link Metric} with one or more {@link TimeSeries}.
|
* A {@link Metric} with one or more {@link TimeSeries}.
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,13 @@
|
||||||
package openconsensus.metrics.export;
|
package openconsensus.metrics.export;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.ExperimentalApi;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import openconsensus.metrics.LabelKey;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
import openconsensus.metrics.LabelKey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link MetricDescriptor} defines a {@code Metric} type and its schema.
|
* {@link MetricDescriptor} defines a {@code Metric} type and its schema.
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
package openconsensus.metrics.export;
|
package openconsensus.metrics.export;
|
||||||
|
|
||||||
import openconsensus.common.ExperimentalApi;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@link Metric} producer that can be registered for exporting using {@link
|
* A {@link Metric} producer that can be registered for exporting using {@link
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,11 @@
|
||||||
|
|
||||||
package openconsensus.metrics.export;
|
package openconsensus.metrics.export;
|
||||||
|
|
||||||
import openconsensus.common.ExperimentalApi;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keeps a set of {@link MetricProducer} that is used by exporters to determine the metrics that
|
* Keeps a set of {@link MetricProducer} that is used by exporters to determine the metrics that
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@
|
||||||
package openconsensus.metrics.export;
|
package openconsensus.metrics.export;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.common.ExperimentalApi;
|
import openconsensus.common.ExperimentalApi;
|
||||||
import openconsensus.common.Timestamp;
|
import openconsensus.common.Timestamp;
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A timestamped measurement of a {@code TimeSeries}.
|
* A timestamped measurement of a {@code TimeSeries}.
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,13 @@
|
||||||
package openconsensus.metrics.export;
|
package openconsensus.metrics.export;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.ExperimentalApi;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of the {@link Distribution} as a summary of observations.
|
* Implementation of the {@link Distribution} as a summary of observations.
|
||||||
|
|
|
||||||
|
|
@ -17,16 +17,16 @@
|
||||||
package openconsensus.metrics.export;
|
package openconsensus.metrics.export;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.ExperimentalApi;
|
|
||||||
import openconsensus.common.Timestamp;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import openconsensus.metrics.LabelKey;
|
|
||||||
import openconsensus.metrics.LabelValue;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
import openconsensus.common.Timestamp;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
import openconsensus.metrics.LabelKey;
|
||||||
|
import openconsensus.metrics.LabelValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A collection of data points that describes the time-varying values of a {@code Metric}.
|
* A collection of data points that describes the time-varying values of a {@code Metric}.
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@
|
||||||
package openconsensus.metrics.export;
|
package openconsensus.metrics.export;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.common.ExperimentalApi;
|
import openconsensus.common.ExperimentalApi;
|
||||||
import openconsensus.common.Function;
|
import openconsensus.common.Function;
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The actual point value for a {@link Point}.
|
* The actual point value for a {@link Point}.
|
||||||
|
|
|
||||||
|
|
@ -31,4 +31,4 @@
|
||||||
@ExperimentalApi
|
@ExperimentalApi
|
||||||
package openconsensus.metrics;
|
package openconsensus.metrics;
|
||||||
|
|
||||||
import openconsensus.common.ExperimentalApi;
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,6 @@
|
||||||
package openconsensus.resource;
|
package openconsensus.resource;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.ExperimentalApi;
|
|
||||||
import openconsensus.internal.DefaultVisibilityForTesting;
|
|
||||||
import openconsensus.internal.StringUtils;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
|
|
@ -28,6 +24,10 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
import openconsensus.internal.DefaultVisibilityForTesting;
|
||||||
|
import openconsensus.internal.StringUtils;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/*>>>
|
/*>>>
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
|
@ -45,8 +45,7 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
@AutoValue
|
@AutoValue
|
||||||
@ExperimentalApi
|
@ExperimentalApi
|
||||||
public abstract class Resource {
|
public abstract class Resource {
|
||||||
@DefaultVisibilityForTesting
|
@DefaultVisibilityForTesting static final int MAX_LENGTH = 255;
|
||||||
static final int MAX_LENGTH = 255;
|
|
||||||
private static final String OC_RESOURCE_TYPE_ENV = "OC_RESOURCE_TYPE";
|
private static final String OC_RESOURCE_TYPE_ENV = "OC_RESOURCE_TYPE";
|
||||||
private static final String OC_RESOURCE_LABELS_ENV = "OC_RESOURCE_LABELS";
|
private static final String OC_RESOURCE_LABELS_ENV = "OC_RESOURCE_LABELS";
|
||||||
private static final String LABEL_LIST_SPLITTER = ",";
|
private static final String LABEL_LIST_SPLITTER = ",";
|
||||||
|
|
|
||||||
|
|
@ -46,4 +46,4 @@
|
||||||
@ExperimentalApi
|
@ExperimentalApi
|
||||||
package openconsensus.resource;
|
package openconsensus.resource;
|
||||||
|
|
||||||
import openconsensus.common.ExperimentalApi;
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@
|
||||||
package openconsensus.stats;
|
package openconsensus.stats;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.common.Function;
|
import openconsensus.common.Function;
|
||||||
import openconsensus.internal.Utils;
|
import openconsensus.internal.Utils;
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link Aggregation} is the process of combining a certain set of {@code MeasureValue}s for a
|
* {@link Aggregation} is the process of combining a certain set of {@code MeasureValue}s for a
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,13 @@
|
||||||
package openconsensus.stats;
|
package openconsensus.stats;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.Function;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import openconsensus.metrics.data.Exemplar;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.Function;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
import openconsensus.metrics.data.Exemplar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link AggregationData} is the result of applying a given {@link Aggregation} to a set of {@code
|
* {@link AggregationData} is the result of applying a given {@link Aggregation} to a set of {@code
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,13 @@
|
||||||
package openconsensus.stats;
|
package openconsensus.stats;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The bucket boundaries for a histogram.
|
* The bucket boundaries for a histogram.
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@
|
||||||
package openconsensus.stats;
|
package openconsensus.stats;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.common.Function;
|
import openconsensus.common.Function;
|
||||||
import openconsensus.internal.DefaultVisibilityForTesting;
|
import openconsensus.internal.DefaultVisibilityForTesting;
|
||||||
import openconsensus.internal.StringUtils;
|
import openconsensus.internal.StringUtils;
|
||||||
import openconsensus.internal.Utils;
|
import openconsensus.internal.Utils;
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The definition of the {@link Measurement} that is taken by OpenCensus library.
|
* The definition of the {@link Measurement} that is taken by OpenCensus library.
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,13 @@
|
||||||
|
|
||||||
package openconsensus.stats;
|
package openconsensus.stats;
|
||||||
|
|
||||||
|
import javax.annotation.concurrent.NotThreadSafe;
|
||||||
import openconsensus.internal.Utils;
|
import openconsensus.internal.Utils;
|
||||||
import openconsensus.metrics.data.AttachmentValue;
|
import openconsensus.metrics.data.AttachmentValue;
|
||||||
import openconsensus.metrics.data.AttachmentValue.AttachmentValueString;
|
import openconsensus.metrics.data.AttachmentValue.AttachmentValueString;
|
||||||
import openconsensus.stats.Measure.MeasureDouble;
|
import openconsensus.stats.Measure.MeasureDouble;
|
||||||
import openconsensus.stats.Measure.MeasureLong;
|
import openconsensus.stats.Measure.MeasureLong;
|
||||||
import openconsensus.tags.TagContext;
|
import openconsensus.tags.TagContext;
|
||||||
import javax.annotation.concurrent.NotThreadSafe;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A map from {@link Measure}s to measured values to be recorded at the same time.
|
* A map from {@link Measure}s to measured values to be recorded at the same time.
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
package openconsensus.stats;
|
package openconsensus.stats;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.common.Function;
|
import openconsensus.common.Function;
|
||||||
import openconsensus.stats.Measure.MeasureDouble;
|
import openconsensus.stats.Measure.MeasureDouble;
|
||||||
import openconsensus.stats.Measure.MeasureLong;
|
import openconsensus.stats.Measure.MeasureLong;
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Immutable representation of a Measurement.
|
* Immutable representation of a Measurement.
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,6 @@
|
||||||
|
|
||||||
package openconsensus.stats;
|
package openconsensus.stats;
|
||||||
|
|
||||||
import openconsensus.common.Functions;
|
|
||||||
import openconsensus.common.Timestamp;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import openconsensus.stats.Measure.MeasureDouble;
|
|
||||||
import openconsensus.stats.Measure.MeasureLong;
|
|
||||||
import openconsensus.tags.TagContext;
|
|
||||||
import openconsensus.tags.TagValue;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
@ -35,6 +28,13 @@ import java.util.logging.Logger;
|
||||||
import javax.annotation.concurrent.GuardedBy;
|
import javax.annotation.concurrent.GuardedBy;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
import openconsensus.common.Functions;
|
||||||
|
import openconsensus.common.Timestamp;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
import openconsensus.stats.Measure.MeasureDouble;
|
||||||
|
import openconsensus.stats.Measure.MeasureLong;
|
||||||
|
import openconsensus.tags.TagContext;
|
||||||
|
import openconsensus.tags.TagValue;
|
||||||
|
|
||||||
/*>>>
|
/*>>>
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,11 @@
|
||||||
|
|
||||||
package openconsensus.stats;
|
package openconsensus.stats;
|
||||||
|
|
||||||
import openconsensus.internal.DefaultVisibilityForTesting;
|
|
||||||
import openconsensus.internal.Provider;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
import openconsensus.internal.DefaultVisibilityForTesting;
|
||||||
|
import openconsensus.internal.Provider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for accessing the default {@link StatsComponent}.
|
* Class for accessing the default {@link StatsComponent}.
|
||||||
|
|
|
||||||
|
|
@ -17,18 +17,18 @@
|
||||||
package openconsensus.stats;
|
package openconsensus.stats;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.Duration;
|
|
||||||
import openconsensus.common.Function;
|
|
||||||
import openconsensus.internal.DefaultVisibilityForTesting;
|
|
||||||
import openconsensus.internal.StringUtils;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import openconsensus.tags.TagKey;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.Duration;
|
||||||
|
import openconsensus.common.Function;
|
||||||
|
import openconsensus.internal.DefaultVisibilityForTesting;
|
||||||
|
import openconsensus.internal.StringUtils;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
import openconsensus.tags.TagKey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A View specifies an aggregation and a set of tag keys. The aggregation will be broken down by the
|
* A View specifies an aggregation and a set of tag keys. The aggregation will be broken down by the
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,13 @@
|
||||||
package openconsensus.stats;
|
package openconsensus.stats;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.common.Duration;
|
import openconsensus.common.Duration;
|
||||||
import openconsensus.common.Function;
|
import openconsensus.common.Function;
|
||||||
import openconsensus.common.Functions;
|
import openconsensus.common.Functions;
|
||||||
|
|
@ -34,13 +41,6 @@ import openconsensus.stats.AggregationData.SumDataLong;
|
||||||
import openconsensus.stats.Measure.MeasureDouble;
|
import openconsensus.stats.Measure.MeasureDouble;
|
||||||
import openconsensus.stats.Measure.MeasureLong;
|
import openconsensus.stats.Measure.MeasureLong;
|
||||||
import openconsensus.tags.TagValue;
|
import openconsensus.tags.TagValue;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/*>>>
|
/*>>>
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
|
|
||||||
|
|
@ -16,15 +16,15 @@
|
||||||
|
|
||||||
package openconsensus.tags;
|
package openconsensus.tags;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
import openconsensus.common.Scope;
|
import openconsensus.common.Scope;
|
||||||
import openconsensus.internal.NoopScope;
|
import openconsensus.internal.NoopScope;
|
||||||
import openconsensus.internal.Utils;
|
import openconsensus.internal.Utils;
|
||||||
import openconsensus.tags.propagation.TagContextBinarySerializer;
|
import openconsensus.tags.propagation.TagContextBinarySerializer;
|
||||||
import openconsensus.tags.propagation.TagPropagationComponent;
|
import openconsensus.tags.propagation.TagPropagationComponent;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
|
||||||
|
|
||||||
/** No-op implementations of tagging classes. */
|
/** No-op implementations of tagging classes. */
|
||||||
final class NoopTags {
|
final class NoopTags {
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@
|
||||||
package openconsensus.tags;
|
package openconsensus.tags;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.tags.TagMetadata.TagTtl;
|
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.tags.TagMetadata.TagTtl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link TagKey} paired with a {@link TagValue}.
|
* {@link TagKey} paired with a {@link TagValue}.
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@
|
||||||
package openconsensus.tags;
|
package openconsensus.tags;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.internal.StringUtils;
|
import openconsensus.internal.StringUtils;
|
||||||
import openconsensus.internal.Utils;
|
import openconsensus.internal.Utils;
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A key to a value stored in a {@link TagContext}.
|
* A key to a value stored in a {@link TagContext}.
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@
|
||||||
package openconsensus.tags;
|
package openconsensus.tags;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.internal.StringUtils;
|
import openconsensus.internal.StringUtils;
|
||||||
import openconsensus.internal.Utils;
|
import openconsensus.internal.Utils;
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A validated tag value.
|
* A validated tag value.
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,12 @@
|
||||||
|
|
||||||
package openconsensus.tags;
|
package openconsensus.tags;
|
||||||
|
|
||||||
import openconsensus.internal.DefaultVisibilityForTesting;
|
|
||||||
import openconsensus.internal.Provider;
|
|
||||||
import openconsensus.tags.propagation.TagPropagationComponent;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
import openconsensus.internal.DefaultVisibilityForTesting;
|
||||||
|
import openconsensus.internal.Provider;
|
||||||
|
import openconsensus.tags.propagation.TagPropagationComponent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for accessing the default {@link TagsComponent}.
|
* Class for accessing the default {@link TagsComponent}.
|
||||||
|
|
|
||||||
|
|
@ -17,17 +17,17 @@
|
||||||
package openconsensus.tags.unsafe;
|
package openconsensus.tags.unsafe;
|
||||||
|
|
||||||
import io.grpc.Context;
|
import io.grpc.Context;
|
||||||
import openconsensus.tags.Tag;
|
|
||||||
import openconsensus.tags.TagContext;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.tags.Tag;
|
||||||
|
import openconsensus.tags.TagContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility methods for accessing the {@link TagContext} contained in the {@link io.grpc.Context}.
|
* Utility methods for accessing the {@link TagContext} contained in the {@link io.grpc.Context}.
|
||||||
*
|
*
|
||||||
* <p>Most code should interact with the current context via the public APIs in {@link
|
* <p>Most code should interact with the current context via the public APIs in {@link TagContext}
|
||||||
* TagContext} and avoid accessing {@link #TAG_CONTEXT_KEY} directly.
|
* and avoid accessing {@link #TAG_CONTEXT_KEY} directly.
|
||||||
*
|
*
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A text annotation with a set of attributes.
|
* A text annotation with a set of attributes.
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.common.Function;
|
import openconsensus.common.Function;
|
||||||
import openconsensus.common.Functions;
|
import openconsensus.common.Functions;
|
||||||
import openconsensus.internal.Utils;
|
import openconsensus.internal.Utils;
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class that represents all the possible values for an attribute. An attribute can have 3 types
|
* A class that represents all the possible values for an attribute. An attribute can have 3 types
|
||||||
|
|
@ -86,8 +86,8 @@ public abstract class AttributeValue {
|
||||||
* @param booleanFunction the function that should be applied if the value has type {@code
|
* @param booleanFunction the function that should be applied if the value has type {@code
|
||||||
* Boolean}.
|
* Boolean}.
|
||||||
* @param defaultFunction the function that should be applied if the value has a type that was
|
* @param defaultFunction the function that should be applied if the value has a type that was
|
||||||
* added after this {@code match} method was added to the API. See {@link
|
* added after this {@code match} method was added to the API. See {@link Functions} for some
|
||||||
* Functions} for some common functions for handling unknown types.
|
* common functions for handling unknown types.
|
||||||
* @return the result of the function applied to the underlying value.
|
* @return the result of the function applied to the underlying value.
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
* @deprecated in favor of {@link #match(Function, Function, Function, Function, Function)}.
|
* @deprecated in favor of {@link #match(Function, Function, Function, Function, Function)}.
|
||||||
|
|
@ -109,8 +109,8 @@ public abstract class AttributeValue {
|
||||||
* Boolean}.
|
* Boolean}.
|
||||||
* @param doubleFunction the function that should be applied if the value has type {@code Double}.
|
* @param doubleFunction the function that should be applied if the value has type {@code Double}.
|
||||||
* @param defaultFunction the function that should be applied if the value has a type that was
|
* @param defaultFunction the function that should be applied if the value has a type that was
|
||||||
* added after this {@code match} method was added to the API. See {@link
|
* added after this {@code match} method was added to the API. See {@link Functions} for some
|
||||||
* Functions} for some common functions for handling unknown types.
|
* common functions for handling unknown types.
|
||||||
* @return the result of the function applied to the underlying value.
|
* @return the result of the function applied to the underlying value.
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
|
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
final class BigendianEncoding {
|
final class BigendianEncoding {
|
||||||
static final int LONG_BYTES = Long.SIZE / Byte.SIZE;
|
static final int LONG_BYTES = Long.SIZE / Byte.SIZE;
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@code BlankSpan} is a singleton class, which is the default {@link Span} that is used when
|
* The {@code BlankSpan} is a singleton class, which is the default {@link Span} that is used when
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import io.grpc.Context;
|
import io.grpc.Context;
|
||||||
import openconsensus.common.Scope;
|
|
||||||
import openconsensus.trace.unsafe.ContextUtils;
|
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
import openconsensus.common.Scope;
|
||||||
|
import openconsensus.trace.unsafe.ContextUtils;
|
||||||
|
|
||||||
/** Util methods/functionality to interact with the {@link Span} in the {@link io.grpc.Context}. */
|
/** Util methods/functionality to interact with the {@link Span} in the {@link io.grpc.Context}. */
|
||||||
final class CurrentSpanUtils {
|
final class CurrentSpanUtils {
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.ExperimentalApi;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.ExperimentalApi;
|
||||||
import openconsensus.trace.export.SampledSpanStore;
|
import openconsensus.trace.export.SampledSpanStore;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -51,8 +51,7 @@ public abstract class EndSpanOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If {@code true} this is equivalent with calling the {@link
|
* If {@code true} this is equivalent with calling the {@link
|
||||||
* SampledSpanStore#registerSpanNamesForCollection(Collection)} in
|
* SampledSpanStore#registerSpanNamesForCollection(Collection)} in advance for this span name.
|
||||||
* advance for this span name.
|
|
||||||
*
|
*
|
||||||
* @return {@code true} if the name of the {@code Span} should be registered to the {@code
|
* @return {@code true} if the name of the {@code Span} should be registered to the {@code
|
||||||
* SampledSpanStore}.
|
* SampledSpanStore}.
|
||||||
|
|
@ -93,15 +92,14 @@ public abstract class EndSpanOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If set to {@code true} this is equivalent with calling the {@link
|
* If set to {@code true} this is equivalent with calling the {@link
|
||||||
* SampledSpanStore#registerSpanNamesForCollection(Collection)} in
|
* SampledSpanStore#registerSpanNamesForCollection(Collection)} in advance for the given span
|
||||||
* advance for the given span name.
|
* name.
|
||||||
*
|
*
|
||||||
* <p>WARNING: setting this option to a randomly generated span name can OOM your process
|
* <p>WARNING: setting this option to a randomly generated span name can OOM your process
|
||||||
* because the library will save samples for each name.
|
* because the library will save samples for each name.
|
||||||
*
|
*
|
||||||
* <p>It is strongly recommended to use the {@link
|
* <p>It is strongly recommended to use the {@link
|
||||||
* SampledSpanStore#registerSpanNamesForCollection(Collection)} API
|
* SampledSpanStore#registerSpanNamesForCollection(Collection)} API instead.
|
||||||
* instead.
|
|
||||||
*
|
*
|
||||||
* @return this.
|
* @return this.
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class that represents a generic messaging event. This class can represent messaging happened in
|
* A class that represents a generic messaging event. This class can represent messaging happened in
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,10 @@
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.Timestamp;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.Timestamp;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class that represents a network event. It requires a {@link Type type} and a message id that
|
* A class that represents a network event. It requires a {@link Type type} and a message id that
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,13 @@
|
||||||
|
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import openconsensus.trace.internal.BaseMessageEventUtils;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
import openconsensus.trace.internal.BaseMessageEventUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An abstract class that represents a span. It has an associated {@link SpanContext} and a set of
|
* An abstract class that represents a span. It has an associated {@link SpanContext} and a set of
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import com.google.errorprone.annotations.MustBeClosed;
|
import com.google.errorprone.annotations.MustBeClosed;
|
||||||
import openconsensus.common.Scope;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
import openconsensus.common.Scope;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link SpanBuilder} is used to construct {@link Span} instances which define arbitrary scopes of
|
* {@link SpanBuilder} is used to construct {@link Span} instances which define arbitrary scopes of
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,10 @@
|
||||||
|
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class that represents a span identifier. A valid span identifier is an 8-byte array with at
|
* A class that represents a span identifier. A valid span identifier is an 8-byte array with at
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
|
@ -24,6 +23,7 @@ import java.util.List;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/*>>>
|
/*>>>
|
||||||
import org.checkerframework.dataflow.qual.Deterministic;
|
import org.checkerframework.dataflow.qual.Deterministic;
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,11 @@
|
||||||
|
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import openconsensus.common.Internal;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.Internal;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class that represents a trace identifier. A valid trace identifier is a 16-byte array with at
|
* A class that represents a trace identifier. A valid trace identifier is a 16-byte array with at
|
||||||
|
|
|
||||||
|
|
@ -16,16 +16,16 @@
|
||||||
|
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import openconsensus.internal.DefaultVisibilityForTesting;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.internal.DefaultVisibilityForTesting;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A class that represents global trace options. These options are propagated to all child {@link
|
* A class that represents global trace options. These options are propagated to all child {@link
|
||||||
* Span spans}. These determine features such as whether a {@code Span} should
|
* Span spans}. These determine features such as whether a {@code Span} should be traced. It is
|
||||||
* be traced. It is implemented as a bitmask.
|
* implemented as a bitmask.
|
||||||
*
|
*
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,11 @@
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import com.google.errorprone.annotations.MustBeClosed;
|
import com.google.errorprone.annotations.MustBeClosed;
|
||||||
|
import java.util.concurrent.Callable;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import openconsensus.common.Scope;
|
import openconsensus.common.Scope;
|
||||||
import openconsensus.internal.Utils;
|
import openconsensus.internal.Utils;
|
||||||
import openconsensus.trace.SpanBuilder.NoopSpanBuilder;
|
import openconsensus.trace.SpanBuilder.NoopSpanBuilder;
|
||||||
import java.util.concurrent.Callable;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tracer is a simple, thin class for {@link Span} creation and in-process context interaction.
|
* Tracer is a simple, thin class for {@link Span} creation and in-process context interaction.
|
||||||
|
|
|
||||||
|
|
@ -17,12 +17,12 @@
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.ExperimentalApi;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Carries tracing-system specific context in a list of key-value pairs. TraceState allows different
|
* Carries tracing-system specific context in a list of key-value pairs. TraceState allows different
|
||||||
|
|
|
||||||
|
|
@ -16,15 +16,15 @@
|
||||||
|
|
||||||
package openconsensus.trace;
|
package openconsensus.trace;
|
||||||
|
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
import openconsensus.common.Clock;
|
import openconsensus.common.Clock;
|
||||||
import openconsensus.internal.DefaultVisibilityForTesting;
|
import openconsensus.internal.DefaultVisibilityForTesting;
|
||||||
import openconsensus.internal.Provider;
|
import openconsensus.internal.Provider;
|
||||||
import openconsensus.trace.config.TraceConfig;
|
import openconsensus.trace.config.TraceConfig;
|
||||||
import openconsensus.trace.export.ExportComponent;
|
import openconsensus.trace.export.ExportComponent;
|
||||||
import openconsensus.trace.propagation.PropagationComponent;
|
import openconsensus.trace.propagation.PropagationComponent;
|
||||||
import java.util.logging.Level;
|
|
||||||
import java.util.logging.Logger;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class that manages a global instance of the {@link TraceComponent}.
|
* Class that manages a global instance of the {@link TraceComponent}.
|
||||||
|
|
|
||||||
|
|
@ -17,16 +17,16 @@
|
||||||
package openconsensus.trace.config;
|
package openconsensus.trace.config;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.internal.Utils;
|
import openconsensus.internal.Utils;
|
||||||
import openconsensus.trace.Annotation;
|
import openconsensus.trace.Annotation;
|
||||||
import openconsensus.trace.Link;
|
import openconsensus.trace.Link;
|
||||||
import openconsensus.trace.MessageEvent;
|
import openconsensus.trace.MessageEvent;
|
||||||
|
import openconsensus.trace.NetworkEvent;
|
||||||
import openconsensus.trace.Sampler;
|
import openconsensus.trace.Sampler;
|
||||||
import openconsensus.trace.Span;
|
import openconsensus.trace.Span;
|
||||||
import openconsensus.trace.samplers.Samplers;
|
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
import openconsensus.trace.NetworkEvent;
|
|
||||||
import openconsensus.trace.SpanBuilder;
|
import openconsensus.trace.SpanBuilder;
|
||||||
|
import openconsensus.trace.samplers.Samplers;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class that holds global trace parameters.
|
* Class that holds global trace parameters.
|
||||||
|
|
@ -92,8 +92,7 @@ public abstract class TraceParams {
|
||||||
public abstract int getMaxNumberOfMessageEvents();
|
public abstract int getMaxNumberOfMessageEvents();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the global default max number of {@link NetworkEvent} events per
|
* Returns the global default max number of {@link NetworkEvent} events per {@link Span}.
|
||||||
* {@link Span}.
|
|
||||||
*
|
*
|
||||||
* @return the global default max number of {@code NetworkEvent} events per {@code Span}.
|
* @return the global default max number of {@code NetworkEvent} events per {@code Span}.
|
||||||
* @deprecated Use {@link getMaxNumberOfMessageEvents}.
|
* @deprecated Use {@link getMaxNumberOfMessageEvents}.
|
||||||
|
|
@ -173,12 +172,10 @@ public abstract class TraceParams {
|
||||||
public abstract Builder setMaxNumberOfMessageEvents(int maxNumberOfMessageEvents);
|
public abstract Builder setMaxNumberOfMessageEvents(int maxNumberOfMessageEvents);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the global default max number of {@link NetworkEvent} events per
|
* Sets the global default max number of {@link NetworkEvent} events per {@link Span}.
|
||||||
* {@link Span}.
|
|
||||||
*
|
*
|
||||||
* @param maxNumberOfNetworkEvents the global default max number of {@link
|
* @param maxNumberOfNetworkEvents the global default max number of {@link NetworkEvent} events
|
||||||
* NetworkEvent} events per {@link Span}. It must be positive otherwise
|
* per {@link Span}. It must be positive otherwise {@link #build()} will throw an exception.
|
||||||
* {@link #build()} will throw an exception.
|
|
||||||
* @return this.
|
* @return this.
|
||||||
* @deprecated Use {@link setMaxNumberOfMessageEvents}.
|
* @deprecated Use {@link setMaxNumberOfMessageEvents}.
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
|
|
|
||||||
|
|
@ -17,21 +17,21 @@
|
||||||
package openconsensus.trace.export;
|
package openconsensus.trace.export;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
import openconsensus.trace.Span.Options;
|
import openconsensus.trace.Span.Options;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class allows users to access in-process information about all running spans.
|
* This class allows users to access in-process information about all running spans.
|
||||||
*
|
*
|
||||||
* <p>The running spans tracking is available for all the spans with the option {@link
|
* <p>The running spans tracking is available for all the spans with the option {@link
|
||||||
* Options#RECORD_EVENTS}. This functionality allows users to debug stuck
|
* Options#RECORD_EVENTS}. This functionality allows users to debug stuck operations or long living
|
||||||
* operations or long living operations.
|
* operations.
|
||||||
*
|
*
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,6 @@
|
||||||
package openconsensus.trace.export;
|
package openconsensus.trace.export;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import openconsensus.trace.EndSpanOptions;
|
|
||||||
import openconsensus.trace.Status;
|
|
||||||
import openconsensus.trace.Status.CanonicalCode;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
@ -32,16 +28,20 @@ import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.GuardedBy;
|
import javax.annotation.concurrent.GuardedBy;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
import openconsensus.trace.EndSpanOptions;
|
||||||
import openconsensus.trace.Span.Options;
|
import openconsensus.trace.Span.Options;
|
||||||
|
import openconsensus.trace.Status;
|
||||||
|
import openconsensus.trace.Status.CanonicalCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class allows users to access in-process information such as latency based sampled spans and
|
* This class allows users to access in-process information such as latency based sampled spans and
|
||||||
* error based sampled spans.
|
* error based sampled spans.
|
||||||
*
|
*
|
||||||
* <p>For all completed spans with the option {@link Options#RECORD_EVENTS} the library can
|
* <p>For all completed spans with the option {@link Options#RECORD_EVENTS} the library can store
|
||||||
* store samples based on latency for succeeded operations or based on error code for failed
|
* samples based on latency for succeeded operations or based on error code for failed operations.
|
||||||
* operations. To activate this, users MUST manually configure all the span names for which samples
|
* To activate this, users MUST manually configure all the span names for which samples will be
|
||||||
* will be collected (see {@link #registerSpanNamesForCollection(Collection)}).
|
* collected (see {@link #registerSpanNamesForCollection(Collection)}).
|
||||||
*
|
*
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -17,18 +17,6 @@
|
||||||
package openconsensus.trace.export;
|
package openconsensus.trace.export;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
import openconsensus.common.Timestamp;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import openconsensus.trace.Annotation;
|
|
||||||
import openconsensus.trace.AttributeValue;
|
|
||||||
import openconsensus.trace.Link;
|
|
||||||
import openconsensus.trace.MessageEvent;
|
|
||||||
import openconsensus.trace.Span;
|
|
||||||
import openconsensus.trace.Span.Kind;
|
|
||||||
import openconsensus.trace.SpanContext;
|
|
||||||
import openconsensus.trace.SpanId;
|
|
||||||
import openconsensus.trace.Status;
|
|
||||||
import openconsensus.trace.internal.BaseMessageEventUtils;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
@ -36,8 +24,20 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import javax.annotation.concurrent.Immutable;
|
import javax.annotation.concurrent.Immutable;
|
||||||
|
import openconsensus.common.Timestamp;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
import openconsensus.trace.Annotation;
|
||||||
|
import openconsensus.trace.AttributeValue;
|
||||||
import openconsensus.trace.BaseMessageEvent;
|
import openconsensus.trace.BaseMessageEvent;
|
||||||
|
import openconsensus.trace.Link;
|
||||||
|
import openconsensus.trace.MessageEvent;
|
||||||
import openconsensus.trace.NetworkEvent;
|
import openconsensus.trace.NetworkEvent;
|
||||||
|
import openconsensus.trace.Span;
|
||||||
|
import openconsensus.trace.Span.Kind;
|
||||||
|
import openconsensus.trace.SpanContext;
|
||||||
|
import openconsensus.trace.SpanId;
|
||||||
|
import openconsensus.trace.Status;
|
||||||
|
import openconsensus.trace.internal.BaseMessageEventUtils;
|
||||||
|
|
||||||
/*>>>
|
/*>>>
|
||||||
import org.checkerframework.dataflow.qual.Deterministic;
|
import org.checkerframework.dataflow.qual.Deterministic;
|
||||||
|
|
@ -129,8 +129,7 @@ public abstract class SpanData {
|
||||||
@Nullable Timestamp endTimestamp) {
|
@Nullable Timestamp endTimestamp) {
|
||||||
Utils.checkNotNull(messageOrNetworkEvents, "messageOrNetworkEvents");
|
Utils.checkNotNull(messageOrNetworkEvents, "messageOrNetworkEvents");
|
||||||
List<TimedEvent<MessageEvent>> messageEventsList = new ArrayList<TimedEvent<MessageEvent>>();
|
List<TimedEvent<MessageEvent>> messageEventsList = new ArrayList<TimedEvent<MessageEvent>>();
|
||||||
for (TimedEvent<? extends BaseMessageEvent> timedEvent :
|
for (TimedEvent<? extends BaseMessageEvent> timedEvent : messageOrNetworkEvents.getEvents()) {
|
||||||
messageOrNetworkEvents.getEvents()) {
|
|
||||||
BaseMessageEvent event = timedEvent.getEvent();
|
BaseMessageEvent event = timedEvent.getEvent();
|
||||||
if (event instanceof MessageEvent) {
|
if (event instanceof MessageEvent) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|
@ -242,16 +241,14 @@ public abstract class SpanData {
|
||||||
@SuppressWarnings({"deprecation"})
|
@SuppressWarnings({"deprecation"})
|
||||||
public TimedEvents<NetworkEvent> getNetworkEvents() {
|
public TimedEvents<NetworkEvent> getNetworkEvents() {
|
||||||
TimedEvents<MessageEvent> timedEvents = getMessageEvents();
|
TimedEvents<MessageEvent> timedEvents = getMessageEvents();
|
||||||
List<TimedEvent<NetworkEvent>> networkEventsList =
|
List<TimedEvent<NetworkEvent>> networkEventsList = new ArrayList<TimedEvent<NetworkEvent>>();
|
||||||
new ArrayList<TimedEvent<NetworkEvent>>();
|
|
||||||
for (TimedEvent<MessageEvent> timedEvent : timedEvents.getEvents()) {
|
for (TimedEvent<MessageEvent> timedEvent : timedEvents.getEvents()) {
|
||||||
networkEventsList.add(
|
networkEventsList.add(
|
||||||
TimedEvent.<NetworkEvent>create(
|
TimedEvent.<NetworkEvent>create(
|
||||||
timedEvent.getTimestamp(),
|
timedEvent.getTimestamp(),
|
||||||
BaseMessageEventUtils.asNetworkEvent(timedEvent.getEvent())));
|
BaseMessageEventUtils.asNetworkEvent(timedEvent.getEvent())));
|
||||||
}
|
}
|
||||||
return TimedEvents.<NetworkEvent>create(
|
return TimedEvents.<NetworkEvent>create(networkEventsList, timedEvents.getDroppedEventsCount());
|
||||||
networkEventsList, timedEvents.getDroppedEventsCount());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,10 @@
|
||||||
|
|
||||||
package openconsensus.trace.export;
|
package openconsensus.trace.export;
|
||||||
|
|
||||||
import openconsensus.trace.Span;
|
|
||||||
import openconsensus.trace.TraceOptions;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import javax.annotation.concurrent.ThreadSafe;
|
import javax.annotation.concurrent.ThreadSafe;
|
||||||
|
import openconsensus.trace.Span;
|
||||||
|
import openconsensus.trace.TraceOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A service that is used by the library to export {@code SpanData} for all the spans that are part
|
* A service that is used by the library to export {@code SpanData} for all the spans that are part
|
||||||
|
|
|
||||||
|
|
@ -22,25 +22,20 @@ import openconsensus.trace.BaseMessageEvent;
|
||||||
import openconsensus.trace.MessageEvent;
|
import openconsensus.trace.MessageEvent;
|
||||||
import openconsensus.trace.NetworkEvent;
|
import openconsensus.trace.NetworkEvent;
|
||||||
|
|
||||||
/**
|
/** Helper class to convert/cast between for {@link MessageEvent} and {@link NetworkEvent}. */
|
||||||
* Helper class to convert/cast between for {@link MessageEvent} and {@link
|
|
||||||
* NetworkEvent}.
|
|
||||||
*/
|
|
||||||
@Internal
|
@Internal
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public final class BaseMessageEventUtils {
|
public final class BaseMessageEventUtils {
|
||||||
/**
|
/**
|
||||||
* Cast or convert a {@link BaseMessageEvent} to {@link
|
* Cast or convert a {@link BaseMessageEvent} to {@link MessageEvent}.
|
||||||
* MessageEvent}.
|
|
||||||
*
|
*
|
||||||
* <p>Warning: if the input is a {@code NetworkEvent} and contains {@code
|
* <p>Warning: if the input is a {@code NetworkEvent} and contains {@code kernelTimestamp}
|
||||||
* kernelTimestamp} information, this information will be dropped.
|
* information, this information will be dropped.
|
||||||
*
|
*
|
||||||
* @param event the {@code BaseMessageEvent} that is being cast or converted.
|
* @param event the {@code BaseMessageEvent} that is being cast or converted.
|
||||||
* @return a {@code MessageEvent} representation of the input.
|
* @return a {@code MessageEvent} representation of the input.
|
||||||
*/
|
*/
|
||||||
public static MessageEvent asMessageEvent(
|
public static MessageEvent asMessageEvent(BaseMessageEvent event) {
|
||||||
BaseMessageEvent event) {
|
|
||||||
Utils.checkNotNull(event, "event");
|
Utils.checkNotNull(event, "event");
|
||||||
if (event instanceof MessageEvent) {
|
if (event instanceof MessageEvent) {
|
||||||
return (MessageEvent) event;
|
return (MessageEvent) event;
|
||||||
|
|
@ -57,14 +52,12 @@ public final class BaseMessageEventUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cast or convert a {@link BaseMessageEvent} to {@link
|
* Cast or convert a {@link BaseMessageEvent} to {@link NetworkEvent}.
|
||||||
* NetworkEvent}.
|
|
||||||
*
|
*
|
||||||
* @param event the {@code BaseMessageEvent} that is being cast or converted.
|
* @param event the {@code BaseMessageEvent} that is being cast or converted.
|
||||||
* @return a {@code NetworkEvent} representation of the input.
|
* @return a {@code NetworkEvent} representation of the input.
|
||||||
*/
|
*/
|
||||||
public static NetworkEvent asNetworkEvent(
|
public static NetworkEvent asNetworkEvent(BaseMessageEvent event) {
|
||||||
BaseMessageEvent event) {
|
|
||||||
Utils.checkNotNull(event, "event");
|
Utils.checkNotNull(event, "event");
|
||||||
if (event instanceof NetworkEvent) {
|
if (event instanceof NetworkEvent) {
|
||||||
return (NetworkEvent) event;
|
return (NetworkEvent) event;
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
package openconsensus.trace.propagation;
|
package openconsensus.trace.propagation;
|
||||||
|
|
||||||
|
import java.text.ParseException;
|
||||||
import openconsensus.internal.Utils;
|
import openconsensus.internal.Utils;
|
||||||
import openconsensus.trace.SpanContext;
|
import openconsensus.trace.SpanContext;
|
||||||
import java.text.ParseException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a helper class for {@link SpanContext} propagation on the wire using binary encoding.
|
* This is a helper class for {@link SpanContext} propagation on the wire using binary encoding.
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,12 @@
|
||||||
|
|
||||||
package openconsensus.trace.propagation;
|
package openconsensus.trace.propagation;
|
||||||
|
|
||||||
import openconsensus.common.ExperimentalApi;
|
|
||||||
import openconsensus.internal.Utils;
|
|
||||||
import openconsensus.trace.SpanContext;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
import openconsensus.common.ExperimentalApi;
|
||||||
|
import openconsensus.internal.Utils;
|
||||||
|
import openconsensus.trace.SpanContext;
|
||||||
|
|
||||||
/*>>>
|
/*>>>
|
||||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,14 @@
|
||||||
|
|
||||||
package openconsensus.trace.samplers;
|
package openconsensus.trace.samplers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.trace.Sampler;
|
import openconsensus.trace.Sampler;
|
||||||
import openconsensus.trace.Span;
|
import openconsensus.trace.Span;
|
||||||
import openconsensus.trace.SpanContext;
|
import openconsensus.trace.SpanContext;
|
||||||
import openconsensus.trace.SpanId;
|
import openconsensus.trace.SpanId;
|
||||||
import openconsensus.trace.TraceId;
|
import openconsensus.trace.TraceId;
|
||||||
import java.util.List;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/** Sampler that always makes a "yes" decision on {@link Span} sampling. */
|
/** Sampler that always makes a "yes" decision on {@link Span} sampling. */
|
||||||
@Immutable
|
@Immutable
|
||||||
|
|
|
||||||
|
|
@ -16,14 +16,14 @@
|
||||||
|
|
||||||
package openconsensus.trace.samplers;
|
package openconsensus.trace.samplers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.trace.Sampler;
|
import openconsensus.trace.Sampler;
|
||||||
import openconsensus.trace.Span;
|
import openconsensus.trace.Span;
|
||||||
import openconsensus.trace.SpanContext;
|
import openconsensus.trace.SpanContext;
|
||||||
import openconsensus.trace.SpanId;
|
import openconsensus.trace.SpanId;
|
||||||
import openconsensus.trace.TraceId;
|
import openconsensus.trace.TraceId;
|
||||||
import java.util.List;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/** Sampler that always makes a "no" decision on {@link Span} sampling. */
|
/** Sampler that always makes a "no" decision on {@link Span} sampling. */
|
||||||
@Immutable
|
@Immutable
|
||||||
|
|
|
||||||
|
|
@ -17,15 +17,15 @@
|
||||||
package openconsensus.trace.samplers;
|
package openconsensus.trace.samplers;
|
||||||
|
|
||||||
import com.google.auto.value.AutoValue;
|
import com.google.auto.value.AutoValue;
|
||||||
|
import java.util.List;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import javax.annotation.concurrent.Immutable;
|
||||||
import openconsensus.internal.Utils;
|
import openconsensus.internal.Utils;
|
||||||
import openconsensus.trace.Sampler;
|
import openconsensus.trace.Sampler;
|
||||||
import openconsensus.trace.Span;
|
import openconsensus.trace.Span;
|
||||||
import openconsensus.trace.SpanContext;
|
import openconsensus.trace.SpanContext;
|
||||||
import openconsensus.trace.SpanId;
|
import openconsensus.trace.SpanId;
|
||||||
import openconsensus.trace.TraceId;
|
import openconsensus.trace.TraceId;
|
||||||
import java.util.List;
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
import javax.annotation.concurrent.Immutable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We assume the lower 64 bits of the traceId's are randomly distributed around the whole (long)
|
* We assume the lower 64 bits of the traceId's are randomly distributed around the whole (long)
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
/**
|
/**
|
||||||
* Util methods/functionality to interact with the {@link io.grpc.Context}.
|
* Util methods/functionality to interact with the {@link io.grpc.Context}.
|
||||||
*
|
*
|
||||||
* <p>Users must interact with the current Context via the public APIs in {@link
|
* <p>Users must interact with the current Context via the public APIs in {@link Tracer} and avoid
|
||||||
* Tracer} and avoid usages of the {@link #CONTEXT_SPAN_KEY} directly.
|
* usages of the {@link #CONTEXT_SPAN_KEY} directly.
|
||||||
*
|
*
|
||||||
* @since 0.1.0
|
* @since 0.1.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue