-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added configurable scheduling selection and moving to rate scheduling (…
…#8)
- Loading branch information
1 parent
c4e7031
commit ce274c0
Showing
12 changed files
with
300 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,6 @@ vendor/ | |
cover.out | ||
|
||
dist/ | ||
deployment/binaries/ | ||
|
||
coverage_unit.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package tsextractor | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestTimeAlignment_HourlyTimeWindows(t *testing.T) { | ||
// Test the time alignment with hourly time windows | ||
from, to := computeTimeAlignment(3600, 60) | ||
assert.Equal(t, int64(3600), to.Unix()-from.Unix()) | ||
} | ||
|
||
func TestTimeAlignment_15minTimeWindows(t *testing.T) { | ||
// Test the time alignment with hourly time windows | ||
from, to := computeTimeAlignment(3600, 15) | ||
assert.Equal(t, int64(900), to.Unix()-from.Unix()) | ||
} | ||
|
||
func TestTimeAlignment_15min_HourlyTimeWindows(t *testing.T) { | ||
// Test the time alignment with hourly time windows and 15min resolution | ||
from, to := computeTimeAlignment(900, 60) | ||
assert.Equal(t, int64(3600), to.Unix()-from.Unix()) | ||
} | ||
|
||
func TestTimeAlignment_5min_HourlyTimeWindows(t *testing.T) { | ||
// Test the time alignment with hourly time windows and 5min resolution | ||
from, to := computeTimeAlignment(300, 60) | ||
assert.Equal(t, int64(3600), to.Unix()-from.Unix()) | ||
} | ||
|
||
func TestTimeAlignment_raw_HourlyTimeWindows(t *testing.T) { | ||
// Test the time alignment with hourly time windows and 5min resolution | ||
from, to := computeTimeAlignment(-1, 60) | ||
assert.Equal(t, int64(3600), to.Unix()-from.Unix()) | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.