test-fluentd-1pb.cfg 1.11 KB
Newer Older
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 36 37 38 39 40 41 42 43 44 45
[buildout]
extends = test-fluentd-common.cfg

[template-erp5-patched]
extra =
  {%- for family_name, zope_section_id_list in zope_family_dict.items() %}
  {%-   for zope_section_id in zope_section_id_list %}
  [{{zope_section_id}}]
  config-family = {{family_name}}
  {%-   endfor %}
  {%- endfor %}

[template-zope]
recipe =
target = ${template-zope-patched:location}

[template-zope-base]
<= template-zope
recipe = slapos.recipe.build:download

[template-zope-patched]
<= template-fluentd
base = ${template-zope-base:target}
method = unpack
tags =
  {%- if slapparameter_dict['family'] == 'fluentd' %}
  {%- for i, zope in enumerate(publish_list) %}
  {%-   do tags.__setitem__(
      node_id_base ~ (node_id_index_format % i) ~ '-stream', zope[0]) %}
  {%- endfor %}
  {%- endif %}

[feeder]
feeder =
  #
    import os, struct
    from random import lognormvariate
    pack = struct.Struct('!d').pack
    size = 65536
    data = os.urandom(size - 8)
    while True:
      emit('',
        ''.join((pack(time.time()) + data[:int(lognormvariate(10, 1))]
                ).ljust(size, '\0') for i in xrange(16)))
      time.sleep(interval)