Description
The CloudWatchProfiler uses AmazonWebServices' CloudWatch feature to store latency information about the DefaultController. When turned on, it tracks how long each method in the DefaultController takes to complete. These latency times are collected anytime a method in the DefaultController is used, and periodically sent in the form of "metrics" to CloudWatch. Each metric has a name representing the DefaultController method used, a value representing that method's latency in milliseconds, and a timestamp representing when that method was called. The CloudWatchController can be turned on and off, and the trigger time for how often the batches are sent can be modified.
The metrics go to the Sage Bionetworks team account found at https://console.aws.amazon.com/cloudwatch/home?region=us-west-1
The DefaultController's metrics can be located under a namespace that matches the Default Controller's package (package org.sagebionetworks.repo.web.controller). You will need to look under the US East region to locate the namespace.
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 arrive.
Location
The CloudWatch profiler code can be found in the services-repository project under the profiler.org.sagebionetworks.cloudwatch package.
How To Turn On/Off
To turn the CloudWatchProfiler on, go to the lib-stackConfiguration project. Under src/main/resources locate the stack.properties.xml file. Turn "org.sagebionetworks.cloud.watch.report.enables=true" to turn on.
To turn CloudWatchProfiler off, stack.properties should match below example.
#AmazonWebServices CloudWatch Profiler
org.sagebionetworks.cloud.watch.report.enabled=false
How Often Should It Fire?
#AmazonWebServices CloudWatch Profiler's Trigger time in milliseconds
org.sagebionetworks.cloud.watch.trigger=60000