Commit 854a64fd authored by Jeremy Hylton's avatar Jeremy Hylton

Include server start time in monitor output.

zLog message just before server calls bind().
parent 52243507
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
############################################################################## ##############################################################################
"""Monitor behavior of ZEO server and record statistics. """Monitor behavior of ZEO server and record statistics.
$id:$ $Id: monitor.py,v 1.2 2003/01/09 23:55:57 jeremy Exp $
""" """
import asyncore import asyncore
...@@ -22,6 +22,7 @@ import time ...@@ -22,6 +22,7 @@ import time
import types import types
import ZEO import ZEO
import zLOG
class StorageStats: class StorageStats:
"""Per-storage usage statistics.""" """Per-storage usage statistics."""
...@@ -37,8 +38,10 @@ class StorageStats: ...@@ -37,8 +38,10 @@ class StorageStats:
self.lock_time = None self.lock_time = None
self.conflicts = 0 self.conflicts = 0
self.conflicts_resolved = 0 self.conflicts_resolved = 0
self.start = time.ctime()
def dump(self, f): def dump(self, f):
print >> f, "Server started:", self.start
print >> f, "Clients:", self.clients print >> f, "Clients:", self.clients
print >> f, "Clients verifying:", self.verifying_clients print >> f, "Clients verifying:", self.verifying_clients
print >> f, "Active transactions:", self.active_txns print >> f, "Active transactions:", self.active_txns
...@@ -97,6 +100,7 @@ class StatsServer(asyncore.dispatcher): ...@@ -97,6 +100,7 @@ class StatsServer(asyncore.dispatcher):
else: else:
self.create_socket(socket.AF_UNIX, socket.SOCK_STREAM) self.create_socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.set_reuse_addr() self.set_reuse_addr()
zLOG.LOG("ZSM", zLOG.INFO, "monitor listening on %s" % repr(self.addr))
self.bind(self.addr) self.bind(self.addr)
self.listen(5) self.listen(5)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment