<reponame>vimeo/Diamond
#!/usr/bin/python
# coding=utf-8
################################################################################

from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch

from diamond.collector import Collector
from haproxy import HAProxyCollector

################################################################################


class TestHAProxyCollector(CollectorTestCase):
    def setUp(self):
        config = get_collector_config('HAProxyCollector', {
            'interval': 10,
        })

        self.collector = HAProxyCollector(config, None)

    @patch.object(Collector, 'publish')
    def test_should_work_with_real_data(self, publish_mock):
        self.collector.config['ignore_servers'] = False

        with patch('urllib2.urlopen', Mock(
                return_value=self.getFixture('stats.csv'))):
            self.collector.collect()

        metrics = {
            'admin.frontend.smax': 2.000000,
            'admin.frontend.slim': 10000.000000,
            'admin.frontend.stot': 5302.000000,
            'admin.frontend.bin': 745023.000000,
            'admin.frontend.bout': 25323272.000000,
            'admin.frontend.dreq': 0.000000,
            'admin.frontend.dresp': 0.000000,
            'admin.frontend.ereq': 4.000000,
            'admin.frontend.pid': 1.000000,
            'admin.frontend.iid': 1.000000,
            'admin.frontend.sid': 0.000000,
            'admin.frontend.type': 0.000000,
            'admin.frontend.rate': 1.000000,
            'admin.frontend.rate_lim': 0.000000,
            'admin.frontend.rate_max': 3.000000,
            'admin.frontend.hrsp_1xx': 0.000000,
            'admin.frontend.hrsp_2xx': 5297.000000,
            'admin.frontend.hrsp_3xx': 0.000000,
            'admin.frontend.hrsp_4xx': 4.000000,
            'admin.frontend.hrsp_5xx': 0.000000,
            'admin.frontend.hrsp_other': 0.000000,
            'admin.frontend.req_rate': 1.000000,
            'admin.frontend.req_rate_max': 2.000000,
            'admin.frontend.req_tot': 5302.000000,
            'admin.backend.qcur': 0.000000,
            'admin.backend.qmax': 0.000000,
            'admin.backend.scur': 0.000000,
            'admin.backend.smax': 0.000000,
            'admin.backend.slim': 10000.000000,
            'admin.backend.stot': 0.000000,
            'admin.backend.bin': 745023.000000,
            'admin.backend.bout': 25323272.000000,
            'admin.backend.dreq': 0.000000,
            'admin.backend.dresp': 0.000000,
            'admin.backend.econ': 0.000000,
            'admin.backend.eresp': 0.000000,
            'admin.backend.wretr': 0.000000,
            'admin.backend.wredis': 0.000000,
            'admin.backend.weight': 0.000000,
            'admin.backend.act': 0.000000,
            'admin.backend.bck': 0.000000,
            'admin.backend.chkdown': 0.000000,
            'admin.backend.lastchg': 1422928.000000,
            'admin.backend.downtime': 0.000000,
            'admin.backend.pid': 1.000000,
            'admin.backend.iid': 1.000000,
            'admin.backend.sid': 0.000000,
            'admin.backend.lbtot': 0.000000,
            'admin.backend.type': 1.000000,
            'admin.backend.rate': 0.000000,
            'admin.backend.rate_max': 0.000000,
            'admin.backend.hrsp_1xx': 0.000000,
            'admin.backend.hrsp_2xx': 0.000000,
            'admin.backend.hrsp_3xx': 0.000000,
            'admin.backend.hrsp_4xx': 0.000000,
            'admin.backend.hrsp_5xx': 0.000000,
            'admin.backend.hrsp_other': 0.000000,
            'admin.backend.cli_abrt': 0.000000,
            'admin.backend.srv_abrt': 0.000000,
            'app-domain-com.frontend.scur': 1.000000,
            'app-domain-com.frontend.smax': 46.000000,
            'app-domain-com.frontend.slim': 10000.000000,
            'app-domain-com.frontend.stot': 3693012.000000,
            'app-domain-com.frontend.bin': 2039943478.000000,
            'app-domain-com.frontend.bout': 10930406397.000000,
            'app-domain-com.frontend.dreq': 0.000000,
            'app-domain-com.frontend.dresp': 0.000000,
            'app-domain-com.frontend.ereq': 0.000000,
            'app-domain-com.frontend.pid': 1.000000,
            'app-domain-com.frontend.iid': 2.000000,
            'app-domain-com.frontend.sid': 0.000000,
            'app-domain-com.frontend.type': 0.000000,
            'app-domain-com.frontend.rate': 2.000000,
            'app-domain-com.frontend.rate_lim': 0.000000,
            'app-domain-com.frontend.rate_max': 42.000000,
            'app-domain-com.frontend.hrsp_1xx': 0.000000,
            'app-domain-com.frontend.hrsp_2xx': 2233273.000000,
            'app-domain-com.frontend.hrsp_3xx': 48964.000000,
            'app-domain-com.frontend.hrsp_4xx': 1410658.000000,
            'app-domain-com.frontend.hrsp_5xx': 116.000000,
            'app-domain-com.frontend.hrsp_other': 0.000000,
            'app-domain-com.frontend.req_rate': 2.000000,
            'app-domain-com.frontend.req_rate_max': 42.000000,
            'app-domain-com.frontend.req_tot': 3693012.000000,
            'app-domain-com.app1.qcur': 0.000000,
            'app-domain-com.app1.qmax': 0.000000,
            'app-domain-com.app1.scur': 0.000000,
            'app-domain-com.app1.smax': 6.000000,
            'app-domain-com.app1.slim': 10.000000,
            'app-domain-com.app1.stot': 461726.000000,
            'app-domain-com.app1.bin': 255007214.000000,
            'app-domain-com.app1.bout': 1390689182.000000,
            'app-domain-com.app1.dresp': 0.000000,
            'app-domain-com.app1.econ': 0.000000,
            'app-domain-com.app1.eresp': 3.000000,
            'app-domain-com.app1.wretr': 154.000000,
            'app-domain-com.app1.wredis': 74.000000,
            'app-domain-com.app1.weight': 1.000000,
            'app-domain-com.app1.act': 1.000000,
            'app-domain-com.app1.bck': 0.000000,
            'app-domain-com.app1.chkfail': 1140.000000,
            'app-domain-com.app1.chkdown': 29.000000,
            'app-domain-com.app1.lastchg': 19180.000000,
            'app-domain-com.app1.downtime': 585.000000,
            'app-domain-com.app1.pid': 1.000000,
            'app-domain-com.app1.iid': 2.000000,
            'app-domain-com.app1.sid': 1.000000,
            'app-domain-com.app1.lbtot': 461572.000000,
            'app-domain-com.app1.type': 2.000000,
            'app-domain-com.app1.rate': 1.000000,
            'app-domain-com.app1.rate_max': 6.000000,
            'app-domain-com.app1.check_code': 200.000000,
            'app-domain-com.app1.check_duration': 0.000000,
            'app-domain-com.app1.hrsp_1xx': 0.000000,
            'app-domain-com.app1.hrsp_2xx': 279292.000000,
            'app-domain-com.app1.hrsp_3xx': 6146.000000,
            'app-domain-com.app1.hrsp_4xx': 176051.000000,
            'app-domain-com.app1.hrsp_5xx': 6.000000,
            'app-domain-com.app1.hrsp_other': 0.000000,
            'app-domain-com.app1.hanafail': 0.000000,
            'app-domain-com.app1.cli_abrt': 32.000000,
            'app-domain-com.app1.srv_abrt': 0.000000,
            'app-domain-com.app2.qcur': 0.000000,
            'app-domain-com.app2.qmax': 0.000000,
            'app-domain-com.app2.scur': 0.000000,
            'app-domain-com.app2.smax': 6.000000,
            'app-domain-com.app2.slim': 10.000000,
            'app-domain-com.app2.stot': 461535.000000,
            'app-domain-com.app2.bin': 254976461.000000,
            'app-domain-com.app2.bout': 1367418013.000000,
            'app-domain-com.app2.dresp': 0.000000,
            'app-domain-com.app2.econ': 0.000000,
            'app-domain-com.app2.eresp': 6.000000,
            'app-domain-com.app2.wretr': 142.000000,
            'app-domain-com.app2.wredis': 69.000000,
            'app-domain-com.app2.weight': 1.000000,
            'app-domain-com.app2.act': 1.000000,
            'app-domain-com.app2.bck': 0.000000,
            'app-domain-com.app2.chkfail': 1113.000000,
            'app-domain-com.app2.chkdown': 36.000000,
            'app-domain-com.app2.lastchg': 19167.000000,
            'app-domain-com.app2.downtime': 613.000000,
            'app-domain-com.app2.pid': 1.000000,
            'app-domain-com.app2.iid': 2.000000,
            'app-domain-com.app2.sid': 2.000000,
            'app-domain-com.app2.lbtot': 461393.000000,
            'app-domain-com.app2.type': 2.000000,
            'app-domain-com.app2.rate': 0.000000,
            'app-domain-com.app2.rate_max': 6.000000,
            'app-domain-com.app2.check_code': 200.000000,
            'app-domain-com.app2.check_duration': 0.000000,
            'app-domain-com.app2.hrsp_1xx': 0.000000,
            'app-domain-com.app2.hrsp_2xx': 279798.000000,
            'app-domain-com.app2.hrsp_3xx': 6198.000000,
            'app-domain-com.app2.hrsp_4xx': 175317.000000,
            'app-domain-com.app2.hrsp_5xx': 5.000000,
            'app-domain-com.app2.hrsp_other': 0.000000,
            'app-domain-com.app2.hanafail': 0.000000,
            'app-domain-com.app2.cli_abrt': 30.000000,
            'app-domain-com.app2.srv_abrt': 0.000000,
            'app-domain-com.app3.qcur': 0.000000,
            'app-domain-com.app3.qmax': 0.000000,
            'app-domain-com.app3.scur': 0.000000,
            'app-domain-com.app3.smax': 6.000000,
            'app-domain-com.app3.slim': 10.000000,
            'app-domain-com.app3.stot': 462019.000000,
            'app-domain-com.app3.bin': 254900671.000000,
            'app-domain-com.app3.bout': 1346762213.000000,
            'app-domain-com.app3.dresp': 0.000000,
            'app-domain-com.app3.econ': 0.000000,
            'app-domain-com.app3.eresp': 13.000000,
            'app-domain-com.app3.wretr': 159.000000,
            'app-domain-com.app3.wredis': 77.000000,
            'app-domain-com.app3.weight': 1.000000,
            'app-domain-com.app3.act': 1.000000,
            'app-domain-com.app3.bck': 0.000000,
            'app-domain-com.app3.chkfail': 1105.000000,
            'app-domain-com.app3.chkdown': 28.000000,
            'app-domain-com.app3.lastchg': 19150.000000,
            'app-domain-com.app3.downtime': 458.000000,
            'app-domain-com.app3.pid': 1.000000,
            'app-domain-com.app3.iid': 2.000000,
            'app-domain-com.app3.sid': 3.000000,
            'app-domain-com.app3.lbtot': 461860.000000,
            'app-domain-com.app3.type': 2.000000,
            'app-domain-com.app3.rate': 1.000000,
            'app-domain-com.app3.rate_max': 6.000000,
            'app-domain-com.app3.check_code': 200.000000,
            'app-domain-com.app3.check_duration': 0.000000,
            'app-domain-com.app3.hrsp_1xx': 0.000000,
            'app-domain-com.app3.hrsp_2xx': 278937.000000,
            'app-domain-com.app3.hrsp_3xx': 6106.000000,
            'app-domain-com.app3.hrsp_4xx': 176720.000000,
            'app-domain-com.app3.hrsp_5xx': 7.000000,
            'app-domain-com.app3.hrsp_other': 0.000000,
            'app-domain-com.app3.hanafail': 0.000000,
            'app-domain-com.app3.cli_abrt': 21.000000,
            'app-domain-com.app3.srv_abrt': 0.000000,
            'app-domain-com.app4.qcur': 0.000000,
            'app-domain-com.app4.qmax': 0.000000,
            'app-domain-com.app4.scur': 0.000000,
            'app-domain-com.app4.smax': 6.000000,
            'app-domain-com.app4.slim': 10.000000,
            'app-domain-com.app4.stot': 461843.000000,
            'app-domain-com.app4.bin': 254871154.000000,
            'app-domain-com.app4.bout': 1377745261.000000,
            'app-domain-com.app4.dresp': 0.000000,
            'app-domain-com.app4.econ': 0.000000,
            'app-domain-com.app4.eresp': 9.000000,
            'app-domain-com.app4.wretr': 149.000000,
            'app-domain-com.app4.wredis': 70.000000,
            'app-domain-com.app4.weight': 1.000000,
            'app-domain-com.app4.act': 1.000000,
            'app-domain-com.app4.bck': 0.000000,
            'app-domain-com.app4.chkfail': 1146.000000,
            'app-domain-com.app4.chkdown': 31.000000,
            'app-domain-com.app4.lastchg': 29426.000000,
            'app-domain-com.app4.downtime': 481.000000,
            'app-domain-com.app4.pid': 1.000000,
            'app-domain-com.app4.iid': 2.000000,
            'app-domain-com.app4.sid': 4.000000,
            'app-domain-com.app4.lbtot': 461694.000000,
            'app-domain-com.app4.type': 2.000000,
            'app-domain-com.app4.rate': 0.000000,
            'app-domain-com.app4.rate_max': 7.000000,
            'app-domain-com.app4.check_code': 200.000000,
            'app-domain-com.app4.check_duration': 0.000000,
            'app-domain-com.app4.hrsp_1xx': 0.000000,
            'app-domain-com.app4.hrsp_2xx': 279199.000000,
            'app-domain-com.app4.hrsp_3xx': 6076.000000,
            'app-domain-com.app4.hrsp_4xx': 176338.000000,
            'app-domain-com.app4.hrsp_5xx': 2.000000,
            'app-domain-com.app4.hrsp_other': 0.000000,
            'app-domain-com.app4.hanafail': 0.000000,
            'app-domain-com.app4.cli_abrt': 28.000000,
            'app-domain-com.app4.srv_abrt': 0.000000,
            'app-domain-com.app5.qcur': 0.000000,
            'app-domain-com.app5.qmax': 0.000000,
            'app-domain-com.app5.scur': 0.000000,
            'app-domain-com.app5.smax': 6.000000,
            'app-domain-com.app5.slim': 10.000000,
            'app-domain-com.app5.stot': 461687.000000,
            'app-domain-com.app5.bin': 254792036.000000,
            'app-domain-com.app5.bout': 1358313883.000000,
            'app-domain-com.app5.dresp': 0.000000,
            'app-domain-com.app5.econ': 0.000000,
            'app-domain-com.app5.eresp': 8.000000,
            'app-domain-com.app5.wretr': 154.000000,
            'app-domain-com.app5.wredis': 75.000000,
            'app-domain-com.app5.weight': 1.000000,
            'app-domain-com.app5.act': 1.000000,
            'app-domain-com.app5.bck': 0.000000,
            'app-domain-com.app5.chkfail': 1107.000000,
            'app-domain-com.app5.chkdown': 29.000000,
            'app-domain-com.app5.lastchg': 19120.000000,
            'app-domain-com.app5.downtime': 490.000000,
            'app-domain-com.app5.pid': 1.000000,
            'app-domain-com.app5.iid': 2.000000,
            'app-domain-com.app5.sid': 5.000000,
            'app-domain-com.app5.lbtot': 461533.000000,
            'app-domain-com.app5.type': 2.000000,
            'app-domain-com.app5.rate': 0.000000,
            'app-domain-com.app5.rate_max': 7.000000,
            'app-domain-com.app5.check_code': 200.000000,
            'app-domain-com.app5.check_duration': 0.000000,
            'app-domain-com.app5.hrsp_1xx': 0.000000,
            'app-domain-com.app5.hrsp_2xx': 278801.000000,
            'app-domain-com.app5.hrsp_3xx': 6040.000000,
            'app-domain-com.app5.hrsp_4xx': 176596.000000,
            'app-domain-com.app5.hrsp_5xx': 13.000000,
            'app-domain-com.app5.hrsp_other': 0.000000,
            'app-domain-com.app5.hanafail': 0.000000,
            'app-domain-com.app5.cli_abrt': 29.000000,
            'app-domain-com.app5.srv_abrt': 0.000000,
            'app-domain-com.app6.qcur': 0.000000,
            'app-domain-com.app6.qmax': 0.000000,
            'app-domain-com.app6.scur': 0.000000,
            'app-domain-com.app6.smax': 6.000000,
            'app-domain-com.app6.slim': 10.000000,
            'app-domain-com.app6.stot': 461870.000000,
            'app-domain-com.app6.bin': 254918298.000000,
            'app-domain-com.app6.bout': 1342115240.000000,
            'app-domain-com.app6.dresp': 0.000000,
            'app-domain-com.app6.econ': 0.000000,
            'app-domain-com.app6.eresp': 7.000000,
            'app-domain-com.app6.wretr': 149.000000,
            'app-domain-com.app6.wredis': 71.000000,
            'app-domain-com.app6.weight': 1.000000,
            'app-domain-com.app6.act': 1.000000,
            'app-domain-com.app6.bck': 0.000000,
            'app-domain-com.app6.chkfail': 1061.000000,
            'app-domain-com.app6.chkdown': 29.000000,
            'app-domain-com.app6.lastchg': 19106.000000,
            'app-domain-com.app6.downtime': 510.000000,
            'app-domain-com.app6.pid': 1.000000,
            'app-domain-com.app6.iid': 2.000000,
            'app-domain-com.app6.sid': 6.000000,
            'app-domain-com.app6.lbtot': 461721.000000,
            'app-domain-com.app6.type': 2.000000,
            'app-domain-com.app6.rate': 0.000000,
            'app-domain-com.app6.rate_max': 6.000000,
            'app-domain-com.app6.check_code': 200.000000,
            'app-domain-com.app6.check_duration': 0.000000,
            'app-domain-com.app6.hrsp_1xx': 0.000000,
            'app-domain-com.app6.hrsp_2xx': 279091.000000,
            'app-domain-com.app6.hrsp_3xx': 6094.000000,
            'app-domain-com.app6.hrsp_4xx': 176453.000000,
            'app-domain-com.app6.hrsp_5xx': 6.000000,
            'app-domain-com.app6.hrsp_other': 0.000000,
            'app-domain-com.app6.hanafail': 0.000000,
            'app-domain-com.app6.cli_abrt': 33.000000,
            'app-domain-com.app6.srv_abrt': 0.000000,
            'app-domain-com.app7.qcur': 0.000000,
            'app-domain-com.app7.qmax': 0.000000,
            'app-domain-com.app7.scur': 0.000000,
            'app-domain-com.app7.smax': 6.000000,
            'app-domain-com.app7.slim': 10.000000,
            'app-domain-com.app7.stot': 462057.000000,
            'app-domain-com.app7.bin': 255159195.000000,
            'app-domain-com.app7.bout': 1382969429.000000,
            'app-domain-com.app7.dresp': 0.000000,
            'app-domain-com.app7.econ': 0.000000,
            'app-domain-com.app7.eresp': 9.000000,
            'app-domain-com.app7.wretr': 154.000000,
            'app-domain-com.app7.wredis': 73.000000,
            'app-domain-com.app7.weight': 1.000000,
            'app-domain-com.app7.act': 1.000000,
            'app-domain-com.app7.bck': 0.000000,
            'app-domain-com.app7.chkfail': 1136.000000,
            'app-domain-com.app7.chkdown': 33.000000,
            'app-domain-com.app7.lastchg': 19090.000000,
            'app-domain-com.app7.downtime': 467.000000,
            'app-domain-com.app7.pid': 1.000000,
            'app-domain-com.app7.iid': 2.000000,
            'app-domain-com.app7.sid': 7.000000,
            'app-domain-com.app7.lbtot': 461903.000000,
            'app-domain-com.app7.type': 2.000000,
            'app-domain-com.app7.rate': 0.000000,
            'app-domain-com.app7.rate_max': 7.000000,
            'app-domain-com.app7.check_code': 200.000000,
            'app-domain-com.app7.check_duration': 0.000000,
            'app-domain-com.app7.hrsp_1xx': 0.000000,
            'app-domain-com.app7.hrsp_2xx': 278790.000000,
            'app-domain-com.app7.hrsp_3xx': 6223.000000,
            'app-domain-com.app7.hrsp_4xx': 176803.000000,
            'app-domain-com.app7.hrsp_5xx': 5.000000,
            'app-domain-com.app7.hrsp_other': 0.000000,
            'app-domain-com.app7.hanafail': 0.000000,
            'app-domain-com.app7.cli_abrt': 33.000000,
            'app-domain-com.app7.srv_abrt': 0.000000,
            'app-domain-com.app8.qcur': 0.000000,
            'app-domain-com.app8.qmax': 0.000000,
            'app-domain-com.app8.scur': 1.000000,
            'app-domain-com.app8.smax': 6.000000,
            'app-domain-com.app8.slim': 10.000000,
            'app-domain-com.app8.stot': 462034.000000,
            'app-domain-com.app8.bin': 255318449.000000,
            'app-domain-com.app8.bout': 1364393176.000000,
            'app-domain-com.app8.dresp': 0.000000,
            'app-domain-com.app8.econ': 0.000000,
            'app-domain-com.app8.eresp': 11.000000,
            'app-domain-com.app8.wretr': 129.000000,
            'app-domain-com.app8.wredis': 60.000000,
            'app-domain-com.app8.weight': 1.000000,
            'app-domain-com.app8.act': 1.000000,
            'app-domain-com.app8.bck': 0.000000,
            'app-domain-com.app8.chkfail': 1099.000000,
            'app-domain-com.app8.chkdown': 23.000000,
            'app-domain-com.app8.lastchg': 19077.000000,
            'app-domain-com.app8.downtime': 356.000000,
            'app-domain-com.app8.pid': 1.000000,
            'app-domain-com.app8.iid': 2.000000,
            'app-domain-com.app8.sid': 8.000000,
            'app-domain-com.app8.lbtot': 461905.000000,
            'app-domain-com.app8.type': 2.000000,
            'app-domain-com.app8.rate': 1.000000,
            'app-domain-com.app8.rate_max': 7.000000,
            'app-domain-com.app8.check_code': 200.000000,
            'app-domain-com.app8.check_duration': 0.000000,
            'app-domain-com.app8.hrsp_1xx': 0.000000,
            'app-domain-com.app8.hrsp_2xx': 279365.000000,
            'app-domain-com.app8.hrsp_3xx': 6081.000000,
            'app-domain-com.app8.hrsp_4xx': 176380.000000,
            'app-domain-com.app8.hrsp_5xx': 7.000000,
            'app-domain-com.app8.hrsp_other': 0.000000,
            'app-domain-com.app8.hanafail': 0.000000,
            'app-domain-com.app8.cli_abrt': 40.000000,
            'app-domain-com.app8.srv_abrt': 0.000000,
            'app-domain-com.backend.qcur': 0.000000,
            'app-domain-com.backend.qmax': 0.000000,
            'app-domain-com.backend.scur': 1.000000,
            'app-domain-com.backend.smax': 46.000000,
            'app-domain-com.backend.slim': 10000.000000,
            'app-domain-com.backend.stot': 3693012.000000,
            'app-domain-com.backend.bin': 2039943478.000000,
            'app-domain-com.backend.bout': 10930406397.000000,
            'app-domain-com.backend.dreq': 0.000000,
            'app-domain-com.backend.dresp': 0.000000,
            'app-domain-com.backend.econ': 0.000000,
            'app-domain-com.backend.eresp': 66.000000,
            'app-domain-com.backend.wretr': 1190.000000,
            'app-domain-com.backend.wredis': 569.000000,
            'app-domain-com.backend.weight': 8.000000,
            'app-domain-com.backend.act': 8.000000,
            'app-domain-com.backend.bck': 0.000000,
            'app-domain-com.backend.chkdown': 0.000000,
            'app-domain-com.backend.lastchg': 1422928.000000,
            'app-domain-com.backend.downtime': 0.000000,
            'app-domain-com.backend.pid': 1.000000,
            'app-domain-com.backend.iid': 2.000000,
            'app-domain-com.backend.sid': 0.000000,
            'app-domain-com.backend.lbtot': 3693581.000000,
            'app-domain-com.backend.type': 1.000000,
            'app-domain-com.backend.rate': 2.000000,
            'app-domain-com.backend.rate_max': 42.000000,
            'app-domain-com.backend.hrsp_1xx': 0.000000,
            'app-domain-com.backend.hrsp_2xx': 2233273.000000,
            'app-domain-com.backend.hrsp_3xx': 48964.000000,
            'app-domain-com.backend.hrsp_4xx': 1410658.000000,
            'app-domain-com.backend.hrsp_5xx': 116.000000,
            'app-domain-com.backend.hrsp_other': 0.000000,
            'app-domain-com.backend.cli_abrt': 246.000000,
            'app-domain-com.backend.srv_abrt': 0.000000,
            'trans-service.frontend.scur': 0.000000,
            'trans-service.frontend.smax': 0.000000,
            'trans-service.frontend.slim': 10000.000000,
            'trans-service.frontend.stot': 0.000000,
            'trans-service.frontend.bin': 0.000000,
            'trans-service.frontend.bout': 0.000000,
            'trans-service.frontend.dreq': 0.000000,
            'trans-service.frontend.dresp': 0.000000,
            'trans-service.frontend.ereq': 0.000000,
            'trans-service.frontend.pid': 1.000000,
            'trans-service.frontend.iid': 3.000000,
            'trans-service.frontend.sid': 0.000000,
            'trans-service.frontend.type': 0.000000,
            'trans-service.frontend.rate': 0.000000,
            'trans-service.frontend.rate_lim': 0.000000,
            'trans-service.frontend.rate_max': 0.000000,
            'trans-service.frontend.hrsp_1xx': 0.000000,
            'trans-service.frontend.hrsp_2xx': 0.000000,
            'trans-service.frontend.hrsp_3xx': 0.000000,
            'trans-service.frontend.hrsp_4xx': 0.000000,
            'trans-service.frontend.hrsp_5xx': 0.000000,
            'trans-service.frontend.hrsp_other': 0.000000,
            'trans-service.frontend.req_rate': 0.000000,
            'trans-service.frontend.req_rate_max': 0.000000,
            'trans-service.frontend.req_tot': 0.000000,
            'trans-service.trans1.qcur': 0.000000,
            'trans-service.trans1.qmax': 0.000000,
            'trans-service.trans1.scur': 0.000000,
            'trans-service.trans1.smax': 0.000000,
            'trans-service.trans1.stot': 0.000000,
            'trans-service.trans1.bin': 0.000000,
            'trans-service.trans1.bout': 0.000000,
            'trans-service.trans1.dresp': 0.000000,
            'trans-service.trans1.econ': 0.000000,
            'trans-service.trans1.eresp': 0.000000,
            'trans-service.trans1.wretr': 0.000000,
            'trans-service.trans1.wredis': 0.000000,
            'trans-service.trans1.weight': 1.000000,
            'trans-service.trans1.act': 1.000000,
            'trans-service.trans1.bck': 0.000000,
            'trans-service.trans1.chkfail': 31.000000,
            'trans-service.trans1.chkdown': 3.000000,
            'trans-service.trans1.lastchg': 222121.000000,
            'trans-service.trans1.downtime': 116.000000,
            'trans-service.trans1.pid': 1.000000,
            'trans-service.trans1.iid': 3.000000,
            'trans-service.trans1.sid': 1.000000,
            'trans-service.trans1.lbtot': 0.000000,
            'trans-service.trans1.type': 2.000000,
            'trans-service.trans1.rate': 0.000000,
            'trans-service.trans1.rate_max': 0.000000,
            'trans-service.trans1.check_code': 200.000000,
            'trans-service.trans1.check_duration': 10.000000,
            'trans-service.trans1.hrsp_1xx': 0.000000,
            'trans-service.trans1.hrsp_2xx': 0.000000,
            'trans-service.trans1.hrsp_3xx': 0.000000,
            'trans-service.trans1.hrsp_4xx': 0.000000,
            'trans-service.trans1.hrsp_5xx': 0.000000,
            'trans-service.trans1.hrsp_other': 0.000000,
            'trans-service.trans1.hanafail': 0.000000,
            'trans-service.trans1.cli_abrt': 0.000000,
            'trans-service.trans1.srv_abrt': 0.000000,
            'trans-service.trans2.qcur': 0.000000,
            'trans-service.trans2.qmax': 0.000000,
            'trans-service.trans2.scur': 0.000000,
            'trans-service.trans2.smax': 0.000000,
            'trans-service.trans2.stot': 0.000000,
            'trans-service.trans2.bin': 0.000000,
            'trans-service.trans2.bout': 0.000000,
            'trans-service.trans2.dresp': 0.000000,
            'trans-service.trans2.econ': 0.000000,
            'trans-service.trans2.eresp': 0.000000,
            'trans-service.trans2.wretr': 0.000000,
            'trans-service.trans2.wredis': 0.000000,
            'trans-service.trans2.weight': 1.000000,
            'trans-service.trans2.act': 1.000000,
            'trans-service.trans2.bck': 0.000000,
            'trans-service.trans2.chkfail': 28.000000,
            'trans-service.trans2.chkdown': 3.000000,
            'trans-service.trans2.lastchg': 222121.000000,
            'trans-service.trans2.downtime': 116.000000,
            'trans-service.trans2.pid': 1.000000,
            'trans-service.trans2.iid': 3.000000,
            'trans-service.trans2.sid': 2.000000,
            'trans-service.trans2.lbtot': 0.000000,
            'trans-service.trans2.type': 2.000000,
            'trans-service.trans2.rate': 0.000000,
            'trans-service.trans2.rate_max': 0.000000,
            'trans-service.trans2.check_code': 200.000000,
            'trans-service.trans2.check_duration': 12.000000,
            'trans-service.trans2.hrsp_1xx': 0.000000,
            'trans-service.trans2.hrsp_2xx': 0.000000,
            'trans-service.trans2.hrsp_3xx': 0.000000,
            'trans-service.trans2.hrsp_4xx': 0.000000,
            'trans-service.trans2.hrsp_5xx': 0.000000,
            'trans-service.trans2.hrsp_other': 0.000000,
            'trans-service.trans2.hanafail': 0.000000,
            'trans-service.trans2.cli_abrt': 0.000000,
            'trans-service.trans2.srv_abrt': 0.000000,
            'trans-service.backend.qcur': 0.000000,
            'trans-service.backend.qmax': 0.000000,
            'trans-service.backend.scur': 0.000000,
            'trans-service.backend.smax': 0.000000,
            'trans-service.backend.slim': 10000.000000,
            'trans-service.backend.stot': 0.000000,
            'trans-service.backend.bin': 0.000000,
            'trans-service.backend.bout': 0.000000,
            'trans-service.backend.dreq': 0.000000,
            'trans-service.backend.dresp': 0.000000,
            'trans-service.backend.econ': 0.000000,
            'trans-service.backend.eresp': 0.000000,
            'trans-service.backend.wretr': 0.000000,
            'trans-service.backend.wredis': 0.000000,
            'trans-service.backend.weight': 2.000000,
            'trans-service.backend.act': 2.000000,
            'trans-service.backend.bck': 0.000000,
            'trans-service.backend.chkdown': 3.000000,
            'trans-service.backend.lastchg': 222121.000000,
            'trans-service.backend.downtime': 116.000000,
            'trans-service.backend.pid': 1.000000,
            'trans-service.backend.iid': 3.000000,
            'trans-service.backend.sid': 0.000000,
            'trans-service.backend.lbtot': 0.000000,
            'trans-service.backend.type': 1.000000,
            'trans-service.backend.rate': 0.000000,
            'trans-service.backend.rate_max': 0.000000,
            'trans-service.backend.hrsp_1xx': 0.000000,
            'trans-service.backend.hrsp_2xx': 0.000000,
            'trans-service.backend.hrsp_3xx': 0.000000,
            'trans-service.backend.hrsp_4xx': 0.000000,
            'trans-service.backend.hrsp_5xx': 0.000000,
            'trans-service.backend.hrsp_other': 0.000000,
            'trans-service.backend.cli_abrt': 0.000000,
            'trans-service.backend.srv_abrt': 0.000000,
        }

        self.setDocExample(self.collector.__class__.__name__, metrics)
        self.assertPublishedMany(publish_mock, metrics)

    @patch.object(Collector, 'publish')
    def test_should_work_with_real_data_and_ignore_servers(self, publish_mock):
        self.collector.config['ignore_servers'] = True

        with patch('urllib2.urlopen', Mock(
                return_value=self.getFixture('stats.csv'))):
            self.collector.collect()

        self.assertPublishedMany(publish_mock, {
            'admin.frontend.scur': 1.000000,
            'admin.frontend.smax': 2.000000,
            'admin.frontend.slim': 10000.000000,
            'admin.frontend.stot': 5302.000000,
            'admin.frontend.bin': 745023.000000,
            'admin.frontend.bout': 25323272.000000,
            'admin.frontend.dreq': 0.000000,
            'admin.frontend.dresp': 0.000000,
            'admin.frontend.ereq': 4.000000,
            'admin.frontend.pid': 1.000000,
            'admin.frontend.iid': 1.000000,
            'admin.frontend.sid': 0.000000,
            'admin.frontend.type': 0.000000,
            'admin.frontend.rate': 1.000000,
            'admin.frontend.rate_lim': 0.000000,
            'admin.frontend.rate_max': 3.000000,
            'admin.frontend.hrsp_1xx': 0.000000,
            'admin.frontend.hrsp_2xx': 5297.000000,
            'admin.frontend.hrsp_3xx': 0.000000,
            'admin.frontend.hrsp_4xx': 4.000000,
            'admin.frontend.hrsp_5xx': 0.000000,
            'admin.frontend.hrsp_other': 0.000000,
            'admin.frontend.req_rate': 1.000000,
            'admin.frontend.req_rate_max': 2.000000,
            'admin.frontend.req_tot': 5302.000000,
            'admin.backend.qcur': 0.000000,
            'admin.backend.qmax': 0.000000,
            'admin.backend.scur': 0.000000,
            'admin.backend.smax': 0.000000,
            'admin.backend.slim': 10000.000000,
            'admin.backend.stot': 0.000000,
            'admin.backend.bin': 745023.000000,
            'admin.backend.bout': 25323272.000000,
            'admin.backend.dreq': 0.000000,
            'admin.backend.dresp': 0.000000,
            'admin.backend.econ': 0.000000,
            'admin.backend.eresp': 0.000000,
            'admin.backend.wretr': 0.000000,
            'admin.backend.wredis': 0.000000,
            'admin.backend.weight': 0.000000,
            'admin.backend.act': 0.000000,
            'admin.backend.bck': 0.000000,
            'admin.backend.chkdown': 0.000000,
            'admin.backend.lastchg': 1422928.000000,
            'admin.backend.downtime': 0.000000,
            'admin.backend.pid': 1.000000,
            'admin.backend.iid': 1.000000,
            'admin.backend.sid': 0.000000,
            'admin.backend.lbtot': 0.000000,
            'admin.backend.type': 1.000000,
            'admin.backend.rate': 0.000000,
            'admin.backend.rate_max': 0.000000,
            'admin.backend.hrsp_1xx': 0.000000,
            'admin.backend.hrsp_2xx': 0.000000,
            'admin.backend.hrsp_3xx': 0.000000,
            'admin.backend.hrsp_4xx': 0.000000,
            'admin.backend.hrsp_5xx': 0.000000,
            'admin.backend.hrsp_other': 0.000000,
            'admin.backend.cli_abrt': 0.000000,
            'admin.backend.srv_abrt': 0.000000,
            'app-domain-com.frontend.scur': 1.000000,
            'app-domain-com.frontend.smax': 46.000000,
            'app-domain-com.frontend.slim': 10000.000000,
            'app-domain-com.frontend.stot': 3693012.000000,
            'app-domain-com.frontend.bin': 2039943478.000000,
            'app-domain-com.frontend.bout': 10930406397.000000,
            'app-domain-com.frontend.dreq': 0.000000,
            'app-domain-com.frontend.dresp': 0.000000,
            'app-domain-com.frontend.ereq': 0.000000,
            'app-domain-com.frontend.pid': 1.000000,
            'app-domain-com.frontend.iid': 2.000000,
            'app-domain-com.frontend.sid': 0.000000,
            'app-domain-com.frontend.type': 0.000000,
            'app-domain-com.frontend.rate': 2.000000,
            'app-domain-com.frontend.rate_lim': 0.000000,
            'app-domain-com.frontend.rate_max': 42.000000,
            'app-domain-com.frontend.hrsp_1xx': 0.000000,
            'app-domain-com.frontend.hrsp_2xx': 2233273.000000,
            'app-domain-com.frontend.hrsp_3xx': 48964.000000,
            'app-domain-com.frontend.hrsp_4xx': 1410658.000000,
            'app-domain-com.frontend.hrsp_5xx': 116.000000,
            'app-domain-com.frontend.hrsp_other': 0.000000,
            'app-domain-com.frontend.req_rate': 2.000000,
            'app-domain-com.frontend.req_rate_max': 42.000000,
            'app-domain-com.frontend.req_tot': 3693012.000000,
            'app-domain-com.backend.qcur': 0.000000,
            'app-domain-com.backend.qmax': 0.000000,
            'app-domain-com.backend.scur': 1.000000,
            'app-domain-com.backend.smax': 46.000000,
            'app-domain-com.backend.slim': 10000.000000,
            'app-domain-com.backend.stot': 3693012.000000,
            'app-domain-com.backend.bin': 2039943478.000000,
            'app-domain-com.backend.bout': 10930406397.000000,
            'app-domain-com.backend.dreq': 0.000000,
            'app-domain-com.backend.dresp': 0.000000,
            'app-domain-com.backend.econ': 0.000000,
            'app-domain-com.backend.eresp': 66.000000,
            'app-domain-com.backend.wretr': 1190.000000,
            'app-domain-com.backend.wredis': 569.000000,
            'app-domain-com.backend.weight': 8.000000,
            'app-domain-com.backend.act': 8.000000,
            'app-domain-com.backend.bck': 0.000000,
            'app-domain-com.backend.chkdown': 0.000000,
            'app-domain-com.backend.lastchg': 1422928.000000,
            'app-domain-com.backend.downtime': 0.000000,
            'app-domain-com.backend.pid': 1.000000,
            'app-domain-com.backend.iid': 2.000000,
            'app-domain-com.backend.sid': 0.000000,
            'app-domain-com.backend.lbtot': 3693581.000000,
            'app-domain-com.backend.type': 1.000000,
            'app-domain-com.backend.rate': 2.000000,
            'app-domain-com.backend.rate_max': 42.000000,
            'app-domain-com.backend.hrsp_1xx': 0.000000,
            'app-domain-com.backend.hrsp_2xx': 2233273.000000,
            'app-domain-com.backend.hrsp_3xx': 48964.000000,
            'app-domain-com.backend.hrsp_4xx': 1410658.000000,
            'app-domain-com.backend.hrsp_5xx': 116.000000,
            'app-domain-com.backend.hrsp_other': 0.000000,
            'app-domain-com.backend.cli_abrt': 246.000000,
            'app-domain-com.backend.srv_abrt': 0.000000,
            'trans-service.frontend.scur': 0.000000,
            'trans-service.frontend.smax': 0.000000,
            'trans-service.frontend.slim': 10000.000000,
            'trans-service.frontend.stot': 0.000000,
            'trans-service.frontend.bin': 0.000000,
            'trans-service.frontend.bout': 0.000000,
            'trans-service.frontend.dreq': 0.000000,
            'trans-service.frontend.dresp': 0.000000,
            'trans-service.frontend.ereq': 0.000000,
            'trans-service.frontend.pid': 1.000000,
            'trans-service.frontend.iid': 3.000000,
            'trans-service.frontend.sid': 0.000000,
            'trans-service.frontend.type': 0.000000,
            'trans-service.frontend.rate': 0.000000,
            'trans-service.frontend.rate_lim': 0.000000,
            'trans-service.frontend.rate_max': 0.000000,
            'trans-service.frontend.hrsp_1xx': 0.000000,
            'trans-service.frontend.hrsp_2xx': 0.000000,
            'trans-service.frontend.hrsp_3xx': 0.000000,
            'trans-service.frontend.hrsp_4xx': 0.000000,
            'trans-service.frontend.hrsp_5xx': 0.000000,
            'trans-service.frontend.hrsp_other': 0.000000,
            'trans-service.frontend.req_rate': 0.000000,
            'trans-service.frontend.req_rate_max': 0.000000,
            'trans-service.frontend.req_tot': 0.000000,
            'trans-service.backend.qcur': 0.000000,
            'trans-service.backend.qmax': 0.000000,
            'trans-service.backend.scur': 0.000000,
            'trans-service.backend.smax': 0.000000,
            'trans-service.backend.slim': 10000.000000,
            'trans-service.backend.stot': 0.000000,
            'trans-service.backend.bin': 0.000000,
            'trans-service.backend.bout': 0.000000,
            'trans-service.backend.dreq': 0.000000,
            'trans-service.backend.dresp': 0.000000,
            'trans-service.backend.econ': 0.000000,
            'trans-service.backend.eresp': 0.000000,
            'trans-service.backend.wretr': 0.000000,
            'trans-service.backend.wredis': 0.000000,
            'trans-service.backend.weight': 2.000000,
            'trans-service.backend.act': 2.000000,
            'trans-service.backend.bck': 0.000000,
            'trans-service.backend.chkdown': 3.000000,
            'trans-service.backend.lastchg': 222121.000000,
            'trans-service.backend.downtime': 116.000000,
            'trans-service.backend.pid': 1.000000,
            'trans-service.backend.iid': 3.000000,
            'trans-service.backend.sid': 0.000000,
            'trans-service.backend.lbtot': 0.000000,
            'trans-service.backend.type': 1.000000,
            'trans-service.backend.rate': 0.000000,
            'trans-service.backend.rate_max': 0.000000,
            'trans-service.backend.hrsp_1xx': 0.000000,
            'trans-service.backend.hrsp_2xx': 0.000000,
            'trans-service.backend.hrsp_3xx': 0.000000,
            'trans-service.backend.hrsp_4xx': 0.000000,
            'trans-service.backend.hrsp_5xx': 0.000000,
            'trans-service.backend.hrsp_other': 0.000000,
            'trans-service.backend.cli_abrt': 0.000000,
            'trans-service.backend.srv_abrt': 0.000000,
        })

