Allow to set more options

This patch unhardcode the following options:
collector:
  batch_size
  batch_timeout
notification:
  batch_size
  batch_timeout
  workload_partitioning

Drop unneded limition of rpc threads.

Change-Id: I04de4400eccd4af65f2ef66ff08e2b7a9f601809
Related-Prod: PROD-21194
diff --git a/ceilometer/files/ocata/ceilometer-server.conf.Debian b/ceilometer/files/ocata/ceilometer-server.conf.Debian
index 895cdad..8619648 100644
--- a/ceilometer/files/ocata/ceilometer-server.conf.Debian
+++ b/ceilometer/files/ocata/ceilometer-server.conf.Debian
@@ -540,10 +540,16 @@
 # Number of notification messages to wait before dispatching them (integer
 # value)
 #batch_size = 1
+{%- if server.get('collector', {}).batch_size is defined %}
+batch_size = {{ server.collector.batch_size }}
+{%- endif %}
 
 # Number of seconds to wait before dispatching samples when batch_size is not
 # reached (None means indefinitely) (integer value)
 #batch_timeout = <None>
+{%- if server.get('collector', {}).batch_timeout is defined %}
+batch_timeout = {{ server.collector.batch_timeout }}
+{%- endif %}
 
 # Number of workers for collector service. default value is 1. (integer value)
 # Minimum value: 1
@@ -1249,6 +1255,9 @@
 # Enable workload partitioning, allowing multiple notification agents to be run
 # simultaneously. (boolean value)
 #workload_partitioning = false
+{%- if server.get('notification', {}).workload_partitioning is defined %}
+workload_partitioning = {{ server.notification.workload_partitioning }}
+{%- endif %}
 
 # Messaging URLs to listen for notifications. Example:
 # rabbit://user:pass@host1:port1[,user:pass@hostN:portN]/virtual_host
@@ -1262,10 +1271,16 @@
 # advised when transformations are applied in pipeline. (integer value)
 # Minimum value: 1
 #batch_size = 100
+{%- if server.get('notification', {}).batch_size is defined %}
+batch_size = {{ server.notification.batch_size }}
+{%- endif %}
 
 # Number of seconds to wait before publishing samples when batch_size is not
 # reached (None means indefinitely) (integer value)
 #batch_timeout = 5
+{%- if server.get('notification', {}).batch_timeout is defined %}
+batch_timeout = {{ server.notification.batch_timeout }}
+{%- endif %}
 
 # Number of workers for notification service, default value is 1. (integer
 # value)
diff --git a/ceilometer/files/pike/ceilometer-server.conf.Debian b/ceilometer/files/pike/ceilometer-server.conf.Debian
index a2a52a9..eca1c73 100644
--- a/ceilometer/files/pike/ceilometer-server.conf.Debian
+++ b/ceilometer/files/pike/ceilometer-server.conf.Debian
@@ -56,30 +56,42 @@
 [cors]
 
 
-{% if server.get('cors', {}).allowed_origin is defined %}
+{%- if server.get('cors', {}).allowed_origin is defined %}
 allowed_origin = {{ server.cors.allowed_origin }}
-{% endif %}
+{%- endif %}
 
-{% if server.get('cors', {}).allow_credentials is defined %}
+{%- if server.get('cors', {}).allow_credentials is defined %}
 allow_credentials = {{ server.cors.allow_credentials }}
-{% endif %}
+{%- endif %}
 
-{% if server.get('cors', {}).expose_headers is defined %}
+{%- if server.get('cors', {}).expose_headers is defined %}
 expose_headers = {{ server.cors.expose_headers }}
-{% endif %}
+{%- endif %}
 
-{% if server.get('cors', {}).max_age is defined %}
+{%- if server.get('cors', {}).max_age is defined %}
 max_age = {{ server.cors.max_age }}
-{% endif %}
+{%- endif %}
 
-{% if server.get('cors', {}).allow_methods is defined %}
+{%- if server.get('cors', {}).allow_methods is defined %}
 allow_methods = {{ server.cors.allow_methods }}
-{% endif %}
+{%- endif %}
 
-{% if server.get('cors', {}).allow_headers is defined %}
+{%- if server.get('cors', {}).allow_headers is defined %}
 allow_headers = {{ server.cors.allow_headers }}
-{% endif %}
+{%- endif %}
 
+[notification]
+{%- if server.get('notification', {}).workload_partitioning is defined %}
+workload_partitioning = {{ server.notification.workload_partitioning }}
+{%- endif %}
+
+{%- if server.get('notification', {}).batch_size is defined %}
+batch_size = {{ server.notification.batch_size }}
+{%- endif %}
+
+{%- if server.get('notification', {}).batch_timeout is defined %}
+batch_timeout = {{ server.notification.batch_timeout }}
+{%- endif %}
 
 [database]
 
