Skip to content
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

marked all of the OutputWriter implementations with a marker interface, for documentation #113

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
*
* @author <a href="mailto:[email protected]">Cyrille Le Clerc</a>
*/
@ExplicitEpoch
public class ConsoleWriter extends AbstractOutputWriter implements OutputWriter {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
* CopperEggWriter.java was derived from LibratoWriter.java
* @author <a href="mailto:[email protected]">Scott Johnson</a>
*/
@ExplicitEpoch
public class CopperEggWriter extends AbstractOutputWriter implements OutputWriter {
public static final String METRIC_TYPE_GAUGE = "gauge";
public static final String METRIC_TYPE_COUNTER = "counter";
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jmxtrans/embedded/output/CsvWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
* @author <a href="mailto:[email protected]">Ryan Larson</a>
*
*/
@ExplicitEpoch
public class CsvWriter extends AbstractOutputWriter implements OutputWriter {

private final Logger logger = LoggerFactory.getLogger(getClass());
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/org/jmxtrans/embedded/output/ExplicitEpoch.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.jmxtrans.embedded.output;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
* It's the contrary of ImplicitEpoch
*
* @see ImplicitEpoch
*/
@Retention(RetentionPolicy.SOURCE)
@interface ExplicitEpoch {
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
*
* @author <a href="mailto:[email protected]">Simon Mazas</a>
*/
@ExplicitEpoch
public class GraphiteHttpWriter extends AbstractOutputWriter implements OutputWriter {

public static final String DEFAULT_NAME_PREFIX = "servers.#hostname#.";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
*
* @author <a href="mailto:[email protected]">Cyrille Le Clerc</a>
*/
@ExplicitEpoch
public class GraphitePickleWriter extends AbstractOutputWriter implements OutputWriter {

public static final int DEFAULT_GRAPHITE_SERVER_PORT = 2004;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
* @author <a href="mailto:[email protected]">Cyrille Le Clerc</a>
* @author <a href="mailto:[email protected]">Patrick Brühlmann</a>
*/
@ExplicitEpoch
public class GraphiteWriter extends AbstractOutputWriter implements OutputWriter {

public static final int DEFAULT_GRAPHITE_SERVER_PORT = 2003;
Expand Down
17 changes: 17 additions & 0 deletions src/main/java/org/jmxtrans/embedded/output/ImplicitEpoch.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package org.jmxtrans.embedded.output;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
* Indicates that the OutputWriter is not exporting the time (epoch) at which the metric was collected.
* This is generally implied by the protocol being used to transport the metric.
* In this case, it's the server who's receiving the data that will set the metric epoch to the time it received it.
* <p/>
* The support for explicit epoch may be important when the export is happening a while after it was collected.
* OutputWriters implementing ImplicitEpoch will need to be exported sooner after the collection, and retry on error may not be appropriate.
* OutputWriters implementing ExplicitEpoch will support export delayed from collection, and retry on error will be remain accurate.
*/
@Retention(RetentionPolicy.SOURCE)
@interface ImplicitEpoch {
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
*
* @author <a href="mailto:[email protected]">Cyrille Le Clerc</a>
*/
@ExplicitEpoch
public class LibratoWriter extends AbstractOutputWriter implements OutputWriter {

public static final String METRIC_TYPE_GAUGE = "gauge";
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jmxtrans/embedded/output/NoOpWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
*
* @author <a href="mailto:[email protected]">Cyrille Le Clerc</a>
*/
@ExplicitEpoch
public class NoOpWriter extends AbstractOutputWriter {

static class NullWriter extends Writer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
*
* @author <a href="mailto:[email protected]">Cyrille Le Clerc</a>
*/
@ExplicitEpoch
public class Slf4jWriter extends AbstractOutputWriter {

private Logger logger = LoggerFactory.getLogger(getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
*
* @author <a href="mailto:[email protected]">Eric Kilby</a>
*/
@ExplicitEpoch
public class StackdriverWriter extends AbstractOutputWriter implements OutputWriter {

public static final int STACKDRIVER_PROTOCOL_VERSION = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* @author <a href="mailto:[email protected]">Cyrille Le Clerc</a>
* @since 1.0.15
*/
@ImplicitEpoch
public class StatsDWriter extends AbstractOutputWriter implements OutputWriter {

public final static String SETTING_BUFFER_SIZE = "bufferSize";
Expand Down