25 lines
772 B
Python
25 lines
772 B
Python
# -*- coding: utf-8 -*-
|
|
"""拉桥事件流尾部(拒因/成交/状态机),09-09 上午废单定位用。"""
|
|
import re
|
|
import sys
|
|
|
|
pw = None
|
|
for line in open(r"C:\redis\redis.conf"):
|
|
m = re.match(r"^requirepass\s+(\S+)", line)
|
|
if m:
|
|
pw = m.group(1).strip()
|
|
import redis
|
|
|
|
r = redis.Redis(host="127.0.0.1", port=6379, db=5, password=pw,
|
|
decode_responses=True)
|
|
|
|
for key in sys.argv[1:] or ["bigqmt:order_error_events:66639661",
|
|
"bigqmt:trade_events:66639661"]:
|
|
print("=" * 20, key, "len=", r.xlen(key))
|
|
for ts, d in r.xrevrange(key, count=12):
|
|
parts = []
|
|
for k in sorted(d):
|
|
v = str(d[k])[:90]
|
|
parts.append("%s=%s" % (k, v))
|
|
print(ts, " | ".join(parts)[:600])
|