Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move metrics out to its own MetricsService
- Loading branch information
Showing
10 changed files
with
47 additions
and
24 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
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
20 changes: 20 additions & 0 deletions
20
fcrepo-kernel/src/main/java/org/fcrepo/services/MetricsService.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,20 @@ | ||
package org.fcrepo.services; | ||
|
||
import com.codahale.metrics.MetricRegistry; | ||
import org.fcrepo.metrics.RegistryService; | ||
|
||
import java.io.PrintStream; | ||
|
||
public class MetricsService { | ||
|
||
public static final MetricRegistry metrics = RegistryService.getMetrics(); | ||
|
||
public static MetricRegistry getMetrics() { | ||
return metrics; | ||
} | ||
|
||
public static void dumpMetrics(final PrintStream os) { | ||
RegistryService.dumpMetrics(os); | ||
} | ||
|
||
} |
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
18 changes: 18 additions & 0 deletions
18
fcrepo-kernel/src/test/java/org/fcrepo/services/MetricsServiceTest.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,18 @@ | ||
package org.fcrepo.services; | ||
|
||
import com.codahale.metrics.MetricRegistry; | ||
import org.junit.Test; | ||
|
||
import java.io.PrintStream; | ||
|
||
public class MetricsServiceTest { | ||
|
||
MetricRegistry mockMetricRegistry; | ||
|
||
PrintStream mockPrintStream; | ||
|
||
@Test | ||
public void testDumpMetrics() { | ||
MetricsService.dumpMetrics(mockPrintStream); | ||
} | ||
} |
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