Peter Arrenbrecht avatar Peter Arrenbrecht committed 362c445

more/better config

Comments (0)

Files changed (1)

src/discovery_tonfa.py

 
 
 MAX_CLIENT_SAMPLE = 200
-MAX_CLIENT_ALL = MAX_CLIENT_SAMPLE
-CLIENT_ROOTS_ALWAYS = True
+MAX_CLIENT_ALL = 200
+ALWAYS_INCLUDE_ROOTS = True
 
 MAX_SERVER_SAMPLE = 200
-MAX_SERVER_ALL = MAX_SERVER_SAMPLE
+MAX_SERVER_ALL = 200
 
 HIDE_ALL = False
-HIDE_TRAFFIC = False
+HIDE_TRAFFIC = True
 HIDE_SAMPLER = True
 HIDE_SERVER = True
 HIDE_UPDATES = True
                 if d == factor:
                     sample.add(n)
 
-            if self.roots_always or not always:
+            if ALWAYS_INCLUDE_ROOTS or not always:
                 always.update(heads)
 
         self.writer.step("finalize")
         self.roundtrips = 0
         self.maxall = MAX_CLIENT_ALL
         self.maxsample = MAX_CLIENT_SAMPLE
-        self.roots_always = CLIENT_ROOTS_ALWAYS
         self.sampleheads = True
         self.sampleroots = True
 
         Participant.__init__(self, dag, writer, cfg)
         self.maxall = MAX_SERVER_ALL
         self.maxsample = MAX_SERVER_SAMPLE
-        self.roots_always = True
         self.sampleheads = False
         self.sampleroots = True
 
         self.writer.show("server remaining: %i" % len(allremaining))
         self.writer.unindent()
 
-        if len(allremaining) > self.maxall:
-            mysample = self._sample(allremaining, common)
-            return yesno, mysample, False
+        if len(allremaining) <= self.maxall:
+            return yesno, allremaining, True
 
-        return yesno, allremaining, True
+        if self.maxsample > 0:
+            return yesno, self._sample(allremaining, common), False
+
+        return yesno, set(), False
 
 
 class Tests(DiscoveryTests):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.