summaryrefslogtreecommitdiff
path: root/service/twisted/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'service/twisted/plugins')
-rw-r--r--service/twisted/plugins/logger.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/service/twisted/plugins/logger.py b/service/twisted/plugins/logger.py
new file mode 100644
index 00000000..b466d015
--- /dev/null
+++ b/service/twisted/plugins/logger.py
@@ -0,0 +1,15 @@
+import gc
+import sys
+
+from zope.interface import implementer
+from twisted.plugin import IPlugin
+from loglinegenerator import ILogLineGenerator
+
+
+@implementer(IPlugin, ILogLineGenerator)
+class GCLogger():
+ def getLogLine(self):
+ return '%010d' % sum(sys.getsizeof(o) for o in gc.get_objects())
+
+
+gcLogger = GCLogger()