ソースを参照

update nodetool

x 2 年 前
コミット
6f2bf60188
1 ファイル変更12 行追加5 行削除
  1. 12 5
      script/nodetool.py

+ 12 - 5
script/nodetool.py

@@ -94,11 +94,18 @@ async def main(argv):
         if ev in ["send", "recv"]:
         if ev in ["send", "recv"]:
             continue
             continue
         info = params["info"]
         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)
         #print(data)
 
 
     await rpc.dnet_switch(False)
     await rpc.dnet_switch(False)