Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
r1j0
committed
May 5, 2012
1 parent
218eb0d
commit 4c50b9c
Showing
7 changed files
with
67 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.github.r1j0.statsd.backend; | ||
|
||
import com.github.r1j0.statsd.server.StatsdConfiguration; | ||
|
||
public interface BackendConfiguration { | ||
|
||
void setConfiguration(StatsdConfiguration configuration); | ||
|
||
} |
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
11 changes: 11 additions & 0 deletions
11
src/com/github/r1j0/statsd/backend/DebugBackendConfiguration.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,11 @@ | ||
package com.github.r1j0.statsd.backend; | ||
|
||
import com.github.r1j0.statsd.server.StatsdConfiguration; | ||
|
||
public class DebugBackendConfiguration implements BackendConfiguration { | ||
|
||
public void setConfiguration(StatsdConfiguration configuration) { | ||
// NoOp | ||
} | ||
|
||
} |
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
26 changes: 26 additions & 0 deletions
26
src/com/github/r1j0/statsd/backend/GraphiteBackendConfiguration.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,26 @@ | ||
package com.github.r1j0.statsd.backend; | ||
|
||
import com.github.r1j0.statsd.server.StatsdConfiguration; | ||
|
||
public class GraphiteBackendConfiguration implements BackendConfiguration { | ||
|
||
private StatsdConfiguration configuration; | ||
private static final String HOST = "backend.graphite.host"; | ||
private static final String PORT = "backend.graphite.port"; | ||
|
||
|
||
public String getHost() { | ||
return configuration.getValue(HOST); | ||
} | ||
|
||
|
||
public int getPort() { | ||
return Integer.parseInt(configuration.getValue(PORT)); | ||
} | ||
|
||
|
||
public void setConfiguration(StatsdConfiguration configuration) { | ||
this.configuration = configuration; | ||
} | ||
|
||
} |
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