I try to setup a performance metrics tool with one of our new service built with Scala. I use Dropwizard Metrics since it is a popular one. The following code can't get compiled
@Timed
get("/greeting", operation(dummy)){
val name: Option[String] = params.get("name")
Ok(String.format("Hello %s", name.getOrElse(defaultName)))
}
and the error message is
[error] ... expected start of definition
[error] get("/greeting", operation(dummy)){
[error] ^
[error] one error found
Can Dropwizard Metrics be integrated with Scalatra? If yes, what is the right way to integrate?