Skip to content

Commit

Permalink
Merge pull request #64 from telefonicaid/feature/CLAUDIA-5580_Configu…
Browse files Browse the repository at this point in the history
…rableMaxTimeBetweenFacts

Maximum time between facts is now a property in the configuration file
  • Loading branch information
Fernando López Aguilar committed Feb 10, 2016
2 parents f6ab5f9 + 08505d9 commit 3abc3b6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ Options that user could define:
redisHost: localhost # Address of redis-server
rabbitMQ: localhost # Address of RabbitMQ server
cloto: 127.0.0.1 # Address of fiware-cloto
maxTimeWindowsize: 10 # The maximum time between facts to be considered a valid Fact (seconds).


[mysql]
host: localhost # address of mysql that fiware-cloto is using
Expand Down
5 changes: 3 additions & 2 deletions facts/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
'clotoVersion': 'v1.0', # Cloto API version
'name': 'policymanager.facts', # name of the server
'logLevel': 'INFO',
'logFormat': '%(asctime)s %(levelname)s policymanager.facts %(message)s'
'logFormat': '%(asctime)s %(levelname)s policymanager.facts %(message)s',
'maxTimeWindowsize': 10 # The maximum time between facts to be considered a valid Fact (seconds).
}

cfg_mysql_defaults = {
Expand Down Expand Up @@ -158,7 +159,7 @@

config.set('common', 'cfg_file_path', str(cfg_filename))

windowsize_facts = datetime.timedelta(seconds=10)
windowsize_facts = datetime.timedelta(seconds=int(config.get('common', 'maxTimeWindowsize')))

fact_attributes = ['serverId', 'CpuValue', 'MemValue', 'HddValue', 'NetValue', 'DataTime']

Expand Down
1 change: 1 addition & 0 deletions facts_conf/fiware-facts.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ rabbitMQ: localhost
cloto: 127.0.0.1
clotoVersion: v1.0
name: policymanager.facts
maxTimeWindowsize: 10

[mysql]
host: localhost
Expand Down

0 comments on commit 3abc3b6

Please sign in to comment.