Puppet Class: swift::stats::dispersion

Defined in:
modules/swift/manifests/stats/dispersion.pp

Overview

Parameters:

  • swift_cluster (String)
  • ensure (Wmflib::Ensure) (defaults to: present)
  • storage_policies (Boolean) (defaults to: true)
  • statsd_host (Any) (defaults to: 'statsd.eqiad.wmnet')
  • statsd_port (Any) (defaults to: 8125)
  • statsd_prefix (Any) (defaults to: "swift.${swift_cluster}.dispersion")


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
# File 'modules/swift/manifests/stats/dispersion.pp', line 1

class swift::stats::dispersion(
    String $swift_cluster,
    Wmflib::Ensure $ensure = present,
    Boolean $storage_policies = true,
    $statsd_host   = 'statsd.eqiad.wmnet',
    $statsd_port   = 8125,
    $statsd_prefix = "swift.${swift_cluster}.dispersion",
) {
    $required_packages = [
        Package['python-swiftclient'],
        Package['python-statsd'],
        Package['swift'],
    ]

    file { '/usr/local/bin/swift-dispersion-stats':
        ensure  => $ensure,
        owner   => 'root',
        group   => 'root',
        mode    => '0555',
        source  => 'puppet:///modules/swift/swift-dispersion-stats.py',
        require => $required_packages,
    }

    # XXX swift-dispersion-populate is not ran/initialized
    cron { 'swift-dispersion-stats':
        ensure  => $ensure,
        command => "/usr/local/bin/swift-dispersion-stats --prefix ${statsd_prefix} --statsd-host ${statsd_host} --statsd-port ${statsd_port} >/dev/null 2>&1",
        user    => 'root',
        hour    => '*',
        minute  => '*/15',
        require => File['/usr/local/bin/swift-dispersion-stats'],
    }

    if $storage_policies {
        cron { 'swift-dispersion-stats-lowlatency':
            ensure  => $ensure,
            command => "/usr/local/bin/swift-dispersion-stats --prefix ${statsd_prefix}.lowlatency --statsd-host ${statsd_host} --statsd-port ${statsd_port} --policy-name lowlatency >/dev/null 2>&1",
            user    => 'root',
            hour    => '*',
            minute  => '*/15',
            require => File['/usr/local/bin/swift-dispersion-stats'],
        }
    }
}