using codahale.metrics to expose commits and deploys api metrics
emit actual deploys from envDeploys class
update instrument
add more instrumentation places for teletraan apis
remove instrumentations from EnvStages and Environs apis
remove extra spaces
remove instrumentations from daily count api
MODIFY
deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/resource/Commits.java
deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/resource/Commits.java
*/
package com.pinterest.teletraan.resource;
+import com.codahale.metrics.annotation.ExceptionMetered;
+import com.codahale.metrics.annotation.Timed;
import com.google.common.base.Optional;
import com.pinterest.deployservice.bean.CommitBean;
@@ -45,6 +47,8 @@ public class Commits {
}
@GET
+ @Timed
+ @ExceptionMetered
@Path("{repo : [a-zA-Z0-9\\-_]+}/{sha : [a-zA-Z0-9\\-_]+}")
@ApiOperation(
value = "Get commit infos",
@@ -64,6 +68,8 @@ public class Commits {
* It is recommended to call multiple times (pagination) with size < 30 to avoid timeout
*/
@GET
+ @Timed
+ @ExceptionMetered
public List<CommitBean> getCommits(@QueryParam("repo") String repo,
@QueryParam("startSha") String startSha, @QueryParam("endSha") String endSha,
@QueryParam("size") Optional<Integer> size, @QueryParam("path") Optional<String> path) throws Exception {

MODIFY
deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/resource/Deploys.java
deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/resource/Deploys.java
*/
package com.pinterest.teletraan.resource;
+import com.codahale.metrics.annotation.ExceptionMetered;
+import com.codahale.metrics.annotation.Timed;
import com.google.common.base.Optional;
@@ -84,6 +86,8 @@ public class Deploys {
}
@GET
+ @Timed
+ @ExceptionMetered
@Path("/{id : [a-zA-Z0-9\\-_]+}")
@ApiOperation(
value = "Get deploy info",
@@ -136,6 +140,8 @@ public class Deploys {
}
@PUT
+ @Timed
+ @ExceptionMetered
@Path("/{id : [a-zA-Z0-9\\-_]+}")
@ApiOperation(
value = "Update deploy",
@@ -156,6 +162,8 @@ public class Deploys {
}
@DELETE
+ @Timed
+ @ExceptionMetered
@Path("/{id : [a-zA-Z0-9\\-_]+}")
@ApiOperation(
value = "Delete deploy info",

MODIFY
deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/resource/EnvDeploys.java
deploy-service/teletraanservice/src/main/java/com/pinterest/teletraan/resource/EnvDeploys.java
*/
package com.pinterest.teletraan.resource;
+import com.codahale.metrics.annotation.ExceptionMetered;
+import com.codahale.metrics.annotation.Timed;
+
import com.pinterest.deployservice.bean.*;
import com.pinterest.deployservice.common.Constants;
import com.pinterest.deployservice.dao.DeployDAO;
@@ -78,6 +81,8 @@ public class EnvDeploys {
}
@GET
+ @Timed
+ @ExceptionMetered
@Path("/current")
@ApiOperation(
value = "Get deploy info by environment",
@@ -91,6 +96,8 @@ public class EnvDeploys {
}
@POST
+ @Timed
+ @ExceptionMetered
@Path("/current/actions")
@ApiOperation(
value = "Take deploy action",
@@ -138,6 +145,8 @@ public class EnvDeploys {
}
@PUT
+ @Timed
+ @ExceptionMetered
@Path("/hostactions")
@ApiOperation(
value = "Take a deploy action",
@@ -177,6 +186,8 @@ public class EnvDeploys {
}
@POST
+ @Timed
+ @ExceptionMetered
@ApiOperation(
value = "Create a deploy",
notes = "Creates a deploy given an environment name, stage name, build id and description",
@@ -204,6 +215,8 @@ public class EnvDeploys {
// Even though this is PUT, but it really just update progress, no check is needed
@PUT
+ @Timed
+ @ExceptionMetered
@Path("/current/progress")
@ApiOperation(
value = "Update deploy progress",

using codahale.metrics to expose commits and deploys api metrics (#659)

emit actual deploys from envDeploys class

update instrument

add more instrumentation places for teletraan apis

remove instrumentations from EnvStages and Environs apis

remove extra spaces

remove instrumentations from daily count api