Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
elahrvivaz committed Oct 1, 2024
1 parent ef29c56 commit 0132c31
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/user/appendix/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ implementations can be configured at runtime through `Typesafe Config <https://g

.. code-block:: scala
org.locationtech.geomesa.metrics.micrometer.MicrometerConfig.setup()
org.locationtech.geomesa.metrics.micrometer.MicrometerSetup.configure()
Configuration should be under the key ``geomesa.metrics``, and takes the following config:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import java.io.Closeable
import java.util.Locale
import java.util.concurrent.atomic.AtomicReference

object MicrometerConfig {
object MicrometerSetup {

import pureconfig.generic.semiauto._

Expand All @@ -40,7 +40,7 @@ object MicrometerConfig {
*
* @param conf conf
*/
def setup(conf: Config = ConfigFactory.load()): Unit = synchronized {
def configure(conf: Config = ConfigFactory.load()): Unit = synchronized {
if (conf.hasPath(ConfigPath)) {
// noinspection ScalaUnusedSymbol
implicit val bindingsReader: ConfigReader[MetricsBindings] = deriveReader[MetricsBindings]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PrometheusReporterTest extends Specification {
"expose metrics over http" in {
val port = getFreePort
val conf = ConfigFactory.parseString(s"{ type = prometheus, port = $port }")
val registry = MicrometerConfig.createRegistry(conf)
val registry = MicrometerSetup.createRegistry(conf)
try {
registry must beAnInstanceOf[PrometheusMeterRegistry]
registry.counter("foo").increment(10)
Expand All @@ -57,7 +57,7 @@ class PrometheusReporterTest extends Specification {
"expose metrics over http with custom suffix" in {
val port = getFreePort
val conf = ConfigFactory.parseString(s"{ type = prometheus, port = $port, common-tags = { foo = bar }}")
val registry = MicrometerConfig.createRegistry(conf)
val registry = MicrometerSetup.createRegistry(conf)
try {
registry must beAnInstanceOf[PrometheusMeterRegistry]
registry.counter("foo").increment(10)
Expand Down Expand Up @@ -86,7 +86,7 @@ class PrometheusReporterTest extends Specification {
jetty.start()
val port = jetty.getConnectors()(0).getLocalPort
val conf = ConfigFactory.parseString(s"""{ type = prometheus, push-gateway = { host = "localhost:$port", job = job1, format = prometheus_text }}""")
val registry = MicrometerConfig.createRegistry(conf)
val registry = MicrometerSetup.createRegistry(conf)
try {
registry must beAnInstanceOf[PrometheusMeterRegistry]
registry.counter("foo").increment(10)
Expand All @@ -109,7 +109,7 @@ class PrometheusReporterTest extends Specification {
jetty.start()
val port = jetty.getConnectors()(0).getLocalPort
val conf = ConfigFactory.parseString(s"""{ type = prometheus, push-gateway = { host = "localhost:$port", job = job1 }}""")
val registry = MicrometerConfig.createRegistry(conf)
val registry = MicrometerSetup.createRegistry(conf)
try {
registry must beAnInstanceOf[PrometheusMeterRegistry]
registry.counter("foo").increment(10)
Expand All @@ -136,7 +136,7 @@ class PrometheusReporterTest extends Specification {
val conf =
ConfigFactory.parseString(
s"""{ type = prometheus, common-tags = { blu = baz }, push-gateway = { host = "localhost:$port", job = job1 }}""")
val registry = MicrometerConfig.createRegistry(conf)
val registry = MicrometerSetup.createRegistry(conf)
try {
registry must beAnInstanceOf[PrometheusMeterRegistry]
registry.counter("foo").increment(10)
Expand Down

0 comments on commit 0132c31

Please sign in to comment.