[SERVER-82486] Balancing Window Per Day of the week Created: 27/Oct/23  Updated: 27/Oct/23  Resolved: 27/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Garaudy Etienne Assignee: Garaudy Etienne
Resolution: Duplicate Votes: 0
Labels: balancer
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-82487 Balancing Window Per Day of the week Backlog
Participants:

 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 }
) 

 

 

 


Generated at Thu Feb 08 06:49:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.