File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/main/java/devkor/com/teamcback/infra/cloudwatch Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public class MetricsService {
21
21
@ Value ("${metrics.environment}" )
22
22
private String environment ;
23
23
24
- private final String TARGET = "dev" ; // 테스트 후 prod로 변경
24
+ private final String TARGET = "prod" ;
25
25
26
26
private final CloudWatchAsyncClient cloudWatchAsyncClient ;
27
27
private final Map <String , AtomicInteger > uriCountMap = new ConcurrentHashMap <>();
@@ -35,6 +35,7 @@ public void recordApiRequest(String uri) {
35
35
@ Scheduled (fixedRate = 60_000 )
36
36
public void sendMetricsToCloudWatch () {
37
37
if (TARGET .equalsIgnoreCase (environment )) {
38
+ if (uriCountMap .isEmpty ()) return ;
38
39
List <MetricDatum > metricDataList = uriCountMap .entrySet ().stream ()
39
40
.map (entry -> {
40
41
String uri = entry .getKey ();
You can’t perform that action at this time.
0 commit comments