diff --git a/ceilometer/files/queens/ceilometer-server.conf.Debian b/ceilometer/files/queens/ceilometer-server.conf.Debian
index e4ea563..2190366 100644
--- a/ceilometer/files/queens/ceilometer-server.conf.Debian
+++ b/ceilometer/files/queens/ceilometer-server.conf.Debian
@@ -233,6 +233,9 @@
 # This option is deprecated for removal.
 # Its value may be silently ignored in the future.
 #workload_partitioning = false
+{%- if server.get('notification', {}).workload_partitioning is defined %}
+workload_partitioning = {{ server.notification.workload_partitioning }}
+{%- endif %}
 
 # Messaging URLs to listen for notifications. Example:
 # rabbit://user:pass@host1:port1[,user:pass@hostN:portN]/virtual_host
@@ -246,10 +249,16 @@
 # advised when transformations are applied in pipeline. (integer value)
 # Minimum value: 1
 #batch_size = 100
+{%- if server.get('notification', {}).batch_size is defined %}
+batch_size = {{ server.notification.batch_size }}
+{%- endif %}
 
 # Number of seconds to wait before publishing samples when batch_size is not
 # reached (None means indefinitely) (integer value)
 #batch_timeout = 5
+{%- if server.get('notification', {}).batch_timeout is defined %}
+batch_timeout = {{ server.notification.batch_timeout }}
+{%- endif %}
 
 # Number of workers for notification service, default value is 1. (integer
 # value)
diff --git a/metadata/service/agent/cluster.yml b/metadata/service/agent/cluster.yml
index 2132fe1..588dc26 100644
--- a/metadata/service/agent/cluster.yml
+++ b/metadata/service/agent/cluster.yml
@@ -43,5 +43,3 @@
         password: ${_param:rabbitmq_openstack_password}
         virtual_host: '/openstack'
         ha_queues: true
-        # Workaround for https://bugs.launchpad.net/ceilometer/+bug/1337715
-        rpc_thread_pool_size: 5
diff --git a/metadata/service/agent/single.yml b/metadata/service/agent/single.yml
index 1f1fca2..b0a0058 100644
--- a/metadata/service/agent/single.yml
+++ b/metadata/service/agent/single.yml
@@ -42,5 +42,3 @@
         user: openstack
         password: ${_param:rabbitmq_openstack_password}
         virtual_host: '/openstack'
-        # Workaround for https://bugs.launchpad.net/ceilometer/+bug/1337715
-        rpc_thread_pool_size: 5
diff --git a/metadata/service/server/cluster.yml b/metadata/service/server/cluster.yml
index 33df2b4..933b488 100644
--- a/metadata/service/server/cluster.yml
+++ b/metadata/service/server/cluster.yml
@@ -47,8 +47,6 @@
         user: openstack
         password: ${_param:rabbitmq_openstack_password}
         virtual_host: '/openstack'
-        # Workaround for https://bugs.launchpad.net/ceilometer/+bug/1337715
-        rpc_thread_pool_size: 5
       database:
         engine: mongodb
         members:
diff --git a/metadata/service/server/single.yml b/metadata/service/server/single.yml
index 5c5ddf8..e0366eb 100644
--- a/metadata/service/server/single.yml
+++ b/metadata/service/server/single.yml
@@ -47,8 +47,6 @@
         password: ${_param:rabbitmq_openstack_password}
         virtual_host: '/openstack'
         ha_queues: true
-        # Workaround for https://bugs.launchpad.net/ceilometer/+bug/1337715
-        rpc_thread_pool_size: 5
       database:
         engine: mongodb
         host: ${_param:ceilometer_database_host}
diff --git a/tests/pillar/server_cluster.sls b/tests/pillar/server_cluster.sls
index 7a6c50d..6aec6f1 100644
--- a/tests/pillar/server_cluster.sls
+++ b/tests/pillar/server_cluster.sls
@@ -3,7 +3,7 @@
     debug: true
     region: RegionOne
     enabled: true
-    version: mitaka
+    version: pike
     cluster: true
     secret: password
     ttl: 86400
@@ -59,6 +59,9 @@
         enabled: true
         host: 127.0.0.4
         port: 8086
+    notification:
+      batch_timeout: 10
+      batch_size: 100
       policy:
         segregation: 'rule:context_is_admin'
         'telemetry:get_resource':