From dd673370ecc071f1693318c322e0b3d90c990620 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@allmydata.com>
Date: Fri, 6 Apr 2007 17:41:01 -0700
Subject: [PATCH] figleaf output: include a stats.out for parsing by a munin
 plugin

---
 src/allmydata/util/figleaf_htmlizer.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/allmydata/util/figleaf_htmlizer.py b/src/allmydata/util/figleaf_htmlizer.py
index 3e0c263c..9b009373 100644
--- a/src/allmydata/util/figleaf_htmlizer.py
+++ b/src/allmydata/util/figleaf_htmlizer.py
@@ -144,6 +144,13 @@ def report_as_html(coverage, directory, exclude_patterns=[], root=None):
 	pcnt_75 = [ x for x in pcnts if x >= 75 ]
 	pcnt_50 = [ x for x in pcnts if x >= 50 ]
 
+        stats_fp = open('%s/stats.out' % (directory,), 'w')
+        stats_fp.write("total files: %d\n" % len(pcnts))
+        stats_fp.write("total source lines: %d\n" % summary_lines)
+        stats_fp.write("total covered lines: %d\n" % summary_cover)
+        stats_fp.write("total coverage percentage: %.1f\n" % summary_pcnt)
+        stats_fp.close()
+
         ## index.html
 	index_fp = open('%s/index.html' % (directory,), 'w')
         # summary info
-- 
2.45.2