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

Feature/servers by metric #56

Merged
merged 10 commits into from
Dec 5, 2018
Merged

Feature/servers by metric #56

merged 10 commits into from
Dec 5, 2018

Conversation

cscatolini
Copy link
Contributor

This PR adds a route that returns a list of rooms ordered by a metric. For legacy and room metrics it returns at most limit available rooms. For cpu and mem metrics it returns at most limit rooms ordered by increasing cpu or memory usage.

Also, I'm now reporting room usage metrics (cpu and memory) when a ping event is received if the corresponding metrics trigger is enabled.

Last but not least, I've fixed a bug that allowed a scheduler to be updated with metrics autoscaling bu no requests specified.

In a later PR we might change the cpu and memory autoscaler to retrieve the data we're now storing in Redis instead of calling Kubernetes API.

@coveralls
Copy link

coveralls commented Dec 4, 2018

Coverage Status

Coverage increased (+0.4%) to 82.45% when pulling 2787da5 on feature/servers-by-metric into 24d7a91 on master.

Copy link
Contributor

@lftakakura lftakakura left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@henrod henrod left a comment

Choose a reason for hiding this comment

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

Just one question, besides that LTGM

models/room.go Outdated

func getReadyRooms(tx redis.Pipeliner, schedulerName string, size int, mr *MixedMetricsReporter) ([]string, error) {
var result []string
rooms := tx.SScan(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why SScan and not SRandMember?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great question! I didn't see there was a SRandMember command with count. I'll change it because it's better to return random members.

@cscatolini cscatolini merged commit 19741fb into master Dec 5, 2018
@henrod henrod deleted the feature/servers-by-metric branch April 12, 2019 13:46
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.

None yet

4 participants