summaryrefslogtreecommitdiff
path: root/devstack/lib/osprofiler
blob: dbbebd4719737d50a3c51767481be4ea9f70b7cf (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# lib/osprofiler
# Functions to control the configuration and operation of the **osprofiler**

# Dependencies:
#
# - ``functions`` file
# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined

# ``stack.sh`` calls the entry points in this order:
#
# - install_osprofiler
# - configure_osprofiler
# - init_osprofiler

# Save trace setting
XTRACE=$(set +o | grep xtrace)
set +o xtrace


# Defaults
# --------

CONF_FILES=(
    $CINDER_CONF
    $HEAT_CONF
    $KEYSTONE_CONF
    $NOVA_CONF
    $NEUTRON_CONF
    $GLANCE_API_CONF
    $GLANCE_REGISTRY_CONF
    $TROVE_CONF
    $TROVE_CONDUCTOR_CONF
    $TROVE_GUESTAGENT_CONF
    $TROVE_TASKMANAGER_CONF
    $SENLIN_CONF
    $MAGNUM_CONF
    $ZUN_CONF
)

# This will update CEILOMETER_NOTIFICATION_TOPICS in ceilometer.conf file
export CEILOMETER_NOTIFICATION_TOPICS=notifications,profiler


# Functions
# ---------

# configure_osprofiler() - Nothing for now
function configure_osprofiler() {

    for conf in ${CONF_FILES[@]}; do
        if [ -f $conf ]
        then
            iniset $conf profiler enabled True
            iniset $conf profiler trace_sqlalchemy True
            iniset $conf profiler hmac_keys $OSPROFILER_HMAC_KEYS
            iniset $conf profiler connection_string $OSPROFILER_CONNECTION_STRING
        fi
    done
    if [ -f $CEILOMETER_CONF ]
    then
        iniset $CEILOMETER_CONF event store_raw info
    fi
}


# Restore xtrace
$XTRACE

# Tell emacs to use shell-script-mode
## Local variables:
## mode: shell-script
## End: