Developing lightweight computation at the DSG edge

Commit edccffaa authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

[monitor-assign] Add policy parameter


Signed-off-by: Roger Pueyo Centelles's avatarRoger Pueyo Centelles <rpueyo@ac.upc.edu>
parent b21f178b
......@@ -87,6 +87,9 @@ var reassignIntervalHelp = "Interval (in seconds) in which to update the local d
var globalAssignCheckInterval = 150
var globalAssignCheckIntervalHelp = "Interval (in seconds) in which to check for changes in the global devices assignation list"
var policy = 1
var policyHelp = "Network devices to monitoring servers assignation policy"
// Global data structures
var cnmlDevices []cnml.DeviceIpv4sGraphserver //The global list with all the fetched devices and their IPv4 addresses
var cnmlDevicesChecksum string //The checksum of the last global devices list and IPv4 addresses fetched
......@@ -159,6 +162,7 @@ func initializeFlags() {
reassignIntervalPtr := flag.Int("reassignInterval", reassignInterval, reassignIntervalHelp)
globalAssignCheckIntervalPtr := flag.Int("globalAssignCheckInterval", globalAssignCheckInterval, globalAssignCheckIntervalHelp)
monitorTimeoutPtr := flag.Int("monitorTimeout", int(monitorTimeout), monitorTimeoutHelp)
policyPtr := flag.Int("policy", int(policy), policyHelp)
flag.Parse()
......@@ -207,6 +211,12 @@ func initializeFlags() {
if monitorTimeout <= int64(globalAssignCheckInterval) || monitorTimeout <= int64(reassignInterval) {
monitorTimeout = int64(math.Max(float64(globalAssignCheckInterval), float64(reassignInterval))) + 1
}
//Policy
if *policyPtr >= 1 && *policyPtr <= 1 {
policy = *policyPtr
}
}
// Get the global devices list from AntidoteDB
......
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