Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added custom time horizon in GCP scaler #5778

Merged
merged 5 commits into from
May 4, 2024

Conversation

Yaxhveer
Copy link
Contributor

@Yaxhveer Yaxhveer commented May 3, 2024

Added the custom time horizon for gcp scalar and updated the test accordingly

Checklist

Fixes #5453

Relates to #

Signed-off-by: Yaxhveer <yaxhcod@gmail.com>
@Yaxhveer Yaxhveer requested a review from a team as a code owner May 3, 2024 18:57
Signed-off-by: Yaxhveer <yaxhcod@gmail.com>
Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good 😄
Does it make sense to support this in other stackdriver functions? For example, GetMetrics function has the time window hardcoded too:

func (s StackDriverClient) GetMetrics(
ctx context.Context,
filter string,
projectID string,
aggregation *monitoringpb.Aggregation,
valueIfNull *float64) (float64, error) {
// Set the start time to 1 minute ago
startTime := time.Now().UTC().Add(time.Minute * -2)
// Set the end time to now
endTime := time.Now().UTC()

pkg/scalers/gcp/gcp_stackdriver_client.go Show resolved Hide resolved
@Yaxhveer
Copy link
Contributor Author

Yaxhveer commented May 4, 2024

@JorTurFer I have made the required changes in other stackdrivers too.

CHANGELOG.md Outdated Show resolved Hide resolved
pkg/scalers/gcp/gcp_stackdriver_client.go Show resolved Hide resolved
@JorTurFer
Copy link
Member

JorTurFer commented May 4, 2024

/run-e2e gcp
Update: You can check the progress here

Co-authored-by: Jorge Turrado Ferrero <Jorge_turrado@hotmail.es>
Signed-off-by: Yashveer <101015836+Yaxhveer@users.noreply.github.com>
@JorTurFer
Copy link
Member

JorTurFer commented May 4, 2024

/run-e2e gcp
Update: You can check the progress here

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@JorTurFer JorTurFer merged commit 66e824d into kedacore:main May 4, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GCP Scalers: Add support for custom time horizon
2 participants