Explorar o código

update nodetool

x %!s(int64=2) %!d(string=hai) anos
pai
achega
6f2bf60188
Modificáronse 1 ficheiros con 12 adicións e 5 borrados
  1. 12 5
      script/nodetool.py

+ 12 - 5
script/nodetool.py

@@ -94,11 +94,18 @@ async def main(argv):
         if ev in ["send", "recv"]:
             continue
         info = params["info"]
-        slot = info["slot"]
-
-        t = time.localtime()
-        current_time = time.strftime("%H:%M:%S", t)
-        print(f"{current_time}  slot {slot}: {ev}")
+        if ev.startswith("outbound_slot"):
+            slot = info["slot"]
+
+            t = time.localtime()
+            current_time = time.strftime("%H:%M:%S", t)
+            ev = ev[len("outbound_slot_"):]
+            print(f"{current_time}  slot {slot}: {ev}")
+        else:
+            assert ev == "outbound_peer_discovery"
+            attempt = info["attempt"]
+            state = info["state"]
+            print(f"{current_time}  peer_discovery: {state} (attempt {attempt})")
         #print(data)
 
     await rpc.dnet_switch(False)