Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Options:
--aggregationMethod=AGGREGATIONMETHOD
The consolidation function to fetch from on input and
aggregationMethod to set on output. One of: average,
last, max, min, avg_zero, absmax, absmin
last, max, min, avg_zero, absmax, absmin, median
--destinationPath=DESTINATIONPATH
Path to place created whisper file. Defaults to the
RRD file's source path.
Expand Down Expand Up @@ -66,7 +66,7 @@ Options:
--xFilesFactor=XFILESFACTOR
--aggregationMethod=AGGREGATIONMETHOD
Function to use when aggregating values (average, sum,
last, max, min, avg_zero, absmax, absmin)
last, max, min, avg_zero, absmax, absmin, median)
--overwrite
--estimate Don't create a whisper file, estimate storage requirements based on archive definitions
```
Expand Down Expand Up @@ -170,7 +170,7 @@ Options:
Change the xFilesFactor
--aggregationMethod=AGGREGATIONMETHOD
Change the aggregation function (average, sum, last,
max, min, avg_zero, absmax, absmin)
max, min, avg_zero, absmax, absmin, median)
--force Perform a destructive change
--newfile=NEWFILE Create a new database file without removing the
existing one
Expand All @@ -185,7 +185,7 @@ whisper-set-aggregation-method.py
Change the aggregation method of an existing whisper file.

```
Usage: whisper-set-aggregation-method.py path <average|sum|last|max|min|avg_zero|absmax|absmin>
Usage: whisper-set-aggregation-method.py path <average|sum|last|max|min|avg_zero|absmax|absmin|median>

Options:
-h, --help show this help message and exit
Expand Down
2 changes: 2 additions & 0 deletions bin/rrd2whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
aggregationMethods.remove('absmax')
# RRD doesn't have a 'absmin' type
aggregationMethods.remove('absmin')
# RRD doesn't have a 'median' type
aggregationMethods.remove('median')

option_parser = optparse.OptionParser(usage='''%prog rrd_path''')
option_parser.add_option(
Expand Down
4 changes: 4 additions & 0 deletions test_whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ def test_aggregate(self):
self.assertEqual(whisper.aggregate('absmin', [-3, -2, 1, 2]), 1)
# absmin with negative min
self.assertEqual(whisper.aggregate('absmin', [-2, -1, 2, 3]), -1)
# median with odd number of values
self.assertEqual(whisper.aggregate('median', [0, 14, 2, 3, 3]), 3)
# median with even number of values
self.assertEqual(whisper.aggregate('median', [10, 0, 6, 5]), 5.5)

with AssertRaisesException(
whisper.InvalidAggregationMethod(
Expand Down
Loading