com.github.dikhan.dropwizard.headermetric.resources.HelloWorldResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dropwizard-header-metric Show documentation
Show all versions of dropwizard-header-metric Show documentation
Create metrics and send it to the preferable reporter if request header matches any of the headers
configured to be measured.
The newest version!
package com.github.dikhan.dropwizard.headermetric.resources;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import com.github.dikhan.dropwizard.headermetric.annotations.TraceConfiguredHeaders;
@Path("/hello-world")
@Produces(MediaType.APPLICATION_JSON)
public class HelloWorldResource {
@GET
@TraceConfiguredHeaders(name = "sayHelloWorld")
public String sayHelloWorld() {
return "Hello World";
}
@GET
@Path("/{name}")
public String sayHelloTo(@PathParam("name") String name) {
return "Hello " + name;
}
}