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

Implement daily schedule sp #28

Merged
merged 8 commits into from
Jun 26, 2019
Merged

Implement daily schedule sp #28

merged 8 commits into from
Jun 26, 2019

Conversation

slai11
Copy link
Contributor

@slai11 slai11 commented Jun 25, 2019

New sp allows user to set minimum levels throughout the day.

Daily Schedule's metadata schema.

{
    "Default": 3,
    "Schedule": [
        { "Begin": 100, "End": 300, "Count": 10 },
        { "Begin": 800, "End": 1800, "Count": 20 }
    ]
}

@slai11 slai11 requested review from guangie88 and xtrntr June 25, 2019 08:04
"github.com/datagovsg/nomad-parametric-autoscaler/resources"
)

func TestDecodingDailyScheduleSP(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

optional: can include tests for invalid body should return error, valid body but invalid params should return error

}, nil
}

func verifyDailyScheduleMetadata(meta DailyScheduleSubPolicyMetadata) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

too bad mapstructure doesn't support the struct tag binding:"Required" like in Gin, otherwise this wouldnt be necessary

https://github.com/golang/go/wiki/Well-known-struct-tags

Copy link
Contributor

@xtrntr xtrntr left a comment

Choose a reason for hiding this comment

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

LGTM

@slai11 slai11 merged commit b9097d1 into master Jun 26, 2019
@slai11 slai11 deleted the daily-schedule branch June 26, 2019 11:37
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

2 participants