ans76
ans76

Reputation: 1

How to set HikariCP pool name with Play

We have some issues from database connection thus attemp to find a way monitor pool status and performance, but play default configuration seems doesn't offering pool name set up function.

slick.dbs.default.driver = "slick.driver.MySQLDriver$"
slick.dbs.default.db.driver = "com.mysql.jdbc.Driver"
slick.dbs.default.db.url = "jdbc:mysql://localhost:3306/xx"
slick.dbs.default.db.user =
slick.dbs.default.db.password = ""

I also want to know how to register JMX Mbean with pool, i integrate metrics into play correctly, just find jvm performance informations.

Upvotes: 0

Views: 3915

Answers (1)

tsuyoshi
tsuyoshi

Reputation: 146

You can set HikariCP pool name via configuration.

db.default.hikaricp.poolName = "something"

https://github.com/playframework/playframework/blob/2.4.6/framework/src/play-jdbc/src/main/resources/reference.conf#L85

JMX Mbean is disable by default, so you need to set true.

db.default.hikaricp.registerMbeans = true

https://github.com/playframework/playframework/blob/2.4.6/framework/src/play-jdbc/src/main/resources/reference.conf#L101

Upvotes: 0

Related Questions