aboutsummaryrefslogtreecommitdiff
path: root/api/src/main
diff options
context:
space:
mode:
authorKristen Kozak <sebright@google.com>2018-01-31 09:34:02 -0800
committerKristen Kozak <sebright@google.com>2018-01-31 09:44:47 -0800
commit2a7386c27a841bd73b0e1d5bbb897f21038fe1a1 (patch)
tree6241e2199dd90953471d50d52ed6b9b710e1679c /api/src/main
parent33dcccc9279ffc2fdd8206f5d1be40188dd26c82 (diff)
downloadopencensus-java-2a7386c27a841bd73b0e1d5bbb897f21038fe1a1.tar.gz
Add '@since' Javadoc tag to all stats APIs (issue #864).
This commit also adds missing Javadocs.
Diffstat (limited to 'api/src/main')
-rw-r--r--api/src/main/java/io/opencensus/stats/Aggregation.java38
-rw-r--r--api/src/main/java/io/opencensus/stats/AggregationData.java50
-rw-r--r--api/src/main/java/io/opencensus/stats/BucketBoundaries.java8
-rw-r--r--api/src/main/java/io/opencensus/stats/Measure.java36
-rw-r--r--api/src/main/java/io/opencensus/stats/MeasureMap.java11
-rw-r--r--api/src/main/java/io/opencensus/stats/Measurement.java54
-rw-r--r--api/src/main/java/io/opencensus/stats/Stats.java20
-rw-r--r--api/src/main/java/io/opencensus/stats/StatsCollectionState.java10
-rw-r--r--api/src/main/java/io/opencensus/stats/StatsComponent.java16
-rw-r--r--api/src/main/java/io/opencensus/stats/StatsRecorder.java7
-rw-r--r--api/src/main/java/io/opencensus/stats/View.java65
-rw-r--r--api/src/main/java/io/opencensus/stats/ViewData.java55
-rw-r--r--api/src/main/java/io/opencensus/stats/ViewManager.java4
13 files changed, 327 insertions, 47 deletions
diff --git a/api/src/main/java/io/opencensus/stats/Aggregation.java b/api/src/main/java/io/opencensus/stats/Aggregation.java
index f9d2590c..1983b908 100644
--- a/api/src/main/java/io/opencensus/stats/Aggregation.java
+++ b/api/src/main/java/io/opencensus/stats/Aggregation.java
@@ -38,13 +38,19 @@ import javax.annotation.concurrent.Immutable;
*
* <p>When creating a {@link View}, one {@link Aggregation} needs to be specified as how to
* aggregate {@code MeasureValue}s.
+ *
+ * @since 0.8
*/
@Immutable
public abstract class Aggregation {
private Aggregation() {}
- /** Applies the given match function to the underlying data type. */
+ /**
+ * Applies the given match function to the underlying data type.
+ *
+ * @since 0.8
+ */
public abstract <T> T match(
Function<? super Sum, T> p0,
Function<? super Count, T> p1,
@@ -52,7 +58,11 @@ public abstract class Aggregation {
Function<? super Distribution, T> p3,
Function<? super Aggregation, T> defaultFunction);
- /** Calculate sum on aggregated {@code MeasureValue}s. */
+ /**
+ * Calculate sum on aggregated {@code MeasureValue}s.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -68,6 +78,7 @@ public abstract class Aggregation {
* Construct a {@code Sum}.
*
* @return a new {@code Sum}.
+ * @since 0.8
*/
public static Sum create() {
return INSTANCE;
@@ -84,7 +95,11 @@ public abstract class Aggregation {
}
}
- /** Calculate count on aggregated {@code MeasureValue}s. */
+ /**
+ * Calculate count on aggregated {@code MeasureValue}s.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -100,6 +115,7 @@ public abstract class Aggregation {
* Construct a {@code Count}.
*
* @return a new {@code Count}.
+ * @since 0.8
*/
public static Count create() {
return INSTANCE;
@@ -116,7 +132,11 @@ public abstract class Aggregation {
}
}
- /** Calculate mean on aggregated {@code MeasureValue}s. */
+ /**
+ * Calculate mean on aggregated {@code MeasureValue}s.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -132,6 +152,7 @@ public abstract class Aggregation {
* Construct a {@code Mean}.
*
* @return a new {@code Mean}.
+ * @since 0.8
*/
public static Mean create() {
return INSTANCE;
@@ -151,6 +172,8 @@ public abstract class Aggregation {
/**
* Calculate distribution stats on aggregated {@code MeasureValue}s. Distribution includes mean,
* count, histogram, min, max and sum of squared deviations.
+ *
+ * @since 0.8
*/
@Immutable
@AutoValue
@@ -165,12 +188,19 @@ public abstract class Aggregation {
* Construct a {@code Distribution}.
*
* @return a new {@code Distribution}.
+ * @since 0.8
*/
public static Distribution create(BucketBoundaries bucketBoundaries) {
checkNotNull(bucketBoundaries, "bucketBoundaries should not be null.");
return new AutoValue_Aggregation_Distribution(bucketBoundaries);
}
+ /**
+ * Returns the {@code Distribution}'s bucket boundaries.
+ *
+ * @return the {@code Distribution}'s bucket boundaries.
+ * @since 0.8
+ */
public abstract BucketBoundaries getBucketBoundaries();
@Override
diff --git a/api/src/main/java/io/opencensus/stats/AggregationData.java b/api/src/main/java/io/opencensus/stats/AggregationData.java
index 1ab7681c..be0df5e0 100644
--- a/api/src/main/java/io/opencensus/stats/AggregationData.java
+++ b/api/src/main/java/io/opencensus/stats/AggregationData.java
@@ -43,13 +43,19 @@ import javax.annotation.concurrent.Immutable;
*
* <p>{@link ViewData} will contain one {@link AggregationData}, corresponding to its {@link
* Aggregation} definition in {@link View}.
+ *
+ * @since 0.8
*/
@Immutable
public abstract class AggregationData {
private AggregationData() {}
- /** Applies the given match function to the underlying data type. */
+ /**
+ * Applies the given match function to the underlying data type.
+ *
+ * @since 0.8
+ */
public abstract <T> T match(
Function<? super SumDataDouble, T> p0,
Function<? super SumDataLong, T> p1,
@@ -58,7 +64,11 @@ public abstract class AggregationData {
Function<? super DistributionData, T> p4,
Function<? super AggregationData, T> defaultFunction);
- /** The sum value of aggregated {@code MeasureValueDouble}s. */
+ /**
+ * The sum value of aggregated {@code MeasureValueDouble}s.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -73,6 +83,7 @@ public abstract class AggregationData {
*
* @param sum the aggregated sum.
* @return a {@code SumDataDouble}.
+ * @since 0.8
*/
public static SumDataDouble create(double sum) {
return new AutoValue_AggregationData_SumDataDouble(sum);
@@ -82,6 +93,7 @@ public abstract class AggregationData {
* Returns the aggregated sum.
*
* @return the aggregated sum.
+ * @since 0.8
*/
public abstract double getSum();
@@ -98,7 +110,11 @@ public abstract class AggregationData {
}
}
- /** The sum value of aggregated {@code MeasureValueLong}s. */
+ /**
+ * The sum value of aggregated {@code MeasureValueLong}s.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -113,6 +129,7 @@ public abstract class AggregationData {
*
* @param sum the aggregated sum.
* @return a {@code SumDataLong}.
+ * @since 0.8
*/
public static SumDataLong create(long sum) {
return new AutoValue_AggregationData_SumDataLong(sum);
@@ -122,6 +139,7 @@ public abstract class AggregationData {
* Returns the aggregated sum.
*
* @return the aggregated sum.
+ * @since 0.8
*/
public abstract long getSum();
@@ -138,7 +156,11 @@ public abstract class AggregationData {
}
}
- /** The count value of aggregated {@code MeasureValue}s. */
+ /**
+ * The count value of aggregated {@code MeasureValue}s.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -153,6 +175,7 @@ public abstract class AggregationData {
*
* @param count the aggregated count.
* @return a {@code CountData}.
+ * @since 0.8
*/
public static CountData create(long count) {
return new AutoValue_AggregationData_CountData(count);
@@ -162,6 +185,7 @@ public abstract class AggregationData {
* Returns the aggregated count.
*
* @return the aggregated count.
+ * @since 0.8
*/
public abstract long getCount();
@@ -178,7 +202,11 @@ public abstract class AggregationData {
}
}
- /** The mean value of aggregated {@code MeasureValue}s. */
+ /**
+ * The mean value of aggregated {@code MeasureValue}s.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -194,6 +222,7 @@ public abstract class AggregationData {
* @param mean the aggregated mean.
* @param count the aggregated count.
* @return a {@code MeanData}.
+ * @since 0.8
*/
public static MeanData create(double mean, long count) {
return new AutoValue_AggregationData_MeanData(mean, count);
@@ -203,6 +232,7 @@ public abstract class AggregationData {
* Returns the aggregated mean.
*
* @return the aggregated mean.
+ * @since 0.8
*/
public abstract double getMean();
@@ -210,6 +240,7 @@ public abstract class AggregationData {
* Returns the aggregated count.
*
* @return the aggregated count.
+ * @since 0.8
*/
public abstract long getCount();
@@ -229,6 +260,8 @@ public abstract class AggregationData {
/**
* The distribution stats of aggregated {@code MeasureValue}s. Distribution stats include mean,
* count, histogram, min, max and sum of squared deviations.
+ *
+ * @since 0.8
*/
@Immutable
@AutoValue
@@ -249,6 +282,7 @@ public abstract class AggregationData {
* @param sumOfSquaredDeviations sum of squared deviations.
* @param bucketCounts histogram bucket counts.
* @return a {@code DistributionData}.
+ * @since 0.8
*/
public static DistributionData create(
double mean,
@@ -275,6 +309,7 @@ public abstract class AggregationData {
* Returns the aggregated mean.
*
* @return the aggregated mean.
+ * @since 0.8
*/
public abstract double getMean();
@@ -282,6 +317,7 @@ public abstract class AggregationData {
* Returns the aggregated count.
*
* @return the aggregated count.
+ * @since 0.8
*/
public abstract long getCount();
@@ -289,6 +325,7 @@ public abstract class AggregationData {
* Returns the minimum of the population values.
*
* @return the minimum of the population values.
+ * @since 0.8
*/
public abstract double getMin();
@@ -296,6 +333,7 @@ public abstract class AggregationData {
* Returns the maximum of the population values.
*
* @return the maximum of the population values.
+ * @since 0.8
*/
public abstract double getMax();
@@ -303,6 +341,7 @@ public abstract class AggregationData {
* Returns the aggregated sum of squared deviations.
*
* @return the aggregated sum of squared deviations.
+ * @since 0.8
*/
public abstract double getSumOfSquaredDeviations();
@@ -311,6 +350,7 @@ public abstract class AggregationData {
* will throw an {@code UnsupportedOperationException}.
*
* @return the aggregated bucket counts.
+ * @since 0.8
*/
public abstract List<Long> getBucketCounts();
diff --git a/api/src/main/java/io/opencensus/stats/BucketBoundaries.java b/api/src/main/java/io/opencensus/stats/BucketBoundaries.java
index 664c821f..01ec6db7 100644
--- a/api/src/main/java/io/opencensus/stats/BucketBoundaries.java
+++ b/api/src/main/java/io/opencensus/stats/BucketBoundaries.java
@@ -25,7 +25,11 @@ import java.util.Collections;
import java.util.List;
import javax.annotation.concurrent.Immutable;
-/** The bucket boundaries for a histogram. */
+/**
+ * The bucket boundaries for a histogram.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -38,6 +42,7 @@ public abstract class BucketBoundaries {
* @return a new {@code BucketBoundaries} with the specified boundaries.
* @throws NullPointerException if {@code bucketBoundaries} is null.
* @throws IllegalArgumentException if {@code bucketBoundaries} is not sorted.
+ * @since 0.8
*/
public static final BucketBoundaries create(List<Double> bucketBoundaries) {
checkNotNull(bucketBoundaries, "bucketBoundaries list should not be null.");
@@ -58,6 +63,7 @@ public abstract class BucketBoundaries {
* Returns a list of histogram bucket boundaries.
*
* @return a list of histogram bucket boundaries.
+ * @since 0.8
*/
public abstract List<Double> getBoundaries();
}
diff --git a/api/src/main/java/io/opencensus/stats/Measure.java b/api/src/main/java/io/opencensus/stats/Measure.java
index b7b6c187..3cbbedef 100644
--- a/api/src/main/java/io/opencensus/stats/Measure.java
+++ b/api/src/main/java/io/opencensus/stats/Measure.java
@@ -25,13 +25,21 @@ import io.opencensus.internal.CheckerFrameworkUtils;
import io.opencensus.internal.StringUtil;
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.
+ *
+ * @since 0.8
+ */
@Immutable
public abstract class Measure {
@VisibleForTesting static final int NAME_MAX_LENGTH = 255;
- /** Applies the given match function to the underlying data type. */
+ /**
+ * Applies the given match function to the underlying data type.
+ *
+ * @since 0.8
+ */
public abstract <T> T match(
Function<? super MeasureDouble, T> p0,
Function<? super MeasureLong, T> p1,
@@ -42,10 +50,16 @@ public abstract class Measure {
* 255 characters.
*
* <p>Suggested format for name: {@code <web_host>/<path>}.
+ *
+ * @since 0.8
*/
public abstract String getName();
- /** Detailed description of the measure, used in documentation. */
+ /**
+ * Detailed description of the measure, used in documentation.
+ *
+ * @since 0.8
+ */
public abstract String getDescription();
/**
@@ -61,6 +75,8 @@ public abstract class Measure {
*
* <p>For example, string “MBy{transmitted}/ms” stands for megabytes per milliseconds, and the
* annotation transmitted inside {} is just a comment of the unit.
+ *
+ * @since 0.8
*/
// TODO(songya): determine whether we want to check the grammar on string unit.
public abstract String getUnit();
@@ -68,7 +84,11 @@ public abstract class Measure {
// Prevents this class from being subclassed anywhere else.
private Measure() {}
- /** {@link Measure} with {@code Double} typed values. */
+ /**
+ * {@link Measure} with {@code Double} typed values.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -85,6 +105,7 @@ public abstract class Measure {
* @param description description of {@code Measure}.
* @param unit unit of {@code Measure}.
* @return a {@code MeasureDouble}.
+ * @since 0.8
*/
public static MeasureDouble create(String name, String description, String unit) {
checkArgument(
@@ -114,7 +135,11 @@ public abstract class Measure {
public abstract String getUnit();
}
- /** {@link Measure} with {@code Long} typed values. */
+ /**
+ * {@link Measure} with {@code Long} typed values.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -131,6 +156,7 @@ public abstract class Measure {
* @param description description of {@code Measure}.
* @param unit unit of {@code Measure}.
* @return a {@code MeasureLong}.
+ * @since 0.8
*/
public static MeasureLong create(String name, String description, String unit) {
checkArgument(
diff --git a/api/src/main/java/io/opencensus/stats/MeasureMap.java b/api/src/main/java/io/opencensus/stats/MeasureMap.java
index 03e55092..a7430537 100644
--- a/api/src/main/java/io/opencensus/stats/MeasureMap.java
+++ b/api/src/main/java/io/opencensus/stats/MeasureMap.java
@@ -21,7 +21,11 @@ import io.opencensus.stats.Measure.MeasureLong;
import io.opencensus.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.
+ *
+ * @since 0.8
+ */
@NotThreadSafe
public abstract class MeasureMap {
@@ -32,6 +36,7 @@ public abstract class MeasureMap {
* @param measure the {@link MeasureDouble}
* @param value the value to be associated with {@code measure}
* @return this
+ * @since 0.8
*/
public abstract MeasureMap put(MeasureDouble measure, double value);
@@ -42,6 +47,7 @@ public abstract class MeasureMap {
* @param measure the {@link MeasureLong}
* @param value the value to be associated with {@code measure}
* @return this
+ * @since 0.8
*/
public abstract MeasureMap put(MeasureLong measure, long value);
@@ -49,6 +55,8 @@ public abstract class MeasureMap {
* Records all of the measures at the same time, with the current {@link TagContext}.
*
* <p>This method records all of the stats in the {@code MeasureMap} every time it is called.
+ *
+ * @since 0.8
*/
public abstract void record();
@@ -58,6 +66,7 @@ public abstract class MeasureMap {
* <p>This method records all of the stats in the {@code MeasureMap} every time it is called.
*
* @param tags the tags associated with the measurements.
+ * @since 0.8
*/
public abstract void record(TagContext tags);
}
diff --git a/api/src/main/java/io/opencensus/stats/Measurement.java b/api/src/main/java/io/opencensus/stats/Measurement.java
index 2d9dcf02..2f2421cd 100644
--- a/api/src/main/java/io/opencensus/stats/Measurement.java
+++ b/api/src/main/java/io/opencensus/stats/Measurement.java
@@ -23,23 +23,39 @@ import io.opencensus.stats.Measure.MeasureDouble;
import io.opencensus.stats.Measure.MeasureLong;
import javax.annotation.concurrent.Immutable;
-/** Immutable representation of a Measurement. */
+/**
+ * Immutable representation of a Measurement.
+ *
+ * @since 0.8
+ */
@Immutable
public abstract class Measurement {
- /** Applies the given match function to the underlying data type. */
+ /**
+ * Applies the given match function to the underlying data type.
+ *
+ * @since 0.8
+ */
public abstract <T> T match(
Function<? super MeasurementDouble, T> p0,
Function<? super MeasurementLong, T> p1,
Function<? super Measurement, T> defaultFunction);
- /** Extracts the measured {@link Measure}. */
+ /**
+ * Extracts the measured {@link Measure}.
+ *
+ * @since 0.8
+ */
public abstract Measure getMeasure();
// Prevents this class from being subclassed anywhere else.
private Measurement() {}
- /** {@code Double} typed {@link Measurement}. */
+ /**
+ * {@code Double} typed {@link Measurement}.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -48,7 +64,11 @@ public abstract class Measurement {
public abstract static class MeasurementDouble extends Measurement {
MeasurementDouble() {}
- /** Constructs a new {@link MeasurementDouble}. */
+ /**
+ * Constructs a new {@link MeasurementDouble}.
+ *
+ * @since 0.8
+ */
public static MeasurementDouble create(MeasureDouble measure, double value) {
return new AutoValue_Measurement_MeasurementDouble(measure, value);
}
@@ -56,6 +76,12 @@ public abstract class Measurement {
@Override
public abstract MeasureDouble getMeasure();
+ /**
+ * Returns the value for the measure.
+ *
+ * @return the value for the measure.
+ * @since 0.8
+ */
public abstract double getValue();
@Override
@@ -68,7 +94,11 @@ public abstract class Measurement {
}
}
- /** {@code Long} typed {@link Measurement}. */
+ /**
+ * {@code Long} typed {@link Measurement}.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -77,7 +107,11 @@ public abstract class Measurement {
public abstract static class MeasurementLong extends Measurement {
MeasurementLong() {}
- /** Constructs a new {@link MeasurementLong}. */
+ /**
+ * Constructs a new {@link MeasurementLong}.
+ *
+ * @since 0.8
+ */
public static MeasurementLong create(MeasureLong measure, long value) {
return new AutoValue_Measurement_MeasurementLong(measure, value);
}
@@ -85,6 +119,12 @@ public abstract class Measurement {
@Override
public abstract MeasureLong getMeasure();
+ /**
+ * Returns the value for the measure.
+ *
+ * @return the value for the measure.
+ * @since 0.8
+ */
public abstract long getValue();
@Override
diff --git a/api/src/main/java/io/opencensus/stats/Stats.java b/api/src/main/java/io/opencensus/stats/Stats.java
index 185b9e33..4b7852ce 100644
--- a/api/src/main/java/io/opencensus/stats/Stats.java
+++ b/api/src/main/java/io/opencensus/stats/Stats.java
@@ -22,19 +22,31 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.Nullable;
-/** Class for accessing the default {@link StatsComponent}. */
+/**
+ * Class for accessing the default {@link StatsComponent}.
+ *
+ * @since 0.8
+ */
public final class Stats {
private static final Logger logger = Logger.getLogger(Stats.class.getName());
private static final StatsComponent statsComponent =
loadStatsComponent(StatsComponent.class.getClassLoader());
- /** Returns the default {@link StatsRecorder}. */
+ /**
+ * Returns the default {@link StatsRecorder}.
+ *
+ * @since 0.8
+ */
public static StatsRecorder getStatsRecorder() {
return statsComponent.getStatsRecorder();
}
- /** Returns the default {@link ViewManager}. */
+ /**
+ * Returns the default {@link ViewManager}.
+ *
+ * @since 0.8
+ */
public static ViewManager getViewManager() {
return statsComponent.getViewManager();
}
@@ -49,6 +61,7 @@ public final class Stats {
* #setState(StatsCollectionState)} will throw an {@code IllegalStateException}.
*
* @return the current {@code StatsCollectionState}.
+ * @since 0.8
*/
public static StatsCollectionState getState() {
return statsComponent.getState();
@@ -68,6 +81,7 @@ public final class Stats {
* #getState()}, use a stale value, and behave incorrectly. It is only safe to call early in
* initialization. This method throws {@link IllegalStateException} after {@code getState()}
* has been called, in order to limit changes to the result of {@code getState()}.
+ * @since 0.8
*/
@Deprecated
public static void setState(StatsCollectionState state) {
diff --git a/api/src/main/java/io/opencensus/stats/StatsCollectionState.java b/api/src/main/java/io/opencensus/stats/StatsCollectionState.java
index 7e5641b1..6b2f2409 100644
--- a/api/src/main/java/io/opencensus/stats/StatsCollectionState.java
+++ b/api/src/main/java/io/opencensus/stats/StatsCollectionState.java
@@ -16,13 +16,19 @@
package io.opencensus.stats;
-/** State of the {@link StatsComponent}. */
+/**
+ * State of the {@link StatsComponent}.
+ *
+ * @since 0.8
+ */
public enum StatsCollectionState {
/**
* State that fully enables stats collection.
*
* <p>The {@link StatsComponent} collects stats for registered views.
+ *
+ * @since 0.8
*/
ENABLED,
@@ -31,6 +37,8 @@ public enum StatsCollectionState {
*
* <p>The {@link StatsComponent} does not need to collect stats for registered views and may
* return empty {@link ViewData}s from {@link ViewManager#getView(View.Name)}.
+ *
+ * @since 0.8
*/
DISABLED
}
diff --git a/api/src/main/java/io/opencensus/stats/StatsComponent.java b/api/src/main/java/io/opencensus/stats/StatsComponent.java
index 6d95d4e3..9764fce5 100644
--- a/api/src/main/java/io/opencensus/stats/StatsComponent.java
+++ b/api/src/main/java/io/opencensus/stats/StatsComponent.java
@@ -20,13 +20,23 @@ package io.opencensus.stats;
* Class that holds the implementations for {@link ViewManager} and {@link StatsRecorder}.
*
* <p>All objects returned by methods on {@code StatsComponent} are cacheable.
+ *
+ * @since 0.8
*/
public abstract class StatsComponent {
- /** Returns the default {@link ViewManager}. */
+ /**
+ * Returns the default {@link ViewManager}.
+ *
+ * @since 0.8
+ */
public abstract ViewManager getViewManager();
- /** Returns the default {@link StatsRecorder}. */
+ /**
+ * Returns the default {@link StatsRecorder}.
+ *
+ * @since 0.8
+ */
public abstract StatsRecorder getStatsRecorder();
/**
@@ -39,6 +49,7 @@ public abstract class StatsComponent {
* #setState(StatsCollectionState)} will throw an {@code IllegalStateException}.
*
* @return the current {@code StatsCollectionState}.
+ * @since 0.8
*/
public abstract StatsCollectionState getState();
@@ -56,6 +67,7 @@ public abstract class StatsComponent {
* #getState()}, use a stale value, and behave incorrectly. It is only safe to call early in
* initialization. This method throws {@link IllegalStateException} after {@code getState()}
* has been called, in order to limit changes to the result of {@code getState()}.
+ * @since 0.8
*/
@Deprecated
public abstract void setState(StatsCollectionState state);
diff --git a/api/src/main/java/io/opencensus/stats/StatsRecorder.java b/api/src/main/java/io/opencensus/stats/StatsRecorder.java
index 493d7ac1..87b8c8b0 100644
--- a/api/src/main/java/io/opencensus/stats/StatsRecorder.java
+++ b/api/src/main/java/io/opencensus/stats/StatsRecorder.java
@@ -16,7 +16,11 @@
package io.opencensus.stats;
-/** Provides methods to record stats against tags. */
+/**
+ * Provides methods to record stats against tags.
+ *
+ * @since 0.8
+ */
public abstract class StatsRecorder {
// TODO(sebright): Should we provide convenience methods for only recording one measure?
@@ -24,6 +28,7 @@ public abstract class StatsRecorder {
* Returns an object for recording multiple measurements.
*
* @return an object for recording multiple measurements.
+ * @since 0.8
*/
public abstract MeasureMap newMeasureMap();
}
diff --git a/api/src/main/java/io/opencensus/stats/View.java b/api/src/main/java/io/opencensus/stats/View.java
index 0ab29e5e..78eff4ef 100644
--- a/api/src/main/java/io/opencensus/stats/View.java
+++ b/api/src/main/java/io/opencensus/stats/View.java
@@ -34,6 +34,8 @@ import javax.annotation.concurrent.Immutable;
/**
* A View specifies an aggregation and a set of tag keys. The aggregation will be broken down by the
* unique set of matching tag values for each measure.
+ *
+ * @since 0.8
*/
@Immutable
@AutoValue
@@ -46,16 +48,32 @@ public abstract class View {
View() {}
- /** Name of view. Must be unique. */
+ /**
+ * Name of view. Must be unique.
+ *
+ * @since 0.8
+ */
public abstract Name getName();
- /** More detailed description, for documentation purposes. */
+ /**
+ * More detailed description, for documentation purposes.
+ *
+ * @since 0.8
+ */
public abstract String getDescription();
- /** Measure type of this view. */
+ /**
+ * Measure type of this view.
+ *
+ * @since 0.8
+ */
public abstract Measure getMeasure();
- /** The {@link Aggregation} associated with this {@link View}. */
+ /**
+ * The {@link Aggregation} associated with this {@link View}.
+ *
+ * @since 0.8
+ */
public abstract Aggregation getAggregation();
/**
@@ -63,6 +81,8 @@ public abstract class View {
*
* <p>{@link Measure} will be recorded in a "greedy" way. That is, every view aggregates every
* measure. This is similar to doing a GROUPBY on view’s columns. Columns must be unique.
+ *
+ * @since 0.8
*/
public abstract List<TagKey> getColumns();
@@ -70,6 +90,7 @@ public abstract class View {
* Returns the time {@link AggregationWindow} for this {@code View}.
*
* @return the time {@link AggregationWindow}.
+ * @since 0.8
*/
public abstract AggregationWindow getWindow();
@@ -84,6 +105,7 @@ public abstract class View {
* duplicates.
* @param window the {@link AggregationWindow} of view.
* @return a new {@link View}.
+ * @since 0.8
*/
public static View create(
Name name,
@@ -103,7 +125,11 @@ public abstract class View {
window);
}
- /** The name of a {@code View}. */
+ /**
+ * The name of a {@code View}.
+ *
+ * @since 0.8
+ */
// This type should be used as the key when associating data with Views.
@Immutable
@AutoValue
@@ -118,6 +144,7 @@ public abstract class View {
* Returns the name as a {@code String}.
*
* @return the name as a {@code String}.
+ * @since 0.8
*/
public abstract String asString();
@@ -129,6 +156,7 @@ public abstract class View {
*
* @param name the name {@code String}.
* @return a {@code View.Name} with the given name {@code String}.
+ * @since 0.8
*/
public static Name create(String name) {
checkArgument(
@@ -138,19 +166,31 @@ public abstract class View {
}
}
- /** The time window for a {@code View}. */
+ /**
+ * The time window for a {@code View}.
+ *
+ * @since 0.8
+ */
@Immutable
public abstract static class AggregationWindow {
private AggregationWindow() {}
- /** Applies the given match function to the underlying data type. */
+ /**
+ * Applies the given match function to the underlying data type.
+ *
+ * @since 0.8
+ */
public abstract <T> T match(
Function<? super Cumulative, T> p0,
Function<? super Interval, T> p1,
Function<? super AggregationWindow, T> defaultFunction);
- /** Cumulative (infinite interval) time {@code AggregationWindow}. */
+ /**
+ * Cumulative (infinite interval) time {@code AggregationWindow}.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -169,6 +209,7 @@ public abstract class View {
* {@code Duration}.
*
* @return a cumulative {@code AggregationWindow}.
+ * @since 0.8
*/
public static Cumulative create() {
return CUMULATIVE;
@@ -184,7 +225,11 @@ public abstract class View {
}
}
- /** Interval (finite interval) time {@code AggregationWindow.} */
+ /**
+ * Interval (finite interval) time {@code AggregationWindow}.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -200,6 +245,7 @@ public abstract class View {
* Returns the {@code Duration} associated with this {@code Interval}.
*
* @return a {@code Duration}.
+ * @since 0.8
*/
public abstract Duration getDuration();
@@ -211,6 +257,7 @@ public abstract class View {
* cannot have smaller {@code Duration} such as microseconds or nanoseconds.
*
* @return an interval {@code AggregationWindow}.
+ * @since 0.8
*/
public static Interval create(Duration duration) {
checkArgument(duration.compareTo(ZERO) > 0, "Duration must be positive");
diff --git a/api/src/main/java/io/opencensus/stats/ViewData.java b/api/src/main/java/io/opencensus/stats/ViewData.java
index f383fff5..2e5e4a42 100644
--- a/api/src/main/java/io/opencensus/stats/ViewData.java
+++ b/api/src/main/java/io/opencensus/stats/ViewData.java
@@ -48,7 +48,11 @@ import javax.annotation.concurrent.Immutable;
import org.checkerframework.checker.nullness.qual.Nullable;
*/
-/** The aggregated data for a particular {@link View}. */
+/**
+ * The aggregated data for a particular {@link View}.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -59,12 +63,18 @@ public abstract class ViewData {
// Prevents this class from being subclassed anywhere else.
ViewData() {}
- /** The {@link View} associated with this {@link ViewData}. */
+ /**
+ * The {@link View} associated with this {@link ViewData}.
+ *
+ * @since 0.8
+ */
public abstract View getView();
/**
* The {@link AggregationData} grouped by combination of tag values, associated with this {@link
* ViewData}.
+ *
+ * @since 0.8
*/
public abstract Map<List<TagValue>, AggregationData> getAggregationMap();
@@ -72,6 +82,7 @@ public abstract class ViewData {
* Returns the {@link AggregationWindowData} associated with this {@link ViewData}.
*
* @return the {@code AggregationWindowData}.
+ * @since 0.8
*/
public abstract AggregationWindowData getWindowData();
@@ -85,6 +96,7 @@ public abstract class ViewData {
* @throws IllegalArgumentException if the types of {@code Aggregation} and {@code
* AggregationData} don't match, or the types of {@code Window} and {@code WindowData} don't
* match.
+ * @since 0.8
*/
public static ViewData create(
View view,
@@ -201,19 +213,31 @@ public abstract class ViewData {
+ aggregationData;
}
- /** The {@code AggregationWindowData} for a {@link ViewData}. */
+ /**
+ * The {@code AggregationWindowData} for a {@link ViewData}.
+ *
+ * @since 0.8
+ */
@Immutable
public abstract static class AggregationWindowData {
private AggregationWindowData() {}
- /** Applies the given match function to the underlying data type. */
+ /**
+ * Applies the given match function to the underlying data type.
+ *
+ * @since 0.8
+ */
public abstract <T> T match(
Function<? super CumulativeData, T> p0,
Function<? super IntervalData, T> p1,
Function<? super AggregationWindowData, T> defaultFunction);
- /** Cumulative {@code AggregationWindowData.} */
+ /**
+ * Cumulative {@code AggregationWindowData}.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -227,6 +251,7 @@ public abstract class ViewData {
* Returns the start {@code Timestamp} for a {@link CumulativeData}.
*
* @return the start {@code Timestamp}.
+ * @since 0.8
*/
public abstract Timestamp getStart();
@@ -234,6 +259,7 @@ public abstract class ViewData {
* Returns the end {@code Timestamp} for a {@link CumulativeData}.
*
* @return the end {@code Timestamp}.
+ * @since 0.8
*/
public abstract Timestamp getEnd();
@@ -246,7 +272,11 @@ public abstract class ViewData {
.apply(this);
}
- /** Constructs a new {@link CumulativeData}. */
+ /**
+ * Constructs a new {@link CumulativeData}.
+ *
+ * @since 0.8
+ */
public static CumulativeData create(Timestamp start, Timestamp end) {
if (start.compareTo(end) > 0) {
throw new IllegalArgumentException("Start time is later than end time.");
@@ -255,7 +285,11 @@ public abstract class ViewData {
}
}
- /** Interval {@code AggregationWindowData.} */
+ /**
+ * Interval {@code AggregationWindowData}.
+ *
+ * @since 0.8
+ */
@Immutable
@AutoValue
// Suppress Checker Framework warning about missing @Nullable in generated equals method.
@@ -269,6 +303,7 @@ public abstract class ViewData {
* Returns the end {@code Timestamp} for an {@link IntervalData}.
*
* @return the end {@code Timestamp}.
+ * @since 0.8
*/
public abstract Timestamp getEnd();
@@ -281,7 +316,11 @@ public abstract class ViewData {
.apply(this);
}
- /** Constructs a new {@link IntervalData}. */
+ /**
+ * Constructs a new {@link IntervalData}.
+ *
+ * @since 0.8
+ */
public static IntervalData create(Timestamp end) {
return new AutoValue_ViewData_AggregationWindowData_IntervalData(end);
}
diff --git a/api/src/main/java/io/opencensus/stats/ViewManager.java b/api/src/main/java/io/opencensus/stats/ViewManager.java
index a6e18b89..a00165cc 100644
--- a/api/src/main/java/io/opencensus/stats/ViewManager.java
+++ b/api/src/main/java/io/opencensus/stats/ViewManager.java
@@ -22,6 +22,8 @@ import javax.annotation.Nullable;
/**
* Provides facilities to register {@link View}s for collecting stats and retrieving stats data as a
* {@link ViewData}.
+ *
+ * @since 0.8
*/
public abstract class ViewManager {
/**
@@ -29,6 +31,7 @@ public abstract class ViewManager {
* #getView(View.Name)}.
*
* @param view the {@code View} to be registered.
+ * @since 0.8
*/
public abstract void registerView(View view);
@@ -40,6 +43,7 @@ public abstract class ViewManager {
* @param view the name of {@code View} for the current stats.
* @return {@code ViewData} for the {@code View}, or {@code null} if the {@code View} is not
* registered.
+ * @since 0.8
*/
@Nullable
public abstract ViewData getView(View.Name view);