mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2025-07-22 21:01:41 +02:00
fix: Update to resampler resolution handling
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func SimpleResampler(data []util.Float, old_frequency int64, new_frequency int64) ([]util.Float, error) {
|
||||
if old_frequency == 0 || new_frequency == 0 {
|
||||
if old_frequency == 0 || new_frequency == 0 || new_frequency <= old_frequency {
|
||||
return nil, errors.New("either old or new frequency is set to 0")
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ func SimpleResampler(data []util.Float, old_frequency int64, new_frequency int64
|
||||
// Adapted from https://github.com/haoel/downsampling/blob/master/core/lttb.go
|
||||
func LargestTriangleThreeBucket(data []util.Float, old_frequency int64, new_frequency int64) ([]util.Float, int64, error) {
|
||||
|
||||
if old_frequency == 0 || new_frequency == 0 {
|
||||
if old_frequency == 0 || new_frequency == 0 || new_frequency <= old_frequency {
|
||||
return data, old_frequency, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user