1. Ludia
  2. Untitled project
  3. dynamodb-mock

Commits

James O'Beirne  committed bbe526e

Only conditionally log stats data (to empty list errors)

  • Participants
  • Parent commits 65f2522
  • Branches default

Comments (0)

Files changed (1)

File ddbmock/utils/stat.py

View file
  • Ignore whitespace
         points = self.current_point_list
 
         interval = (self.current_point_time - self.last_aggregation_time) / 60.0
-        self.log.info("%s: interval=%s min=%s max=%s average=%s",
-                       self.name,
-                       round(interval),
-                       min(points),
-                       max(points),
-                       average(points))
+
+        if points:
+            self.log.info("%s: interval=%s min=%s max=%s average=%s",
+                        self.name,
+                        round(interval),
+                        min(points),
+                        max(points),
+                        average(points))
 
         #reset
         self.current_point_list = []