summaryrefslogtreecommitdiff
path: root/rdiff-backup/rdiff_backup/statistics.py
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-03-03 01:37:10 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-03-03 01:37:10 +0000
commitef79a33ae64761de55f8d12f50356226d36ebe18 (patch)
treeaf8eed35acc1a5eabc2a5d4cef1acfd10edc9b93 /rdiff-backup/rdiff_backup/statistics.py
parentb4ec968e28383be03d2743f4b3c0343ebca23a3c (diff)
downloadrdiff-backup-ef79a33ae64761de55f8d12f50356226d36ebe18.tar.gz
Fixed --print-statistics and spurious server error message
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@290 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/rdiff_backup/statistics.py')
-rw-r--r--rdiff-backup/rdiff_backup/statistics.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/rdiff-backup/rdiff_backup/statistics.py b/rdiff-backup/rdiff_backup/statistics.py
index 6356101..5ed6cd3 100644
--- a/rdiff-backup/rdiff_backup/statistics.py
+++ b/rdiff-backup/rdiff_backup/statistics.py
@@ -20,7 +20,7 @@
"""Generate and process aggregated backup information"""
import re, os, time
-import Globals, robust, Time, rorpiter, increment
+import Globals, robust, Time, rorpiter, increment, log
class StatsException(Exception): pass
@@ -342,3 +342,11 @@ def write_active_statfileobj():
_active_statfileobj.finish()
_active_statfileobj.write_stats_to_rp(session_stats_rp)
_active_statfileobj = None
+
+def print_active_stats():
+ """Print statistics of active statobj to stdout and log"""
+ global _active_statfileobj
+ assert _active_statfileobj
+ statmsg = _active_statfileobj.get_stats_logstring("Session statistics")
+ log.Log.log_to_file(statmsg)
+ Globals.client_conn.sys.stdout.write(statmsg)