[freeside-commits] branch FREESIDE_2_3_BRANCH updated. 74bd452f229bca49696001d1dbc23fd3911b512d
Ivan
ivan at 420.am
Fri Aug 3 10:52:16 PDT 2012
The branch, FREESIDE_2_3_BRANCH has been updated
via 74bd452f229bca49696001d1dbc23fd3911b512d (commit)
from 9e609c890b7977eeaab4bfe579c8c14348e1504f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 74bd452f229bca49696001d1dbc23fd3911b512d
Author: Ivan Kohler <ivan at freeside.biz>
Date: Fri Aug 3 10:52:12 2012 -0700
request tracing, RT#18719
diff --git a/FS/FS/Trace.pm b/FS/FS/Trace.pm
new file mode 100644
index 0000000..9ff39dd
--- /dev/null
+++ b/FS/FS/Trace.pm
@@ -0,0 +1,35 @@
+package FS::Trace;
+
+use strict;
+use Date::Format;
+use File::Slurp;
+
+my @trace = ();
+
+sub log {
+ my( $class, $msg ) = @_;
+ push @trace, [ time, "[$$][". time2str('%r', time). "] $msg" ];
+}
+
+sub total {
+ $trace[-1]->[0] - $trace[0]->[0];
+}
+
+sub reset {
+ @trace = ();
+}
+
+sub dump_ary {
+ map $_->[1], @trace;
+}
+
+sub dump {
+ join("\n", map $_->[1], @trace). "\n";
+}
+
+sub dumpfile {
+ my( $class, $filename, $header ) = @_;
+ write_file( $filename, "$header\n". $class->dump );
+}
+
+1;
-----------------------------------------------------------------------
Summary of changes:
FS/FS/Trace.pm | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
create mode 100644 FS/FS/Trace.pm
More information about the freeside-commits
mailing list