Skip to content

Instantly share code, notes, and snippets.

@john-nash-rs
Created July 12, 2018 12:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save john-nash-rs/2eb7837de74232dd7bdb2d1127913acb to your computer and use it in GitHub Desktop.
Save john-nash-rs/2eb7837de74232dd7bdb2d1127913acb to your computer and use it in GitHub Desktop.
import com.codahale.metrics.annotation.Timed;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
/**
* Created by harshvardhan on 12/07/18.
*/
@Path("/resource")
public class MyResource {
@GET
@Timed
@Path("/getName")
public String getName() {
return "Harsh";
}
@POST
@Timed
@Path("/postName")
public String postName(String name) {
System.out.println("Name given by : "+name);
return "Ok";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment