윤영준 윤영준 05-24
rewriting of event handling class, StreamSources 1. counting error fixed (ok_counts and failure_counts)
1. counting error fixed (ok_counts and failure_counts)
@d214df142b7273a34c35b0274550f4824634d320
postprocess_draft.py
--- postprocess_draft.py
+++ postprocess_draft.py
@@ -104,7 +104,7 @@
             print(self.sources[source]["status_counts"][-seek_n_recent_memory:])
             self.sources[source]['failure_counts'] = (seek_n_recent_memory
                               - sum(self.sources[source]["status_counts"][-seek_n_recent_memory:]))
-            self.sources[source]['ok_counts'] = seek_n_recent_memory - self.sources[source]['ok_counts']
+            self.sources[source]['ok_counts'] = sum(self.sources[source]["status_counts"][-seek_n_recent_memory:])
             flag_send_event = True
 
             # mode switching condition check
@@ -121,7 +121,7 @@
             print(self.sources[source]["status_counts"][-seek_n_recent_memory:])
             self.sources[source]['failure_counts'] = (seek_n_recent_memory
                               - sum(self.sources[source]["status_counts"][-seek_n_recent_memory:]))
-            self.sources[source]['ok_counts'] = seek_n_recent_memory - self.sources[source]['ok_counts']
+            self.sources[source]['ok_counts'] = sum(self.sources[source]["status_counts"][-seek_n_recent_memory:])
             # print(self.sources[source]['failure_counts'])
 
             # mode switching condition check
Add a comment
List