Browse Source

Add received/rejected stats

David Cramer 10 years ago
parent
commit
97f904ea3b
1 changed files with 12 additions and 4 deletions
  1. 12 4
      bin/load-mocks

+ 12 - 4
bin/load-mocks

@@ -20,14 +20,22 @@ def create_sample_time_series(event):
 
     for _ in xrange(60):
         count = randint(1, 10)
-        tsdb.incr(tsdb.models.project, group.project.id, now, count)
-        tsdb.incr(tsdb.models.group, group.id, now, count)
+        tsdb.incr_multi((
+            (tsdb.models.project_total_received, group.project.id),
+            (tsdb.models.project_total_rejected, group.project.id),
+            (tsdb.models.project, group.project.id),
+            (tsdb.models.group, group.id),
+        ), now, count)
         now = now - timedelta(seconds=1)
 
     for _ in xrange(24 * 30):
         count = randint(100, 1000)
-        tsdb.incr(tsdb.models.project, group.project.id, now, count)
-        tsdb.incr(tsdb.models.group, group.id, now, count)
+        tsdb.incr_multi((
+            (tsdb.models.project_total_received, group.project.id),
+            (tsdb.models.project_total_rejected, group.project.id),
+            (tsdb.models.project, group.project.id),
+            (tsdb.models.group, group.id),
+        ), now, count)
         now = now - timedelta(hours=1)