From 0a2ccff0644b8b949d90f47acfc44bcd252b3976 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Sun, 23 Dec 2012 23:32:13 +0800 Subject: [PATCH] examples: python: inline sample_send --- examples/python_example.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/examples/python_example.py b/examples/python_example.py index 98a95b0..6dffa5b 100644 --- a/examples/python_example.py +++ b/examples/python_example.py @@ -58,20 +58,10 @@ class StatsdClient(object): data = {} for stat in stats: data[stat] = "{0}|c".format(delta) - self.sample_send(data, sample_rate) - - def sample_send(self, data, sample_rate=1): - """ - Sample and squirt the metrics over UDP - - >>> client = StatsdClient() - >>> client.sample_send({"example.sample_send": "13|c"}, 1) - True - """ - return self.send(self.sample(data, sample_rate), self.addr) + self.send(self.sample(data, sample_rate), self.addr) @staticmethod - def sample(data, sample_rate=1): + def sample(data, sample_rate): """ Sample data dict TODO(rbtz@): Convert to generator