Chapter 2.3 : Daemon config



Configuration of Daemons is a toml file, example :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
[[daemon]]
name = "StatManager"
description = "One daemon of the swarm with statistics"
log_file = "daemon_stat.log"
log_level = "DEBUG"
hostname = "localhost"
receiving_port = 3390
stat_nb_bin = 50
stat_hist_lower_bound = 0.0
stat_hist_upper_bound = 100.0
daemon_required_response_timeout = 1000

[[daemon]]
name = "Daemon1"
description = "One daemon of the swarm with statistics"
log_file = "daemon1_test.log"
log_level = "DEBUG"
hostname = "localhost"
receiving_port = 3391
stat_nb_bin = 50
stat_hist_lower_bound = 0.0
stat_hist_upper_bound = 100.0
daemon_required_response_timeout = 2000

[[daemon]]
name = "Daemon2"
description = "An other daemon of the swarm with statistics"
log_file = "daemon2_test.log"
log_level = "DEBUG"
hostname = "localhost"
receiving_port = 3391
stat_nb_bin = 50
stat_hist_lower_bound = 0.0
stat_hist_upper_bound = 100.0
daemon_required_response_timeout = 2000
Then, Daemon are aware of the full Swarm so user can send data to a Daemon using only its name. In this example Daemon1 or Daemon2. The StatManager is a spacial Daemon which manages all statistics of the swarm, see section 2.2. Where, fo each Daemon :
  • name : name of the Daemon (other Daemon will send message at this name, no need of address or port when programming a Daemon)
  • description : description of the Daemon (just to remember what it is suppoed to do
  • log_file : log file of the Daemon
  • log_level : level of the log (ALWAYS, INFO, ERROR, CRITICAL, DEBUG)
  • hostname : host name where the Daemon is spawned
  • receiving_port : port used by the Daemon to received message (Data, Instructions, etc)
  • daemon_required_response_timeout : maximum authorized latency when sending confirmation message to the current Daemon based on the configuration of the receiver Daemon
  • stat_nb_bin : number if bins to be used in the histogram of the current Daemon statistics
  • stat_hist_lower_bound : lower bound in the histogram of the current Daemon statistics
  • stat_hist_upper_bound : upper bound in the histogram of the current Daemon statistics