Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-82486

Balancing Window Per Day of the week

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

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

       

       

       

            Assignee:
            garaudy.etienne@mongodb.com Garaudy Etienne
            Reporter:
            garaudy.etienne@mongodb.com Garaudy Etienne
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: