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

Support HP NonStop. Closes #272 #273

Closed
wants to merge 1 commit into from
Closed
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
17 changes: 13 additions & 4 deletions util-jvm/src/main/scala/com/twitter/jvm/Hotspot.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import javax.management.{
ObjectName,
RuntimeMBeanException
}
import javax.naming.OperationNotSupportedException
import scala.jdk.CollectionConverters._
import scala.language.reflectiveCalls

Expand Down Expand Up @@ -56,10 +57,18 @@ class Hotspot extends Jvm {
private[this] def long(c: Counter) = c.getValue().asInstanceOf[Long]

private[this] def counters(pat: String) = {
val cs = jvm.getInternalCounters(pat).asScala
cs.map { c =>
c.getName() -> c
}.toMap
try {
val cs = jvm.getInternalCounters(pat).asScala
cs.map { c =>
c.getName() -> c
}.toMap
} catch {
case e: OperationNotSupportedException =>
log.log(Level.WARNING, s"failed to get internal JVM counters as these are not available on your JVM.")
Map[String, Counter]()
case e: Throwable =>
throw e
}
}

private[this] def counter(name: String): Option[Counter] =
Expand Down