Jelajahi Sumber

fix(syncing-server): skip sending empty metrics

Karol Sójko 1 tahun lalu
induk
melakukan
2c732ff713
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 4 0
      packages/syncing-server/bin/statistics.ts

+ 4 - 0
packages/syncing-server/bin/statistics.ts

@@ -34,6 +34,10 @@ const sendStatistics = async (
         timestamp + Time.MicrosecondsInAMinute,
         timestamp + Time.MicrosecondsInAMinute,
       )
       )
 
 
+      if (statistics.sampleCount === 0) {
+        continue
+      }
+
       await cloudwatchClient.send(
       await cloudwatchClient.send(
         new PutMetricDataCommand({
         new PutMetricDataCommand({
           Namespace: 'SyncingServer',
           Namespace: 'SyncingServer',