Details
-
Improvement
-
Resolution: Duplicate
-
Major - P3
-
None
-
None
-
None
Description
A user should be able to specify a balancing window for each day of the week. Where the day takes a number or string value between 00 and 06. "00" means Sunday, "01" means "Monday", and "06" means Saturday.
db.settings.updateOne(
|
{ _id: "balancer" }, |
{ $set: { activeWindow : { day : "<day_number>", start : "<start-time>", stop : "<stop-time>" } } }, |
{ upsert: true } |
)
|
For example, to set the balancing window from 9 to 5 Monday through Friday, and all day on weekends you would do the following:
db.settings.updateOne(
|
{ _id: "balancer" }, |
{ $set: {activeWindow: [
|
{ day: "00", start: "00:01", stop: "23:59" }, |
{ day: "01", start: "09:00", stop: "17:00" }, |
{ day: "02", start: "09:00", stop: "17:00" }, |
{ day: "03", start: "09:00", stop: "17:00" }, |
{ day: "04", start: "09:00", stop: "17:00" }, |
{ day: "05", start: "09:00", stop: "17:00" }, { day: "06", start: "00:01", stop: "23:59" } |
]
|
}
|
},
|
{ upsert: true } |
)
|
If they want to run overnight on weekdays from 10 PM to 6 AM, and all day on weekends, they would do the following:
db.settings.updateOne(
|
{ _id: "balancer" }, |
{ $set: {activeWindow: [
|
{ day: "00", start: "00:01", stop: "23:59" }, |
{ day: "06", start: "00:01", stop: "23:59" }, |
{ start: "22:00", stop: "06:00"} |
]
|
}
|
},
|
{ upsert: true } |
)
|
If the user does the current way below, it will also continue to work and apply to every day of the week.
db.settings.updateOne(
|
{ _id: "balancer" }, |
{ $set: { activeWindow : { start : "<start-time>", stop : "<stop-time>" } } }, |
{ upsert: true } |
)
|
Attachments
Issue Links
- duplicates
-
SERVER-82487 Balancing Window Per Day of the week
-
- Backlog
-