################################################################################
if __name__ == "__main__":
    unittest.main()

#!/usr/bin/python
# coding=utf-8
################################################################################

from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch

from diamond.collector import Collector
from haproxy import HAProxyCollector

################################################################################


class TestHAProxyCollector(CollectorTestCase):
    def setUp(self):
        config = get_collector_config('HAProxyCollector', {
            'interval': 10,
        })

        self.collector = HAProxyCollector(config, None)

    @patch.object(Collector, 'publish')
    def test_should_work_with_real_data(self, publish_mock):
        self.collector.config['ignore_servers'] = False

        with patch('urllib2.urlopen', Mock(
                return_value=self.getFixture('stats.csv'))):
            self.collector.collect()

        metrics = {
            'admin.frontend.smax': 2.000000,
            'admin.frontend.slim': 10000.000000,
            'admin.frontend.stot': 5302.000000,
            'admin.frontend.bin': 745023.000000,
            'admin.frontend.bout': 25323272.000000,
            'admin.frontend.dreq': 0.000000,
            'admin.frontend.dresp': 0.000000,
            'admin.frontend.ereq': 4.000000,
            'admin.frontend.pid': 1.000000,
            'admin.frontend.iid': 1.000000,
            'admin.frontend.sid': 0.000000,
            'admin.frontend.type': 0.000000,
            'admin.frontend.rate': 1.000000,
            'admin.frontend.rate_lim': 0.000000,
            'admin.frontend.rate_max': 3.000000,
            'admin.frontend.hrsp_1xx': 0.000000,
            'admin.frontend.hrsp_2xx': 5297.000000,
            'admin.frontend.hrsp_3xx': 0.000000,
            'admin.frontend.hrsp_4xx': 4.000000,
            'admin.frontend.hrsp_5xx': 0.000000,
            'admin.frontend.hrsp_other': 0.000000,
            'admin.frontend.req_rate': 1.000000,
            'admin.frontend.req_rate_max': 2.000000,
            'admin.frontend.req_tot': 5302.000000,
            'admin.backend.qcur': 0.000000,
            'admin.backend.qmax': 0.000000,
            'admin.backend.scur': 0.000000,
            'admin.backend.smax': 0.000000,
            'admin.backend.slim': 10000.000000,
            'admin.backend.stot': 0.000000,
            'admin.backend.bin': 745023.000000,
            'admin.backend.bout': 25323272.000000,
            'admin.backend.dreq': 0.000000,
            'admin.backend.dresp': 0.000000,
            'admin.backend.econ': 0.000000,
            'admin.backend.eresp': 0.000000,
            'admin.backend.wretr': 0.000000,
            'admin.backend.wredis': 0.000000,
            'admin.backend.weight': 0.000000,
            'admin.backend.act': 0.000000,
            'admin.backend.bck': 0.000000,
            'admin.backend.chkdown': 0.000000,
            'admin.backend.lastchg': 1422928.000000,
            'admin.backend.downtime': 0.000000,
            'admin.backend.pid': 1.000000,
            'admin.backend.iid': 1.000000,
            'admin.backend.sid': 0.000000,
            'admin.backend.lbtot': 0.000000,
            'admin.backend.type': 1.000000,
            'admin.backend.rate': 0.000000,
            'admin.backend.rate_max': 0.000000,
            'admin.backend.hrsp_1xx': 0.000000,
            'admin.backend.hrsp_2xx': 0.000000,
            'admin.backend.hrsp_3xx': 0.000000,
            'admin.backend.hrsp_4xx': 0.000000,
            'admin.backend.hrsp_5xx': 0.000000,
            'admin.backend.hrsp_other': 0.000000,
            'admin.backend.cli_abrt': 0.000000,
            'admin.backend.srv_abrt': 0.000000,
            'app-domain-com.frontend.scur': 1.000000,
            'app-domain-com.frontend.smax': 46.000000,
            'app-domain-com.frontend.slim': 10000.000000,
            'app-domain-com.frontend.stot': 3693012.000000,
            'app-domain-com.frontend.bin': 2039943478.000000,
            'app-domain-com.frontend.bout': 10930406397.000000,
            'app-domain-com.frontend.dreq': 0.000000,
            'app-domain-com.frontend.dresp': 0.000000,
            'app-domain-com.frontend.ereq': 0.000000,
            'app-domain-com.frontend.pid': 1.000000,
            'app-domain-com.frontend.iid': 2.000000,
            'app-domain-com.frontend.sid': 0.000000,
            'app-domain-com.frontend.type': 0.000000,
            'app-domain-com.frontend.rate': 2.000000,
            'app-domain-com.frontend.rate_lim': 0.000000,
            'app-domain-com.frontend.rate_max': 42.000000,
            'app-domain-com.frontend.hrsp_1xx': 0.000000,
            'app-domain-com.frontend.hrsp_2xx': 2233273.000000,
            'app-domain-com.frontend.hrsp_3xx': 48964.000000,
            'app-domain-com.frontend.hrsp_4xx': 1410658.000000,
            'app-domain-com.frontend.hrsp_5xx': 116.000000,
            'app-domain-com.frontend.hrsp_other': 0.000000,
            'app-domain-com.frontend.req_rate': 2.000000,
            'app-domain-com.frontend.req_rate_max': 42.000000,
            'app-domain-com.frontend.req_tot': 3693012.000000,
            'app-domain-com.app1.qcur': 0.000000,
            'app-domain-com.app1.qmax': 0.000000,
            'app-domain-com.app1.scur': 0.000000,
            'app-domain-com.app1.smax': 6.000000,
            'app-domain-com.app1.slim': 10.000000,
            'app-domain-com.app1.stot': 461726.000000,
            'app-domain-com.app1.bin': 255007214.000000,
            'app-domain-com.app1.bout': 1390689182.000000,
            'app-domain-com.app1.dresp': 0.000000,
            'app-domain-com.app1.econ': 0.000000,
            'app-domain-com.app1.eresp': 3.000000,
            'app-domain-com.app1.wretr': 154.000000,
            'app-domain-com.app1.wredis': 74.000000,
            'app-domain-com.app1.weight': 1.000000,
            'app-domain-com.app1.act': 1.000000,
            'app-domain-com.app1.bck': 0.000000,
            'app-domain-com.app1.chkfail': 1140.000000,
            'app-domain-com.app1.chkdown': 29.000000,
            'app-domain-com.app1.lastchg': 19180.000000,
            'app-domain-com.app1.downtime': 585.000000,
            'app-domain-com.app1.pid': 1.000000,
            'app-domain-com.app1.iid': 2.000000,
            'app-domain-com.app1.sid': 1.000000,
            'app-domain-com.app1.lbtot': 461572.000000,
            'app-domain-com.app1.type': 2.000000,
            'app-domain-com.app1.rate': 1.000000,
            'app-domain-com.app1.rate_max': 6.000000,
            'app-domain-com.app1.check_code': 200.000000,
            'app-domain-com.app1.check_duration': 0.000000,
            'app-domain-com.app1.hrsp_1xx': 0.000000,
            'app-domain-com.app1.hrsp_2xx': 279292.000000,
            'app-domain-com.app1.hrsp_3xx': 6146.000000,
            'app-domain-com.app1.hrsp_4xx': 176051.000000,
            'app-domain-com.app1.hrsp_5xx': 6.000000,
            'app-domain-com.app1.hrsp_other': 0.000000,
            'app-domain-com.app1.hanafail': 0.000000,
            'app-domain-com.app1.cli_abrt': 32.000000,
            'app-domain-com.app1.srv_abrt': 0.000000,
            'app-domain-com.app2.qcur': 0.000000,
            'app-domain-com.app2.qmax': 0.000000,
            'app-domain-com.app2.scur': 0.000000,
            'app-domain-com.app2.smax': 6.000000,
            'app-domain-com.app2.slim': 10.000000,
            'app-domain-com.app2.stot': 461535.000000,
            'app-domain-com.app2.bin': 254976461.000000,
            'app-domain-com.app2.bout': 1367418013.000000,
            'app-domain-com.app2.dresp': 0.000000,
            'app-domain-com.app2.econ': 0.000000,
            'app-domain-com.app2.eresp': 6.000000,
            'app-domain-com.app2.wretr': 142.000000,
            'app-domain-com.app2.wredis': 69.000000,
            'app-domain-com.app2.weight': 1.000000,
            'app-domain-com.app2.act': 1.000000,
            'app-domain-com.app2.bck': 0.000000,
            'app-domain-com.app2.chkfail': 1113.000000,
            'app-domain-com.app2.chkdown': 36.000000,
            'app-domain-com.app2.lastchg': 19167.000000,
            'app-domain-com.app2.downtime': 613.000000,
            'app-domain-com.app2.pid': 1.000000,
            'app-domain-com.app2.iid': 2.000000,
            'app-domain-com.app2.sid': 2.000000,
            'app-domain-com.app2.lbtot': 461393.000000,
            'app-domain-com.app2.type': 2.000000,
            'app-domain-com.app2.rate': 0.000000,
            'app-domain-com.app2.rate_max': 6.000000,
            'app-domain-com.app2.check_code': 200.000000,
            'app-domain-com.app2.check_duration': 0.000000,
            'app-domain-com.app2.hrsp_1xx': 0.000000,
            'app-domain-com.app2.hrsp_2xx': 279798.000000,
            'app-domain-com.app2.hrsp_3xx': 6198.000000,
            'app-domain-com.app2.hrsp_4xx': 175317.000000,
            'app-domain-com.app2.hrsp_5xx': 5.000000,
            'app-domain-com.app2.hrsp_other': 0.000000,
            'app-domain-com.app2.hanafail': 0.000000,
            'app-domain-com.app2.cli_abrt': 30.000000,
            'app-domain-com.app2.srv_abrt': 0.000000,
            'app-domain-com.app3.qcur': 0.000000,
            'app-domain-com.app3.qmax': 0.000000,
            'app-domain-com.app3.scur': 0.000000,
            'app-domain-com.app3.smax': 6.000000,
            'app-domain-com.app3.slim': 10.000000,
            'app-domain-com.app3.stot': 462019.000000,
            'app-domain-com.app3.bin': 254900671.000000,
            'app-domain-com.app3.bout': 1346762213.000000,
            'app-domain-com.app3.dresp': 0.000000,
            'app-domain-com.app3.econ': 0.000000,
            'app-domain-com.app3.eresp': 13.000000,
            'app-domain-com.app3.wretr': 159.000000,
            'app-domain-com.app3.wredis': 77.000000,
            'app-domain-com.app3.weight': 1.000000,
            'app-domain-com.app3.act': 1.000000,
            'app-domain-com.app3.bck': 0.000000,
            'app-domain-com.app3.chkfail': 1105.000000,
            'app-domain-com.app3.chkdown': 28.000000,
            'app-domain-com.app3.lastchg': 19150.000000,
            'app-domain-com.app3.downtime': 458.000000,
            'app-domain-com.app3.pid': 1.000000,
            'app-domain-com.app3.iid': 2.000000,
            'app-domain-com.app3.sid': 3.000000,
            'app-domain-com.app3.lbtot': 461860.000000,
            'app-domain-com.app3.type': 2.000000,
            'app-domain-com.app3.rate': 1.000000,
            'app-domain-com.app3.rate_max': 6.000000,
            'app-domain-com.app3.check_code': 200.000000,
            'app-domain-com.app3.check_duration': 0.000000,
            'app-domain-com.app3.hrsp_1xx': 0.000000,
            'app-domain-com.app3.hrsp_2xx': 278937.000000,
            'app-domain-com.app3.hrsp_3xx': 6106.000000,
            'app-domain-com.app3.hrsp_4xx': 176720.000000,
            'app-domain-com.app3.hrsp_5xx': 7.000000,
            'app-domain-com.app3.hrsp_other': 0.000000,
            'app-domain-com.app3.hanafail': 0.000000,
            'app-domain-com.app3.cli_abrt': 21.000000,
            'app-domain-com.app3.srv_abrt': 0.000000,
            'app-domain-com.app4.qcur': 0.000000,
            'app-domain-com.app4.qmax': 0.000000,
            'app-domain-com.app4.scur': 0.000000,
            'app-domain-com.app4.smax': 6.000000,
            'app-domain-com.app4.slim': 10.000000,
            'app-domain-com.app4.stot': 461843.000000,
            'app-domain-com.app4.bin': 254871154.000000,
            'app-domain-com.app4.bout': 1377745261.000000,
            'app-domain-com.app4.dresp': 0.000000,
            'app-domain-com.app4.econ': 0.000000,
            'app-domain-com.app4.eresp': 9.000000,
            'app-domain-com.app4.wretr': 149.000000,
            'app-domain-com.app4.wredis': 70.000000,
            'app-domain-com.app4.weight': 1.000000,
            'app-domain-com.app4.act': 1.000000,
            'app-domain-com.app4.bck': 0.000000,
            'app-domain-com.app4.chkfail': 1146.000000,
            'app-domain-com.app4.chkdown': 31.000000,
            'app-domain-com.app4.lastchg': 29426.000000,
            'app-domain-com.app4.downtime': 481.000000,
            'app-domain-com.app4.pid': 1.000000,
            'app-domain-com.app4.iid': 2.000000,
            'app-domain-com.app4.sid': 4.000000,
            'app-domain-com.app4.lbtot': 461694.000000,
            'app-domain-com.app4.type': 2.000000,
            'app-domain-com.app4.rate': 0.000000,
            'app-domain-com.app4.rate_max': 7.000000,
            'app-domain-com.app4.check_code': 200.000000,
            'app-domain-com.app4.check_duration': 0.000000,
            'app-domain-com.app4.hrsp_1xx': 0.000000,
            'app-domain-com.app4.hrsp_2xx': 279199.000000,
            'app-domain-com.app4.hrsp_3xx': 6076.000000,
            'app-domain-com.app4.hrsp_4xx': 176338.000000,
            'app-domain-com.app4.hrsp_5xx': 2.000000,
            'app-domain-com.app4.hrsp_other': 0.000000,
            'app-domain-com.app4.hanafail': 0.000000,
            'app-domain-com.app4.cli_abrt': 28.000000,
            'app-domain-com.app4.srv_abrt': 0.000000,
            'app-domain-com.app5.qcur': 0.000000,
            'app-domain-com.app5.qmax': 0.000000,
            'app-domain-com.app5.scur': 0.000000,
            'app-domain-com.app5.smax': 6.000000,
            'app-domain-com.app5.slim': 10.000000,
            'app-domain-com.app5.stot': 461687.000000,
            'app-domain-com.app5.bin': 254792036.000000,
            'app-domain-com.app5.bout': 1358313883.000000,
            'app-domain-com.app5.dresp': 0.000000,
            'app-domain-com.app5.econ': 0.000000,
            'app-domain-com.app5.eresp': 8.000000,
            'app-domain-com.app5.wretr': 154.000000,
            'app-domain-com.app5.wredis': 75.000000,
            'app-domain-com.app5.weight': 1.000000,
            'app-domain-com.app5.act': 1.000000,
            'app-domain-com.app5.bck': 0.000000,
            'app-domain-com.app5.chkfail': 1107.000000,
            'app-domain-com.app5.chkdown': 29.000000,
            'app-domain-com.app5.lastchg': 19120.000000,
            'app-domain-com.app5.downtime': 490.000000,
            'app-domain-com.app5.pid': 1.000000,
            'app-domain-com.app5.iid': 2.000000,
            'app-domain-com.app5.sid': 5.000000,
            'app-domain-com.app5.lbtot': 461533.000000,
            'app-domain-com.app5.type': 2.000000,
            'app-domain-com.app5.rate': 0.000000,
            'app-domain-com.app5.rate_max': 7.000000,
            'app-domain-com.app5.check_code': 200.000000,
            'app-domain-com.app5.check_duration': 0.000000,
            'app-domain-com.app5.hrsp_1xx': 0.000000,
            'app-domain-com.app5.hrsp_2xx': 278801.000000,
            'app-domain-com.app5.hrsp_3xx': 6040.000000,
            'app-domain-com.app5.hrsp_4xx': 176596.000000,
            'app-domain-com.app5.hrsp_5xx': 13.000000,
            'app-domain-com.app5.hrsp_other': 0.000000,
            'app-domain-com.app5.hanafail': 0.000000,
            'app-domain-com.app5.cli_abrt': 29.000000,
            'app-domain-com.app5.srv_abrt': 0.000000,
            'app-domain-com.app6.qcur': 0.000000,
            'app-domain-com.app6.qmax': 0.000000,
            'app-domain-com.app6.scur': 0.000000,
            'app-domain-com.app6.smax': 6.000000,
            'app-domain-com.app6.slim': 10.000000,
            'app-domain-com.app6.stot': 461870.000000,
            'app-domain-com.app6.bin': 254918298.000000,
            'app-domain-com.app6.bout': 1342115240.000000,
            'app-domain-com.app6.dresp': 0.000000,
            'app-domain-com.app6.econ': 0.000000,
            'app-domain-com.app6.eresp': 7.000000,
            'app-domain-com.app6.wretr': 149.000000,
            'app-domain-com.app6.wredis': 71.000000,
            'app-domain-com.app6.weight': 1.000000,
            'app-domain-com.app6.act': 1.000000,
            'app-domain-com.app6.bck': 0.000000,
            'app-domain-com.app6.chkfail': 1061.000000,
            'app-domain-com.app6.chkdown': 29.000000,
            'app-domain-com.app6.lastchg': 19106.000000,
            'app-domain-com.app6.downtime': 510.000000,
            'app-domain-com.app6.pid': 1.000000,
            'app-domain-com.app6.iid': 2.000000,
            'app-domain-com.app6.sid': 6.000000,
            'app-domain-com.app6.lbtot': 461721.000000,
            'app-domain-com.app6.type': 2.000000,
            'app-domain-com.app6.rate': 0.000000,
            'app-domain-com.app6.rate_max': 6.000000,
            'app-domain-com.app6.check_code': 200.000000,
            'app-domain-com.app6.check_duration': 0.000000,
            'app-domain-com.app6.hrsp_1xx': 0.000000,
            'app-domain-com.app6.hrsp_2xx': 279091.000000,
            'app-domain-com.app6.hrsp_3xx': 6094.000000,
            'app-domain-com.app6.hrsp_4xx': 176453.000000,
            'app-domain-com.app6.hrsp_5xx': 6.000000,
            'app-domain-com.app6.hrsp_other': 0.000000,
            'app-domain-com.app6.hanafail': 0.000000,
            'app-domain-com.app6.cli_abrt': 33.000000,
            'app-domain-com.app6.srv_abrt': 0.000000,
            'app-domain-com.app7.qcur': 0.000000,
            'app-domain-com.app7.qmax': 0.000000,
            'app-domain-com.app7.scur': 0.000000,
            'app-domain-com.app7.smax': 6.000000,
            'app-domain-com.app7.slim': 10.000000,
            'app-domain-com.app7.stot': 462057.000000,
            'app-domain-com.app7.bin': 255159195.000000,
            'app-domain-com.app7.bout': 1382969429.000000,
            'app-domain-com.app7.dresp': 0.000000,
            'app-domain-com.app7.econ': 0.000000,
            'app-domain-com.app7.eresp': 9.000000,
            'app-domain-com.app7.wretr': 154.000000,
            'app-domain-com.app7.wredis': 73.000000,
            'app-domain-com.app7.weight': 1.000000,
            'app-domain-com.app7.act': 1.000000,
            'app-domain-com.app7.bck': 0.000000,
            'app-domain-com.app7.chkfail': 1136.000000,
            'app-domain-com.app7.chkdown': 33.000000,
            'app-domain-com.app7.lastchg': 19090.000000,
            'app-domain-com.app7.downtime': 467.000000,
            'app-domain-com.app7.pid': 1.000000,
            'app-domain-com.app7.iid': 2.000000,
            'app-domain-com.app7.sid': 7.000000,
            'app-domain-com.app7.lbtot': 461903.000000,
            'app-domain-com.app7.type': 2.000000,
            'app-domain-com.app7.rate': 0.000000,
            'app-domain-com.app7.rate_max': 7.000000,
            'app-domain-com.app7.check_code': 200.000000,
            'app-domain-com.app7.check_duration': 0.000000,
            'app-domain-com.app7.hrsp_1xx': 0.000000,
            'app-domain-com.app7.hrsp_2xx': 278790.000000,
            'app-domain-com.app7.hrsp_3xx': 6223.000000,
            'app-domain-com.app7.hrsp_4xx': 176803.000000,
            'app-domain-com.app7.hrsp_5xx': 5.000000,
            'app-domain-com.app7.hrsp_other': 0.000000,
            'app-domain-com.app7.hanafail': 0.000000,
            'app-domain-com.app7.cli_abrt': 33.000000,
            'app-domain-com.app7.srv_abrt': 0.000000,
            'app-domain-com.app8.qcur': 0.000000,
            'app-domain-com.app8.qmax': 0.000000,
            'app-domain-com.app8.scur': 1.000000,
            'app-domain-com.app8.smax': 6.000000,
            'app-domain-com.app8.slim': 10.000000,
            'app-domain-com.app8.stot': 462034.000000,
            'app-domain-com.app8.bin': 255318449.000000,
            'app-domain-com.app8.bout': 1364393176.000000,
            'app-domain-com.app8.dresp': 0.000000,
            'app-domain-com.app8.econ': 0.000000,
            'app-domain-com.app8.eresp': 11.000000,
            'app-domain-com.app8.wretr': 129.000000,
            'app-domain-com.app8.wredis': 60.000000,
            'app-domain-com.app8.weight': 1.000000,
            'app-domain-com.app8.act': 1.000000,
            'app-domain-com.app8.bck': 0.000000,
            'app-domain-com.app8.chkfail': 1099.000000,
            'app-domain-com.app8.chkdown': 23.000000,
            'app-domain-com.app8.lastchg': 19077.000000,
            'app-domain-com.app8.downtime': 356.000000,
            'app-domain-com.app8.pid': 1.000000,
            'app-domain-com.app8.iid': 2.000000,
            'app-domain-com.app8.sid': 8.000000,
            'app-domain-com.app8.lbtot': 461905.000000,
            'app-domain-com.app8.type': 2.000000,
            'app-domain-com.app8.rate': 1.000000,
            'app-domain-com.app8.rate_max': 7.000000,
            'app-domain-com.app8.check_code': 200.000000,
            'app-domain-com.app8.check_duration': 0.000000,
            'app-domain-com.app8.hrsp_1xx': 0.000000,
            'app-domain-com.app8.hrsp_2xx': 279365.000000,
            'app-domain-com.app8.hrsp_3xx': 6081.000000,
            'app-domain-com.app8.hrsp_4xx': 176380.000000,
            'app-domain-com.app8.hrsp_5xx': 7.000000,
            'app-domain-com.app8.hrsp_other': 0.000000,
            'app-domain-com.app8.hanafail': 0.000000,
            'app-domain-com.app8.cli_abrt': 40.000000,
            'app-domain-com.app8.srv_abrt': 0.000000,
            'app-domain-com.backend.qcur': 0.000000,
            'app-domain-com.backend.qmax': 0.000000,
            'app-domain-com.backend.scur': 1.000000,
            'app-domain-com.backend.smax': 46.000000,
            'app-domain-com.backend.slim': 10000.000000,
            'app-domain-com.backend.stot': 3693012.000000,
            'app-domain-com.backend.bin': 2039943478.000000,
            'app-domain-com.backend.bout': 10930406397.000000,
            'app-domain-com.backend.dreq': 0.000000,
            'app-domain-com.backend.dresp': 0.000000,
            'app-domain-com.backend.econ': 0.000000,
            'app-domain-com.backend.eresp': 66.000000,
            'app-domain-com.backend.wretr': 1190.000000,
            'app-domain-com.backend.wredis': 569.000000,
            'app-domain-com.backend.weight': 8.000000,
            'app-domain-com.backend.act': 8.000000,
            'app-domain-com.backend.bck': 0.000000,
            'app-domain-com.backend.chkdown': 0.000000,
            'app-domain-com.backend.lastchg': 1422928.000000,
            'app-domain-com.backend.downtime': 0.000000,
            'app-domain-com.backend.pid': 1.000000,
            'app-domain-com.backend.iid': 2.000000,
            'app-domain-com.backend.sid': 0.000000,
            'app-domain-com.backend.lbtot': 3693581.000000,
            'app-domain-com.backend.type': 1.000000,
            'app-domain-com.backend.rate': 2.000000,
            'app-domain-com.backend.rate_max': 42.000000,
            'app-domain-com.backend.hrsp_1xx': 0.000000,
            'app-domain-com.backend.hrsp_2xx': 2233273.000000,
            'app-domain-com.backend.hrsp_3xx': 48964.000000,
            'app-domain-com.backend.hrsp_4xx': 1410658.000000,
            'app-domain-com.backend.hrsp_5xx': 116.000000,
            'app-domain-com.backend.hrsp_other': 0.000000,
            'app-domain-com.backend.cli_abrt': 246.000000,
            'app-domain-com.backend.srv_abrt': 0.000000,
            'trans-service.frontend.scur': 0.000000,
            'trans-service.frontend.smax': 0.000000,
            'trans-service.frontend.slim': 10000.000000,
            'trans-service.frontend.stot': 0.000000,
            'trans-service.frontend.bin': 0.000000,
            'trans-service.frontend.bout': 0.000000,
            'trans-service.frontend.dreq': 0.000000,
            'trans-service.frontend.dresp': 0.000000,
            'trans-service.frontend.ereq': 0.000000,
            'trans-service.frontend.pid': 1.000000,
            'trans-service.frontend.iid': 3.000000,
            'trans-service.frontend.sid': 0.000000,
            'trans-service.frontend.type': 0.000000,
            'trans-service.frontend.rate': 0.000000,
            'trans-service.frontend.rate_lim': 0.000000,
            'trans-service.frontend.rate_max': 0.000000,
            'trans-service.frontend.hrsp_1xx': 0.000000,
            'trans-service.frontend.hrsp_2xx': 0.000000,
            'trans-service.frontend.hrsp_3xx': 0.000000,
            'trans-service.frontend.hrsp_4xx': 0.000000,
            'trans-service.frontend.hrsp_5xx': 0.000000,
            'trans-service.frontend.hrsp_other': 0.000000,
            'trans-service.frontend.req_rate': 0.000000,
            'trans-service.frontend.req_rate_max': 0.000000,
            'trans-service.frontend.req_tot': 0.000000,
            'trans-service.trans1.qcur': 0.000000,
            'trans-service.trans1.qmax': 0.000000,
            'trans-service.trans1.scur': 0.000000,
            'trans-service.trans1.smax': 0.000000,
            'trans-service.trans1.stot': 0.000000,
            'trans-service.trans1.bin': 0.000000,
            'trans-service.trans1.bout': 0.000000,
            'trans-service.trans1.dresp': 0.000000,
            'trans-service.trans1.econ': 0.000000,
            'trans-service.trans1.eresp': 0.000000,
            'trans-service.trans1.wretr': 0.000000,
            'trans-service.trans1.wredis': 0.000000,
            'trans-service.trans1.weight': 1.000000,
            'trans-service.trans1.act': 1.000000,
            'trans-service.trans1.bck': 0.000000,
            'trans-service.trans1.chkfail': 31.000000,
            'trans-service.trans1.chkdown': 3.000000,
            'trans-service.trans1.lastchg': 222121.000000,
            'trans-service.trans1.downtime': 116.000000,
            'trans-service.trans1.pid': 1.000000,
            'trans-service.trans1.iid': 3.000000,
            'trans-service.trans1.sid': 1.000000,
            'trans-service.trans1.lbtot': 0.000000,
            'trans-service.trans1.type': 2.000000,
            'trans-service.trans1.rate': 0.000000,
            'trans-service.trans1.rate_max': 0.000000,
            'trans-service.trans1.check_code': 200.000000,
            'trans-service.trans1.check_duration': 10.000000,
            'trans-service.trans1.hrsp_1xx': 0.000000,
            'trans-service.trans1.hrsp_2xx': 0.000000,
            'trans-service.trans1.hrsp_3xx': 0.000000,
            'trans-service.trans1.hrsp_4xx': 0.000000,
            'trans-service.trans1.hrsp_5xx': 0.000000,
            'trans-service.trans1.hrsp_other': 0.000000,
            'trans-service.trans1.hanafail': 0.000000,
            'trans-service.trans1.cli_abrt': 0.000000,
            'trans-service.trans1.srv_abrt': 0.000000,
            'trans-service.trans2.qcur': 0.000000,
            'trans-service.trans2.qmax': 0.000000,
            'trans-service.trans2.scur': 0.000000,
            'trans-service.trans2.smax': 0.000000,
            'trans-service.trans2.stot': 0.000000,
            'trans-service.trans2.bin': 0.000000,
            'trans-service.trans2.bout': 0.000000,
            'trans-service.trans2.dresp': 0.000000,
            'trans-service.trans2.econ': 0.000000,
            'trans-service.trans2.eresp': 0.000000,
            'trans-service.trans2.wretr': 0.000000,
            'trans-service.trans2.wredis': 0.000000,
            'trans-service.trans2.weight': 1.000000,
            'trans-service.trans2.act': 1.000000,
            'trans-service.trans2.bck': 0.000000,
            'trans-service.trans2.chkfail': 28.000000,
            'trans-service.trans2.chkdown': 3.000000,
            'trans-service.trans2.lastchg': 222121.000000,
            'trans-service.trans2.downtime': 116.000000,
            'trans-service.trans2.pid': 1.000000,
            'trans-service.trans2.iid': 3.000000,
            'trans-service.trans2.sid': 2.000000,
            'trans-service.trans2.lbtot': 0.000000,
            'trans-service.trans2.type': 2.000000,
            'trans-service.trans2.rate': 0.000000,
            'trans-service.trans2.rate_max': 0.000000,
            'trans-service.trans2.check_code': 200.000000,
            'trans-service.trans2.check_duration': 12.000000,
            'trans-service.trans2.hrsp_1xx': 0.000000,
            'trans-service.trans2.hrsp_2xx': 0.000000,
            'trans-service.trans2.hrsp_3xx': 0.000000,
            'trans-service.trans2.hrsp_4xx': 0.000000,
            'trans-service.trans2.hrsp_5xx': 0.000000,
            'trans-service.trans2.hrsp_other': 0.000000,
            'trans-service.trans2.hanafail': 0.000000,
            'trans-service.trans2.cli_abrt': 0.000000,
            'trans-service.trans2.srv_abrt': 0.000000,
            'trans-service.backend.qcur': 0.000000,
            'trans-service.backend.qmax': 0.000000,
            'trans-service.backend.scur': 0.000000,
            'trans-service.backend.smax': 0.000000,
            'trans-service.backend.slim': 10000.000000,
            'trans-service.backend.stot': 0.000000,
            'trans-service.backend.bin': 0.000000,
            'trans-service.backend.bout': 0.000000,
            'trans-service.backend.dreq': 0.000000,
            'trans-service.backend.dresp': 0.000000,
            'trans-service.backend.econ': 0.000000,
            'trans-service.backend.eresp': 0.000000,
            'trans-service.backend.wretr': 0.000000,
            'trans-service.backend.wredis': 0.000000,
            'trans-service.backend.weight': 2.000000,
            'trans-service.backend.act': 2.000000,
            'trans-service.backend.bck': 0.000000,
            'trans-service.backend.chkdown': 3.000000,
            'trans-service.backend.lastchg': 222121.000000,
            'trans-service.backend.downtime': 116.000000,
            'trans-service.backend.pid': 1.000000,
            'trans-service.backend.iid': 3.000000,
            'trans-service.backend.sid': 0.000000,
            'trans-service.backend.lbtot': 0.000000,
            'trans-service.backend.type': 1.000000,
            'trans-service.backend.rate': 0.000000,
            'trans-service.backend.rate_max': 0.000000,
            'trans-service.backend.hrsp_1xx': 0.000000,
            'trans-service.backend.hrsp_2xx': 0.000000,
            'trans-service.backend.hrsp_3xx': 0.000000,
            'trans-service.backend.hrsp_4xx': 0.000000,
            'trans-service.backend.hrsp_5xx': 0.000000,
            'trans-service.backend.hrsp_other': 0.000000,
            'trans-service.backend.cli_abrt': 0.000000,
            'trans-service.backend.srv_abrt': 0.000000,
        }

        self.setDocExample(self.collector.__class__.__name__, metrics)
        self.assertPublishedMany(publish_mock, metrics)

    @patch.object(Collector, 'publish')
    def test_should_work_with_real_data_and_ignore_servers(self, publish_mock):
        self.collector.config['ignore_servers'] = True

        with patch('urllib2.urlopen', Mock(
                return_value=self.getFixture('stats.csv'))):
            self.collector.collect()

        self.assertPublishedMany(publish_mock, {
            'admin.frontend.scur': 1.000000,
            'admin.frontend.smax': 2.000000,
            'admin.frontend.slim': 10000.000000,
            'admin.frontend.stot': 5302.000000,
            'admin.frontend.bin': 745023.000000,
            'admin.frontend.bout': 25323272.000000,
            'admin.frontend.dreq': 0.000000,
            'admin.frontend.dresp': 0.000000,
            'admin.frontend.ereq': 4.000000,
            'admin.frontend.pid': 1.000000,
            'admin.frontend.iid': 1.000000,
            'admin.frontend.sid': 0.000000,
            'admin.frontend.type': 0.000000,
            'admin.frontend.rate': 1.000000,
            'admin.frontend.rate_lim': 0.000000,
            'admin.frontend.rate_max': 3.000000,
            'admin.frontend.hrsp_1xx': 0.000000,
            'admin.frontend.hrsp_2xx': 5297.000000,
            'admin.frontend.hrsp_3xx': 0.000000,
            'admin.frontend.hrsp_4xx': 4.000000,
            'admin.frontend.hrsp_5xx': 0.000000,
            'admin.frontend.hrsp_other': 0.000000,
            'admin.frontend.req_rate': 1.000000,
            'admin.frontend.req_rate_max': 2.000000,
            'admin.frontend.req_tot': 5302.000000,
            'admin.backend.qcur': 0.000000,
            'admin.backend.qmax': 0.000000,
            'admin.backend.scur': 0.000000,
            'admin.backend.smax': 0.000000,
            'admin.backend.slim': 10000.000000,
            'admin.backend.stot': 0.000000,
            'admin.backend.bin': 745023.000000,
            'admin.backend.bout': 25323272.000000,
            'admin.backend.dreq': 0.000000,
            'admin.backend.dresp': 0.000000,
            'admin.backend.econ': 0.000000,
            'admin.backend.eresp': 0.000000,
            'admin.backend.wretr': 0.000000,
            'admin.backend.wredis': 0.000000,
            'admin.backend.weight': 0.000000,
            'admin.backend.act': 0.000000,
            'admin.backend.bck': 0.000000,
            'admin.backend.chkdown': 0.000000,
            'admin.backend.lastchg': 1422928.000000,
            'admin.backend.downtime': 0.000000,
            'admin.backend.pid': 1.000000,
            'admin.backend.iid': 1.000000,
            'admin.backend.sid': 0.000000,
            'admin.backend.lbtot': 0.000000,
            'admin.backend.type': 1.000000,
            'admin.backend.rate': 0.000000,
            'admin.backend.rate_max': 0.000000,
            'admin.backend.hrsp_1xx': 0.000000,
            'admin.backend.hrsp_2xx': 0.000000,
            'admin.backend.hrsp_3xx': 0.000000,
            'admin.backend.hrsp_4xx': 0.000000,
            'admin.backend.hrsp_5xx': 0.000000,
            'admin.backend.hrsp_other': 0.000000,
            'admin.backend.cli_abrt': 0.000000,
            'admin.backend.srv_abrt': 0.000000,
            'app-domain-com.frontend.scur': 1.000000,
            'app-domain-com.frontend.smax': 46.000000,
            'app-domain-com.frontend.slim': 10000.000000,
            'app-domain-com.frontend.stot': 3693012.000000,
            'app-domain-com.frontend.bin': 2039943478.000000,
            'app-domain-com.frontend.bout': 10930406397.000000,
            'app-domain-com.frontend.dreq': 0.000000,
            'app-domain-com.frontend.dresp': 0.000000,
            'app-domain-com.frontend.ereq': 0.000000,
            'app-domain-com.frontend.pid': 1.000000,
            'app-domain-com.frontend.iid': 2.000000,
            'app-domain-com.frontend.sid': 0.000000,
            'app-domain-com.frontend.type': 0.000000,
            'app-domain-com.frontend.rate': 2.000000,
            'app-domain-com.frontend.rate_lim': 0.000000,
            'app-domain-com.frontend.rate_max': 42.000000,
            'app-domain-com.frontend.hrsp_1xx': 0.000000,
            'app-domain-com.frontend.hrsp_2xx': 2233273.000000,
            'app-domain-com.frontend.hrsp_3xx': 48964.000000,
            'app-domain-com.frontend.hrsp_4xx': 1410658.000000,
            'app-domain-com.frontend.hrsp_5xx': 116.000000,
            'app-domain-com.frontend.hrsp_other': 0.000000,
            'app-domain-com.frontend.req_rate': 2.000000,
            'app-domain-com.frontend.req_rate_max': 42.000000,
            'app-domain-com.frontend.req_tot': 3693012.000000,
            'app-domain-com.backend.qcur': 0.000000,
            'app-domain-com.backend.qmax': 0.000000,
            'app-domain-com.backend.scur': 1.000000,
            'app-domain-com.backend.smax': 46.000000,
            'app-domain-com.backend.slim': 10000.000000,
            'app-domain-com.backend.stot': 3693012.000000,
            'app-domain-com.backend.bin': 2039943478.000000,
            'app-domain-com.backend.bout': 10930406397.000000,
            'app-domain-com.backend.dreq': 0.000000,
            'app-domain-com.backend.dresp': 0.000000,
            'app-domain-com.backend.econ': 0.000000,
            'app-domain-com.backend.eresp': 66.000000,
            'app-domain-com.backend.wretr': 1190.000000,
            'app-domain-com.backend.wredis': 569.000000,
            'app-domain-com.backend.weight': 8.000000,
            'app-domain-com.backend.act': 8.000000,
            'app-domain-com.backend.bck': 0.000000,
            'app-domain-com.backend.chkdown': 0.000000,
            'app-domain-com.backend.lastchg': 1422928.000000,
            'app-domain-com.backend.downtime': 0.000000,
            'app-domain-com.backend.pid': 1.000000,
            'app-domain-com.backend.iid': 2.000000,
            'app-domain-com.backend.sid': 0.000000,
            'app-domain-com.backend.lbtot': 3693581.000000,
            'app-domain-com.backend.type': 1.000000,
            'app-domain-com.backend.rate': 2.000000,
            'app-domain-com.backend.rate_max': 42.000000,
            'app-domain-com.backend.hrsp_1xx': 0.000000,
            'app-domain-com.backend.hrsp_2xx': 2233273.000000,
            'app-domain-com.backend.hrsp_3xx': 48964.000000,
            'app-domain-com.backend.hrsp_4xx': 1410658.000000,
            'app-domain-com.backend.hrsp_5xx': 116.000000,
            'app-domain-com.backend.hrsp_other': 0.000000,
            'app-domain-com.backend.cli_abrt': 246.000000,
            'app-domain-com.backend.srv_abrt': 0.000000,
            'trans-service.frontend.scur': 0.000000,
            'trans-service.frontend.smax': 0.000000,
            'trans-service.frontend.slim': 10000.000000,
            'trans-service.frontend.stot': 0.000000,
            'trans-service.frontend.bin': 0.000000,
            'trans-service.frontend.bout': 0.000000,
            'trans-service.frontend.dreq': 0.000000,
            'trans-service.frontend.dresp': 0.000000,
            'trans-service.frontend.ereq': 0.000000,
            'trans-service.frontend.pid': 1.000000,
            'trans-service.frontend.iid': 3.000000,
            'trans-service.frontend.sid': 0.000000,
            'trans-service.frontend.type': 0.000000,
            'trans-service.frontend.rate': 0.000000,
            'trans-service.frontend.rate_lim': 0.000000,
            'trans-service.frontend.rate_max': 0.000000,
            'trans-service.frontend.hrsp_1xx': 0.000000,
            'trans-service.frontend.hrsp_2xx': 0.000000,
            'trans-service.frontend.hrsp_3xx': 0.000000,
            'trans-service.frontend.hrsp_4xx': 0.000000,
            'trans-service.frontend.hrsp_5xx': 0.000000,
            'trans-service.frontend.hrsp_other': 0.000000,
            'trans-service.frontend.req_rate': 0.000000,
            'trans-service.frontend.req_rate_max': 0.000000,
            'trans-service.frontend.req_tot': 0.000000,
            'trans-service.backend.qcur': 0.000000,
            'trans-service.backend.qmax': 0.000000,
            'trans-service.backend.scur': 0.000000,
            'trans-service.backend.smax': 0.000000,
            'trans-service.backend.slim': 10000.000000,
            'trans-service.backend.stot': 0.000000,
            'trans-service.backend.bin': 0.000000,
            'trans-service.backend.bout': 0.000000,
            'trans-service.backend.dreq': 0.000000,
            'trans-service.backend.dresp': 0.000000,
            'trans-service.backend.econ': 0.000000,
            'trans-service.backend.eresp': 0.000000,
            'trans-service.backend.wretr': 0.000000,
            'trans-service.backend.wredis': 0.000000,
            'trans-service.backend.weight': 2.000000,
            'trans-service.backend.act': 2.000000,
            'trans-service.backend.bck': 0.000000,
            'trans-service.backend.chkdown': 3.000000,
            'trans-service.backend.lastchg': 222121.000000,
            'trans-service.backend.downtime': 116.000000,
            'trans-service.backend.pid': 1.000000,
            'trans-service.backend.iid': 3.000000,
            'trans-service.backend.sid': 0.000000,
            'trans-service.backend.lbtot': 0.000000,
            'trans-service.backend.type': 1.000000,
            'trans-service.backend.rate': 0.000000,
            'trans-service.backend.rate_max': 0.000000,
            'trans-service.backend.hrsp_1xx': 0.000000,
            'trans-service.backend.hrsp_2xx': 0.000000,
            'trans-service.backend.hrsp_3xx': 0.000000,
            'trans-service.backend.hrsp_4xx': 0.000000,
            'trans-service.backend.hrsp_5xx': 0.000000,
            'trans-service.backend.hrsp_other': 0.000000,
            'trans-service.backend.cli_abrt': 0.000000,
            'trans-service.backend.srv_abrt': 0.000000,
        })

################################################################################
if __name__ == "__main__":
    unittest.main()
#!/usr/bin/python # coding=utf-8 ################################################################################ ################################################################################ ################################################################################