summaryrefslogtreecommitdiff
path: root/ceilometer/utils.py
diff options
context:
space:
mode:
authorNejc Saje <nsaje@redhat.com>2014-09-15 08:26:59 -0400
committerNejc Saje <nejc@saje.info>2014-09-29 06:16:34 +0000
commitfa3f4d6c5dd724a1fb2b811cd798fb80d075192e (patch)
treed8b0478724db6d786aaff2f009cc80099e55541b /ceilometer/utils.py
parentd8317189e554c8378eefc615b73726f4b89791cb (diff)
downloadceilometer-fa3f4d6c5dd724a1fb2b811cd798fb80d075192e.tar.gz
Partition static resources defined in pipeline.yaml
Resources statically defined in pipeline.yaml are currently not subject to workload partitioning, so we can't do HA. If we have multiple agents running with the same pipeline.yaml, the samples will be duplicated. This patch partitions the static resources as well. Closes-bug: #1369538 Change-Id: Iff3b33db58302fb2e89b1b3722937a031a70be5f
Diffstat (limited to 'ceilometer/utils.py')
-rw-r--r--ceilometer/utils.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ceilometer/utils.py b/ceilometer/utils.py
index c703521b..016fb8a3 100644
--- a/ceilometer/utils.py
+++ b/ceilometer/utils.py
@@ -206,6 +206,10 @@ def uniq(dupes, attrs):
return deduped
+def hash_of_set(s):
+ return str(hash(frozenset(s)))
+
+
class HashRing(object):
def __init__(self, nodes, replicas=100):