-
Notifications
You must be signed in to change notification settings - Fork 42
feat: add parquet source metrics #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lavkesh
merged 49 commits into
dagger-parquet-file-processing
from
feat/issue#108-add-parquet-source-metrics
Jul 18, 2022
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
5eccb23
feat: initial hit and trial for publishing reader metrics
Meghajit 7f26745
Revert "feat: initial hit and trial for publishing reader metrics"
Meghajit 9d0c8e8
feat: check if open is called
Meghajit d196fb0
Revert "feat: check if open is called"
Meghajit acceed9
feat: refactor package names
Meghajit 579139e
feat: exclude dogstatsd from stencil and use custom version
Meghajit ffb60ec
feat: implement metrics via dogstatsd
Meghajit f1a5572
feat: cache the global tags for perf reasons
Meghajit a6cee08
feat: use Depot and remove dogstatsd
Meghajit b2ebf92
feat: add depot to minimalJar
Meghajit 1a7590a
feat: revert package name
Meghajit af18a80
feat: remove dogstatsd from dagger-common
Meghajit 13ace76
feat: fix indentation
Meghajit 5f08109
feat: create inner class for provider
Meghajit 92b36bb
feat: use statsd.increment method instead of captureCount
Meghajit 53f7cc3
feat: use statsdReporter directly instead of client
Meghajit 72da9a5
feat: use = as tag separator
Meghajit 0f32e00
feat: use = as tag separator
Meghajit ec6bd63
feat: delete dagger source tag
Meghajit 20b607b
feat: delete unused register method from interface
Meghajit cfd01d6
feat: add StatsDErrorReporter
Meghajit 94383b8
feat: add exception message to measurement as well
Meghajit 2178281
feat: remove exception message measurement
Meghajit 4ff6048
feat: report errors with exception class as tag value
Meghajit 4aaafb2
feat: capture and report fatal exceptions
Meghajit a724c9d
feat: fix broken tests and checkstyle issues
Meghajit 36f237c
feat: rename interface method
Meghajit e8f9602
feat: add tests for DaggerStatsDReporter
Meghajit 365c533
feat: add tests for DaggerMetricsConfig
Meghajit cea2b4b
feat: add tests for DaggerCounterManager
Meghajit 9fd9004
feat: add a close method to DaggerStatsDReporter for cleanup
Meghajit e13ed52
feat: delete meter measurement
Meghajit cf1d76d
feat: add tests for DaggerGaugeManager
Meghajit 1529f0d
feat: add tests for DaggerHistogramManager
Meghajit fa9f19d
feat: make instance variable final in tests
Meghajit c329488
feat: change exception message
Meghajit 482c833
feat: add tests for StatsDErrorReporter
Meghajit 1308032
feat: add tests for ChronologyOrderedSplitAssigner
Meghajit 5085eb4
feat: add tests for StatsDTag
Meghajit 230c3f8
feat: add error reporter tests for DaggerSourceFactory
Meghajit 5e76f05
feat: add error reporter tests for ParquetDaggerSource
Meghajit 5704371
feat: add error reporter tests for ParquetFileRecordFormat
Meghajit 6acf9db
feat: add error reporter tests for ParquetFileSource
Meghajit 9e98b97
feat: add error reporter tests for ParquetReader
Meghajit b854022
feat: delete unused measurements
Meghajit a4cd687
feat: use lambda to provide error reporter in ParquetFileRecordFormat
Meghajit 2aafa62
doc: add documentation for metrics
Meghajit 9ea2d29
doc: add parquet source metrics dashboard
Meghajit 87ed606
feat: refactor methods
Meghajit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
28 changes: 28 additions & 0 deletions
28
.../main/java/io/odpf/dagger/core/metrics/aspects/ChronologyOrderedSplitAssignerAspects.java
This file contains hidden or 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,28 @@ | ||
| package io.odpf.dagger.core.metrics.aspects; | ||
|
|
||
| import io.odpf.dagger.common.metrics.aspects.AspectType; | ||
| import io.odpf.dagger.common.metrics.aspects.Aspects; | ||
|
|
||
| public enum ChronologyOrderedSplitAssignerAspects implements Aspects { | ||
| TOTAL_SPLITS_DISCOVERED("total_splits_discovered", AspectType.Gauge), | ||
| TOTAL_SPLITS_RECORDED("total_splits_recorded", AspectType.Gauge), | ||
| SPLITS_AWAITING_ASSIGNMENT("splits_awaiting_assignment", AspectType.Counter); | ||
|
|
||
| ChronologyOrderedSplitAssignerAspects(String value, AspectType aspectType) { | ||
| this.value = value; | ||
| this.aspectType = aspectType; | ||
| } | ||
|
|
||
| private final String value; | ||
| private final AspectType aspectType; | ||
|
|
||
| @Override | ||
| public String getValue() { | ||
| return value; | ||
| } | ||
|
|
||
| @Override | ||
| public AspectType getAspectType() { | ||
| return aspectType; | ||
| } | ||
| } |
30 changes: 30 additions & 0 deletions
30
dagger-core/src/main/java/io/odpf/dagger/core/metrics/aspects/ParquetReaderAspects.java
This file contains hidden or 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,30 @@ | ||
| package io.odpf.dagger.core.metrics.aspects; | ||
|
|
||
| import io.odpf.dagger.common.metrics.aspects.AspectType; | ||
| import io.odpf.dagger.common.metrics.aspects.Aspects; | ||
|
|
||
| public enum ParquetReaderAspects implements Aspects { | ||
| READER_CREATED("reader_created", AspectType.Counter), | ||
| READER_CLOSED("reader_closed", AspectType.Counter), | ||
| READER_ROWS_EMITTED("reader_rows_emitted", AspectType.Counter), | ||
| READER_ROW_DESERIALIZATION_TIME("reader_row_deserialization_time", AspectType.Histogram), | ||
| READER_ROW_READ_TIME("reader_row_read_time", AspectType.Histogram); | ||
|
|
||
| private final String value; | ||
| private final AspectType aspectType; | ||
|
|
||
| ParquetReaderAspects(String value, AspectType aspectType) { | ||
| this.value = value; | ||
| this.aspectType = aspectType; | ||
| } | ||
|
|
||
| @Override | ||
| public String getValue() { | ||
| return value; | ||
| } | ||
|
|
||
| @Override | ||
| public AspectType getAspectType() { | ||
| return aspectType; | ||
| } | ||
| } |
43 changes: 43 additions & 0 deletions
43
...-core/src/main/java/io/odpf/dagger/core/metrics/reporters/statsd/DaggerMetricsConfig.java
This file contains hidden or 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,43 @@ | ||
| package io.odpf.dagger.core.metrics.reporters.statsd; | ||
|
|
||
| import io.odpf.depot.config.MetricsConfig; | ||
| import org.apache.flink.configuration.ConfigOption; | ||
| import org.apache.flink.configuration.ConfigOptions; | ||
| import org.apache.flink.configuration.Configuration; | ||
|
|
||
| public class DaggerMetricsConfig implements MetricsConfig { | ||
| private static final String FLINK_STATSD_HOST_CONFIG_KEY = "metrics.reporter.stsd.host"; | ||
| private static final String DEFAULT_STATSD_HOST_VALUE = "localhost"; | ||
| private static final String FLINK_STATSD_PORT_CONFIG_KEY = "metrics.reporter.stsd.port"; | ||
| private static final int DEFAULT_STATSD_PORT_VALUE = 8125; | ||
| private final String hostName; | ||
| private final int port; | ||
|
|
||
| public DaggerMetricsConfig(Configuration flinkConfiguration) { | ||
| ConfigOption<String> hostConfigOption = ConfigOptions | ||
| .key(FLINK_STATSD_HOST_CONFIG_KEY) | ||
| .stringType() | ||
| .defaultValue(DEFAULT_STATSD_HOST_VALUE); | ||
| ConfigOption<Integer> portConfigOption = ConfigOptions | ||
| .key(FLINK_STATSD_PORT_CONFIG_KEY) | ||
| .intType() | ||
| .defaultValue(DEFAULT_STATSD_PORT_VALUE); | ||
| this.hostName = flinkConfiguration.getString(hostConfigOption); | ||
| this.port = flinkConfiguration.getInteger(portConfigOption); | ||
| } | ||
|
|
||
| @Override | ||
| public String getMetricStatsDHost() { | ||
| return hostName; | ||
| } | ||
|
|
||
| @Override | ||
| public Integer getMetricStatsDPort() { | ||
| return port; | ||
| } | ||
|
|
||
| @Override | ||
| public String getMetricStatsDTags() { | ||
| return ""; | ||
| } | ||
| } |
59 changes: 59 additions & 0 deletions
59
...core/src/main/java/io/odpf/dagger/core/metrics/reporters/statsd/DaggerStatsDReporter.java
This file contains hidden or 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,59 @@ | ||
| package io.odpf.dagger.core.metrics.reporters.statsd; | ||
|
|
||
| import io.odpf.dagger.core.metrics.reporters.statsd.tags.GlobalTags; | ||
| import io.odpf.dagger.core.metrics.reporters.statsd.tags.StatsDTag; | ||
| import io.odpf.depot.metrics.StatsDReporter; | ||
| import io.odpf.depot.metrics.StatsDReporterBuilder; | ||
| import org.apache.flink.configuration.Configuration; | ||
|
|
||
| import java.io.IOException; | ||
| import java.util.Arrays; | ||
|
|
||
| import static io.odpf.dagger.core.utils.Constants.FLINK_JOB_ID_DEFAULT; | ||
| import static io.odpf.dagger.core.utils.Constants.FLINK_JOB_ID_KEY; | ||
|
|
||
| public class DaggerStatsDReporter implements SerializedStatsDReporterSupplier { | ||
| private static StatsDReporter statsDReporter; | ||
| private final Configuration flinkConfiguration; | ||
| private final io.odpf.dagger.common.configuration.Configuration daggerConfiguration; | ||
|
|
||
| private DaggerStatsDReporter(Configuration flinkConfiguration, io.odpf.dagger.common.configuration.Configuration daggerConfiguration) { | ||
| this.flinkConfiguration = flinkConfiguration; | ||
| this.daggerConfiguration = daggerConfiguration; | ||
| } | ||
|
|
||
| private String[] generateGlobalTags() { | ||
| StatsDTag[] globalTags = new StatsDTag[]{ | ||
| new StatsDTag(GlobalTags.JOB_ID, daggerConfiguration.getString(FLINK_JOB_ID_KEY, FLINK_JOB_ID_DEFAULT))}; | ||
| return Arrays.stream(globalTags) | ||
| .map(StatsDTag::getFormattedTag) | ||
| .toArray(String[]::new); | ||
| } | ||
|
|
||
| @Override | ||
| public StatsDReporter buildStatsDReporter() { | ||
| if (statsDReporter == null) { | ||
| DaggerMetricsConfig daggerMetricsConfig = new DaggerMetricsConfig(flinkConfiguration); | ||
| String[] globalTags = generateGlobalTags(); | ||
| statsDReporter = StatsDReporterBuilder | ||
| .builder() | ||
| .withMetricConfig(daggerMetricsConfig) | ||
| .withExtraTags(globalTags) | ||
| .build(); | ||
| } | ||
| return statsDReporter; | ||
| } | ||
|
|
||
| protected static void close() throws IOException { | ||
| if (statsDReporter != null) { | ||
| statsDReporter.close(); | ||
| statsDReporter = null; | ||
| } | ||
| } | ||
|
|
||
| public static class Provider { | ||
| public static DaggerStatsDReporter provide(Configuration flinkConfiguration, io.odpf.dagger.common.configuration.Configuration daggerConfiguration) { | ||
| return new DaggerStatsDReporter(flinkConfiguration, daggerConfiguration); | ||
| } | ||
| } | ||
| } |
15 changes: 15 additions & 0 deletions
15
...n/java/io/odpf/dagger/core/metrics/reporters/statsd/SerializedStatsDReporterSupplier.java
This file contains hidden or 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,15 @@ | ||
| package io.odpf.dagger.core.metrics.reporters.statsd; | ||
|
|
||
| import io.odpf.depot.metrics.StatsDReporter; | ||
|
|
||
| import java.io.Serializable; | ||
|
|
||
| /* Flink requires that all objects which are needed to prepare the Job Graph should be serializable along with their | ||
| properties/fields. StatsDReporter and its fields are not serializable. Hence, in order to mitigate job graph creation | ||
| failure, we create a serializable interface around the reporter as below. This is a common idiom to make un-serializable | ||
| fields serializable in Java 8: https://stackoverflow.com/a/22808112 */ | ||
|
|
||
| @FunctionalInterface | ||
| public interface SerializedStatsDReporterSupplier extends Serializable { | ||
| StatsDReporter buildStatsDReporter(); | ||
| } |
39 changes: 39 additions & 0 deletions
39
...-core/src/main/java/io/odpf/dagger/core/metrics/reporters/statsd/StatsDErrorReporter.java
This file contains hidden or 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,39 @@ | ||
| package io.odpf.dagger.core.metrics.reporters.statsd; | ||
|
|
||
| import io.odpf.dagger.core.metrics.reporters.ErrorReporter; | ||
| import io.odpf.dagger.core.metrics.reporters.statsd.tags.StatsDTag; | ||
| import io.odpf.depot.metrics.StatsDReporter; | ||
| import org.apache.flink.metrics.Counter; | ||
| import org.apache.flink.metrics.MetricGroup; | ||
|
|
||
| import java.io.Serializable; | ||
|
|
||
| import static io.odpf.dagger.core.utils.Constants.FATAL_EXCEPTION_METRIC_GROUP_KEY; | ||
| import static io.odpf.dagger.core.utils.Constants.NONFATAL_EXCEPTION_METRIC_GROUP_KEY; | ||
|
|
||
| public class StatsDErrorReporter implements ErrorReporter, Serializable { | ||
| private static final String FATAL_EXCEPTION_TAG_KEY = "fatal_exception_type"; | ||
| private static final String NON_FATAL_EXCEPTION_TAG_KEY = "non_fatal_exception_type"; | ||
| private final StatsDReporter statsDReporter; | ||
|
|
||
| public StatsDErrorReporter(SerializedStatsDReporterSupplier statsDReporterSupplier) { | ||
| this.statsDReporter = statsDReporterSupplier.buildStatsDReporter(); | ||
| } | ||
|
|
||
| @Override | ||
| public void reportFatalException(Exception exception) { | ||
| StatsDTag statsDTag = new StatsDTag(FATAL_EXCEPTION_TAG_KEY, exception.getClass().getName()); | ||
| statsDReporter.captureCount(FATAL_EXCEPTION_METRIC_GROUP_KEY, 1L, statsDTag.getFormattedTag()); | ||
| } | ||
|
|
||
| @Override | ||
| public void reportNonFatalException(Exception exception) { | ||
| StatsDTag statsDTag = new StatsDTag(NON_FATAL_EXCEPTION_TAG_KEY, exception.getClass().getName()); | ||
| statsDReporter.captureCount(NONFATAL_EXCEPTION_METRIC_GROUP_KEY, 1L, statsDTag.getFormattedTag()); | ||
| } | ||
|
|
||
| @Override | ||
| public Counter addExceptionToCounter(Exception exception, MetricGroup metricGroup, String metricGroupKey) { | ||
| throw new UnsupportedOperationException("This operation is not supported on StatsDErrorReporter"); | ||
| } | ||
| } |
47 changes: 47 additions & 0 deletions
47
.../main/java/io/odpf/dagger/core/metrics/reporters/statsd/manager/DaggerCounterManager.java
This file contains hidden or 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,47 @@ | ||
| package io.odpf.dagger.core.metrics.reporters.statsd.manager; | ||
|
|
||
| import io.odpf.dagger.common.metrics.aspects.Aspects; | ||
| import io.odpf.dagger.core.metrics.reporters.statsd.SerializedStatsDReporterSupplier; | ||
| import io.odpf.dagger.core.metrics.reporters.statsd.measurement.Counter; | ||
| import io.odpf.dagger.core.metrics.reporters.statsd.tags.StatsDTag; | ||
| import io.odpf.depot.metrics.StatsDReporter; | ||
|
|
||
| import java.util.ArrayList; | ||
|
|
||
| public class DaggerCounterManager implements MeasurementManager, Counter { | ||
| private final StatsDReporter statsDReporter; | ||
| private String[] formattedTags; | ||
|
|
||
| public DaggerCounterManager(SerializedStatsDReporterSupplier statsDReporterSupplier) { | ||
| this.statsDReporter = statsDReporterSupplier.buildStatsDReporter(); | ||
| } | ||
|
|
||
| @Override | ||
| public void register(StatsDTag[] tags) { | ||
| ArrayList<String> tagList = new ArrayList<>(); | ||
| for (StatsDTag measurementTag : tags) { | ||
| tagList.add(measurementTag.getFormattedTag()); | ||
| } | ||
| this.formattedTags = tagList.toArray(new String[0]); | ||
| } | ||
|
|
||
| @Override | ||
| public void increment(Aspects aspect) { | ||
| increment(aspect, 1L); | ||
| } | ||
|
|
||
| @Override | ||
| public void increment(Aspects aspect, long positiveCount) { | ||
| statsDReporter.captureCount(aspect.getValue(), positiveCount, formattedTags); | ||
| } | ||
|
|
||
| @Override | ||
| public void decrement(Aspects aspect) { | ||
| decrement(aspect, -1L); | ||
| } | ||
|
|
||
| @Override | ||
| public void decrement(Aspects aspect, long negativeCount) { | ||
| statsDReporter.captureCount(aspect.getValue(), negativeCount, formattedTags); | ||
| } | ||
| } |
32 changes: 32 additions & 0 deletions
32
...rc/main/java/io/odpf/dagger/core/metrics/reporters/statsd/manager/DaggerGaugeManager.java
This file contains hidden or 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,32 @@ | ||
| package io.odpf.dagger.core.metrics.reporters.statsd.manager; | ||
|
|
||
| import io.odpf.dagger.common.metrics.aspects.Aspects; | ||
| import io.odpf.dagger.core.metrics.reporters.statsd.SerializedStatsDReporterSupplier; | ||
| import io.odpf.dagger.core.metrics.reporters.statsd.measurement.Gauge; | ||
| import io.odpf.dagger.core.metrics.reporters.statsd.tags.StatsDTag; | ||
| import io.odpf.depot.metrics.StatsDReporter; | ||
|
|
||
| import java.util.ArrayList; | ||
|
|
||
| public class DaggerGaugeManager implements MeasurementManager, Gauge { | ||
| private final StatsDReporter statsDReporter; | ||
| private String[] formattedTags; | ||
|
|
||
| public DaggerGaugeManager(SerializedStatsDReporterSupplier statsDReporterSupplier) { | ||
| this.statsDReporter = statsDReporterSupplier.buildStatsDReporter(); | ||
| } | ||
|
|
||
| @Override | ||
| public void register(StatsDTag[] tags) { | ||
| ArrayList<String> tagList = new ArrayList<>(); | ||
| for (StatsDTag measurementTag : tags) { | ||
| tagList.add(measurementTag.getFormattedTag()); | ||
| } | ||
| this.formattedTags = tagList.toArray(new String[0]); | ||
| } | ||
|
|
||
| @Override | ||
| public void markValue(Aspects aspect, int gaugeValue) { | ||
| statsDReporter.gauge(aspect.getValue(), gaugeValue, formattedTags); | ||
| } | ||
| } |
32 changes: 32 additions & 0 deletions
32
...ain/java/io/odpf/dagger/core/metrics/reporters/statsd/manager/DaggerHistogramManager.java
This file contains hidden or 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,32 @@ | ||
| package io.odpf.dagger.core.metrics.reporters.statsd.manager; | ||
|
|
||
| import io.odpf.dagger.common.metrics.aspects.Aspects; | ||
| import io.odpf.dagger.core.metrics.reporters.statsd.SerializedStatsDReporterSupplier; | ||
| import io.odpf.dagger.core.metrics.reporters.statsd.measurement.Histogram; | ||
| import io.odpf.dagger.core.metrics.reporters.statsd.tags.StatsDTag; | ||
| import io.odpf.depot.metrics.StatsDReporter; | ||
|
|
||
| import java.util.ArrayList; | ||
|
|
||
| public class DaggerHistogramManager implements MeasurementManager, Histogram { | ||
| private final StatsDReporter statsDReporter; | ||
| private String[] formattedTags; | ||
|
|
||
| public DaggerHistogramManager(SerializedStatsDReporterSupplier statsDReporterSupplier) { | ||
| this.statsDReporter = statsDReporterSupplier.buildStatsDReporter(); | ||
| } | ||
|
|
||
| @Override | ||
| public void register(StatsDTag[] tags) { | ||
| ArrayList<String> tagList = new ArrayList<>(); | ||
| for (StatsDTag measurementTag : tags) { | ||
| tagList.add(measurementTag.getFormattedTag()); | ||
| } | ||
| this.formattedTags = tagList.toArray(new String[0]); | ||
| } | ||
|
|
||
| @Override | ||
| public void recordValue(Aspects aspect, long value) { | ||
| statsDReporter.captureHistogram(aspect.getValue(), value, formattedTags); | ||
| } | ||
| } |
9 changes: 9 additions & 0 deletions
9
...rc/main/java/io/odpf/dagger/core/metrics/reporters/statsd/manager/MeasurementManager.java
This file contains hidden or 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,9 @@ | ||
| package io.odpf.dagger.core.metrics.reporters.statsd.manager; | ||
|
|
||
| import io.odpf.dagger.core.metrics.reporters.statsd.tags.StatsDTag; | ||
|
|
||
| import java.io.Serializable; | ||
|
|
||
| public interface MeasurementManager extends Serializable { | ||
| void register(StatsDTag[] tags); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if we have discussed the design of these interfaces..
this is not used anywhere. then IMO, it's not needed.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This interface serves as an abstraction for registering and memoizing statsd tags of a component ( SplitAssigner, Parquet Reader, etc) for all measurements which get emitted from that component. Since, StatsDReporter expects tags to be sent along with each measurement call ( gauge, counter, etc), which is unnecessary when all the measurements that belong to a class have the same tags. (Not to be confused with global tags which we register during the creation call of statsdreporter itself)
This interface is not unused. It's implemented by all the 3 measurement managers: DaggerGaugeManager, DaggerHistogramManager and DaggerCounterManager.