From 501b9236450bc1f38d3daf9d9f0dc60b72299d6c Mon Sep 17 00:00:00 2001
From: Alvaro Videla
Date: Mon, 21 Dec 2009 22:35:56 +0800
Subject: Modify rb:grep/1 to grep reports using the re module
---
lib/sasl/doc/src/rb.xml | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
(limited to 'lib/sasl/doc')
diff --git a/lib/sasl/doc/src/rb.xml b/lib/sasl/doc/src/rb.xml
index 5b49a7bced..810f7dca6b 100644
--- a/lib/sasl/doc/src/rb.xml
+++ b/lib/sasl/doc/src/rb.xml
@@ -46,17 +46,18 @@
grep(RegExp)
Search the reports for a regular expression
- RegExp = string()
+ RegExp = string() | {string, Options} | mp(), {mp(), Options}
All reports containing the regular expression RegExp
are printed.
- RegExp is a string containing the regular
- expression. Refer to the module regexp in the STDLIB
- reference manual
- for a definition of valid regular expressions. They are
- essentially the same as the UNIX command egrep.
+
RegExp can be a string containing the regular
+ expression; a tuple with the string and the options for
+ compilation; a compiled regular expression; a compiled
+ regular expression and the options for running it.
+ Refer to the module re and specially the function re:run/3
+ for a definition of valid regular expressions and options.
--
cgit v1.2.3
From e99ec8e235beb16d35e5a940b814061fb87db989 Mon Sep 17 00:00:00 2001
From: Alvaro Videla
Date: Tue, 22 Dec 2009 22:54:07 +0800
Subject: New rb:filter/1 function to ease report filtering
Currently in the rb module the only way to filter
reports is by using the grep/1 or re/1 functions
that use Regular Expressions.
This new function allow us to specify detailed
filters that will match against our reports.
Since the reports are proplists the filters are
tuples of the form {Key, Value}. If the report
contains that tuple, it will be displayed.
Usage:
1> rb:filter([{"foo", "bar"}, {"abc", "value"}]).
2> rb:filter([{"foo", "bar", no}]).
% excludes reports containing {"foo", "bar"}
3> rb:filter([{"foo", RegExp, re}]).
% the report must contain an element with Key = "foo"
% and Value must match RegExp
---
lib/sasl/doc/src/rb.xml | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
(limited to 'lib/sasl/doc')
diff --git a/lib/sasl/doc/src/rb.xml b/lib/sasl/doc/src/rb.xml
index 810f7dca6b..0b5df29333 100644
--- a/lib/sasl/doc/src/rb.xml
+++ b/lib/sasl/doc/src/rb.xml
@@ -42,6 +42,32 @@
+
+ filter(Filters)
+ Filter reports and displays them on the screen
+
+ Filters = [filter()]
+ filter() = {Key, Value} | {Key, Value, no} | {Key, RegExp, re} | {Key, RegExp, re, no}
+ Key = term()
+ Value = term()
+ RegExp = string() | {string, Options} | mp(), {mp(), Options}
+
+
+ This function displays the reports that match the provided filters.
+
+ When a filter includes the no atom it will exclude the reports that match
+ that filter.
+
+
+ The reports are matched using the proplists module. The report must be a proplist
+ to be matched against any of the filters().
+
+
+ If the filter is of the form {Key, RegExp, re} the report must contain an element with
+ key = Key and Value must match the RegExp regular expression.
+
+
+
grep(RegExp)
Search the reports for a regular expression
--
cgit v1.2.3
From 242c70ed5f0e2b84e9608bace183052e745614ed Mon Sep 17 00:00:00 2001
From: Alvaro Videla
Date: Fri, 25 Dec 2009 16:58:47 +0800
Subject: New rb:filter/2 to filter reports by date
The function filter/2 expects a second parameter
Dates that can be used to return reports that
occurred between the provided dates.
Usage:
Dec22 = {{2009,12,22},{0,0,0}}.
Dec24 = {{2009,12,24},{0,0,0}}.
rb:filter(Filters, {Dec22, from}).
%will return reports that occurred from Dec22.
rb:filter(Filters, {Dec22, to}).
%will return reports that occurred before Dec22.
rb:filter(Filters, {Dec22, Dec24}).
%will return reports that occurred between Dec22
% and Dec24
---
lib/sasl/doc/src/rb.xml | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
(limited to 'lib/sasl/doc')
diff --git a/lib/sasl/doc/src/rb.xml b/lib/sasl/doc/src/rb.xml
index 0b5df29333..bb205c0554 100644
--- a/lib/sasl/doc/src/rb.xml
+++ b/lib/sasl/doc/src/rb.xml
@@ -44,6 +44,7 @@
filter(Filters)
+ filter(Filters, Dates)
Filter reports and displays them on the screen
Filters = [filter()]
@@ -51,6 +52,9 @@
Key = term()
Value = term()
RegExp = string() | {string, Options} | mp(), {mp(), Options}
+ Dates = {DateFrom, DateTo} | {DateFrom, from} | {DateTo, to}
+ DateFrom = DateTo = {date(), time()}
+ date() and time() are the same type as in the calendar module
This function displays the reports that match the provided filters.
@@ -66,6 +70,25 @@
If the filter is of the form {Key, RegExp, re} the report must contain an element with
key = Key and Value must match the RegExp regular expression.
+
+ If the Dates parameter is provided, then the reports are filtered according to the date
+ when they occurred. If Dates is of the form {DateFrom, from} then reports that occurred
+ after DateFrom are displayed.
+
+
+ If Dates is of the form {DateTo, to} then reports that occurred before DateTo
+ are displayed.
+
+
+ If two Dates are provided, then reports that occurred between those dates are returned.
+
+
+ If you only want to filter only by dates, then you can provide the empty list as the Filters
+ parameter.
+
+
+ See rb:grep/1 for more information on the RegExp parameter.
+
--
cgit v1.2.3