Developing lightweight computation at the DSG edge

Commit 2a8104a9 authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[monitor-assign] Add maxMons parameter


Signed-off-by: Roger Pueyo Centelles's avatarRoger Pueyo Centelles <rpueyo@ac.upc.edu>
parent 867b6934
......@@ -71,6 +71,11 @@ var IDts = "0_ts"
var minMons = 3
var minMonsHelp = "Minimum number of monitors to assign to each device"
// maxMons defines the maximum number of monitors a device must be assigned to,
// so that it is not monitored by more monitors than needed
var maxMons = minMons + 1
var maxMonsHelp = "Maximum number of monitors to assign to each device"
// maxDevs defines the default maximum number of nodes a monitor is assigned to
var maxDevs = 1000
var maxDevsHelp = "Maximum number of devices to monitor"
......@@ -156,6 +161,7 @@ func initializeFlags() {
idInt, _ := strconv.ParseInt(ID, 10, 32)
idPtr := flag.Int("id", int(idInt), idHelp)
minMonsPtr := flag.Int("minMons", minMons, minMonsHelp)
maxMonsPtr := flag.Int("maxMons", maxMons, maxMonsHelp)
maxDevsPtr := flag.Int("maxDevs", maxDevs, maxDevsHelp)
devsCheckIntervalPtr := flag.Int("devsCheckInterval", devsCheckInterval, devsCheckIntervalHelp)
fillingTimePtr := flag.Int("fillingTime", fillingTime, fillingTimeHelp)
......@@ -187,10 +193,13 @@ func initializeFlags() {
maxDevs = *maxDevsPtr
}
//Minimum monitors per device
// Minimum and maximum monitors per device
if *minMonsPtr > 0 {
minMons = *minMonsPtr
}
if *maxMonsPtr >= minMons {
maxMons = *maxMonsPtr
}
//Timers for tickers (intervals)
if *devsCheckIntervalPtr > 0 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment