本文整理汇总了Python中dsadmin.DSAdmin.getDBStats方法的典型用法代码示例。如果您正苦于以下问题:Python DSAdmin.getDBStats方法的具体用法?Python DSAdmin.getDBStats怎么用?Python DSAdmin.getDBStats使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dsadmin.DSAdmin
的用法示例。
在下文中一共展示了DSAdmin.getDBStats方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: in
# 需要导入模块: from dsadmin import DSAdmin [as 别名]
# 或者: from dsadmin.DSAdmin import getDBStats [as 别名]
# for srv in (srv1, srv2):
# ents = srv.search_s(dn, ldap.SCOPE_BASE)
# print "replica", dn, "config from", str(srv)
# for ent in ents:
# print str(ent)
sleeptime = 30 # seconds
while True:
for suf in suffixes.keys():
ruv1 = srv1.getRUV(suf)
ruv2 = srv2.getRUV(suf)
rc, status = ruv1.getdiffs(ruv2)
print "For suffix %s server1 %s server2 %s" % (suf, str(srv1), str(srv2))
print status
stats = srv1.getDBStats(suf)
print "DB Stats for", str(srv1), suf
print stats
stats = srv2.getDBStats(suf)
print "DB Stats for", str(srv2), suf
print stats
for srv, agmts in ((srv1, agmts1to2), (srv2, agmts2to1)):
for agmtdn in agmts:
# print srv.getReplStatus(agmtdn)
nagmtdn = DSAdmin.normalizeDN(agmtdn)
numchanges = srv.getChangesSent(agmtdn)
if numchanges:
if not srv.lastnumchanges[nagmtdn]:
srv.lastnumchanges[nagmtdn] = numchanges
diff = numchanges - srv.lastnumchanges[nagmtdn]
rate = diff * 2