...
CloudWatch allows you to view the metrics via a line chart. You can observe the metrics in different time periods, allowing you to zoom in. You can view the metrics individually or in the form of statistics representing an average, minimum, maximum, sum, or sample count. CloudWatch holds metric information for two weeks after they arrivearrival time.
Location
The CloudWatch profiler code can be found in the services-repository project under the profiler.org.sagebionetworks.cloudwatch package.
...
How Often Should It Fire?
To adjust how often the CloudWatchProfiler sends batches of metrics to CloudWatch, go to the lib-stackConfiguation project. Under Under src/main/resources locate the stack.properties.xml file. The "org.sagebionetworks.coud.watch.trigger= " can be sent to a period of time in milliseconds.
To set to default trigger time of one minute (60,000 milliseconds) stack.properties should match below example.
#AmazonWebServices CloudWatch Profiler's Trigger time in milliseconds
org.sagebionetworks.cloud.watch.trigger=60000
How To Modify/Expand
The CloudWatchProfiler uses Spring AOP to collect the latency information. It can be expanded or modified to work in a different location. See the Services-repository project. Under the profiler.org.sagebionetworks.cloudwatch package, locate the ControllerProfiler.java class. The critical method is the doBasicProfiling. See the @Around line above the doBasicProfiling method to look into adjusting/modifying which package it collects latency information for. It currently reads per the below line, but the "around" can be modified to another class, or package, etc.
@Around("execution(* org.sagebionetworks.repo.web.controller.DefaultController.*(..))")
The "namespace" will always be the package name, and the "metric" names will automatically be set to the method names under the class.