~ubuntu-branches/ubuntu/trusty/ceilometer/trusty-proposed

« back to all changes in this revision

Viewing changes to ceilometer/publisher/udp.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, James Page, Chuck Short
  • Date: 2014-01-23 15:08:11 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20140123150811-1zaismsuyh1hcl8y
Tags: 2014.1~b2-0ubuntu1
[ James Page ]
* d/control: Add python-jsonpath-rw to BD's.
* d/p/fix-setup-requirements.patch: Bump WebOb to support < 1.4.
 (LP: #1261101)

[ Chuck Short ]
* New upstream version.
* debian/control, debian/ceilometer-common.install: Split out
  ceilometer-alarm-evaluator and ceilometer-alarm-notifier into their
  own packages. (LP: #1250002)
* debian/ceilometer-agent-central.logrotate,
  debian/ceilometer-agent-compute.logrotate,
  debian/ceilometer-api.logrotate,
  debian/ceilometer-collector.logrotate: Add logrotate files, 
  thanks to Ahmed Rahal. (LP: #1224223)
* Fix typos in upstart files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#
3
3
# Copyright © 2013 eNovance
4
4
#
5
 
# Author: Julien Danjou <julien@danjou.info>
 
5
# Author: Julien Danjou <julien@danjou.info>,
 
6
#         Tyaptin Ilya <ityaptin@mirantis.com>
6
7
#
7
8
# Licensed under the Apache License, Version 2.0 (the "License"); you may
8
9
# not use this file except in compliance with the License. You may obtain
27
28
from ceilometer.openstack.common import log
28
29
from ceilometer.openstack.common import network_utils
29
30
from ceilometer import publisher
 
31
from ceilometer.publisher import utils
30
32
 
31
33
cfg.CONF.import_opt('udp_port', 'ceilometer.collector',
32
34
                    group='collector')
35
37
 
36
38
 
37
39
class UDPPublisher(publisher.PublisherBase):
38
 
 
39
40
    def __init__(self, parsed_url):
40
41
        self.host, self.port = network_utils.parse_host_port(
41
42
            parsed_url.netloc,
51
52
        """
52
53
 
53
54
        for sample in samples:
54
 
            msg = sample.as_dict()
 
55
            msg = utils.meter_message_from_counter(
 
56
                sample,
 
57
                cfg.CONF.publisher.metering_secret)
55
58
            host = self.host
56
59
            port = self.port
57
60
            LOG.debug(_("Publishing sample %(msg)s over UDP to "