-
Notifications
You must be signed in to change notification settings - Fork 848
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
97 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/View.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.sdk.metrics.view; | ||
|
||
import com.google.auto.value.AutoValue; | ||
import io.opentelemetry.sdk.metrics.aggregator.AggregatorFactory; | ||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** TODO: javadoc. */ | ||
@AutoValue | ||
@Immutable | ||
public abstract class View { | ||
public abstract AggregatorFactory getAggregatorFactory(); | ||
|
||
public static ViewBuilder builder() { | ||
return new ViewBuilder(); | ||
} | ||
|
||
static View create(AggregatorFactory aggregatorFactory) { | ||
return new AutoValue_View(aggregatorFactory); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/view/ViewBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.sdk.metrics.view; | ||
|
||
import io.opentelemetry.sdk.metrics.aggregator.AggregatorFactory; | ||
import java.util.Objects; | ||
|
||
public final class ViewBuilder { | ||
private AggregatorFactory aggregatorFactory; | ||
|
||
ViewBuilder() {} | ||
|
||
public ViewBuilder setAggregatorFactory(AggregatorFactory aggregatorFactory) { | ||
this.aggregatorFactory = Objects.requireNonNull(aggregatorFactory, "aggregatorFactory"); | ||
return this; | ||
} | ||
|
||
public View build() { | ||
return View.create(this.aggregatorFactory); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters