GitHub PullRequestReviewCommentEvent at 2014-01-28 16:31:49
Repository: tempodb-python
Actor: mrgaaron
Payload: {"comment":{"url":"https://api.github.com/repos/tempodb/tempodb-python/pulls/comments/9233090","id":9233090,"diff_hunk":"@@ -242,6 +247,103 @@ def read_data(self, key, start=None, end=None, fold=None,\n                                      tz=data['tz'])\n         return c\n \n+    def find_data(self, key, start, end, predicate, period, tz=None,\n+                  limit=1000):\n+        \"\"\"Finds data from a given series according to a defined predicate\n+        function.  Start and end times must be supplied.  They can either be\n+        ISO8601 encoded strings (i.e. 2012-01-08T00:21:54.000+0000) or Python\n+        Datetime objects, which will be converted for you.\n+\n+        The predicate and period must be supplied.  The period specifies\n+        sub-intervals from start to end in which the search will be performed\n+        (i.e. 1min will search over each minute within the interval).  The\n+        predicate can be one of \"max\", \"min\", \"first\", or \"last\" and will\n+        return the point over the given period that satisfies that predicate.\n+\n+        Finally, the optional tz parameter can be used to specify a time zone\n+        for your output.  Please see\n+        `here <https://tempo-db.com/docs/api/timezone/>`_ for a list of a\n+        valid timezone values.\n+\n+        :param string key: the series key to use\n+        :param start: the start time for the data points\n+        :type start: string or Datetime\n+        :param end: the end time for the data points\n+        :type end: string or Datetime\n+        :param string predicate: the name of a search function to use\n+        :param string interval: downsampling rate for the data\n+        :param string tz: (optional) the timezone to place the data into\n+        :rtype: :class:`tempodb.protocol.cursor.DataPointFindCursor` object\"\"\"\n+\n+        url = make_series_url(key)\n+        url = urlparse.urljoin(url + '/', 'find')\n+\n+        vstart = check_time_param(start)\n+        vend = check_time_param(end)\n+        params = {\n+            'start': vstart,\n+            'end': vend,\n+            'predicate.function': predicate,\n+            'predicate.period': period,\n+            'tz': tz,\n+            'limit': limit\n+        }\n+        url_args = endpoint.make_url_args(params)\n+        url = '?'.join([url, url_args])\n+        resp = self.session.get(url)\n+        r = Response(resp, self.session)\n+        data = json.loads(r.resp.text)\n+        c = protocol.DataPointCursor(data['data'], protocol.DataPointFound, r,\n+                                     tz=data['tz'])\n+        return c\n+\n+    def aggregate_data(self, aggregation, keys=[], tags=[], attrs={},","path":"tempodb/client.py","position":101,"original_position":101,"commit_id":"815adc4f4b76ee556bdfc341452a01db17de6937","original_commit_id":"815adc4f4b76ee556bdfc341452a01db17de6937","user":{"login":"mrgaaron","id":279233,"avatar_url":"https://gravatar.com/avatar/bcd84b288cab7e34734e70f5638bd21f?d=https%3A%2F%2Fidenticons.github.com%2Fae93d6520af0c45bade1c641fdce0eea.png&r=x","gravatar_id":"bcd84b288cab7e34734e70f5638bd21f","url":"https://api.github.com/users/mrgaaron","html_url":"https://github.com/mrgaaron","followers_url":"https://api.github.com/users/mrgaaron/followers","following_url":"https://api.github.com/users/mrgaaron/following{/other_user}","gists_url":"https://api.github.com/users/mrgaaron/gists{/gist_id}","starred_url":"https://api.github.com/users/mrgaaron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrgaaron/subscriptions","organizations_url":"https://api.github.com/users/mrgaaron/orgs","repos_url":"https://api.github.com/users/mrgaaron/repos","events_url":"https://api.github.com/users/mrgaaron/events{/privacy}","received_events_url":"https://api.github.com/users/mrgaaron/received_events","type":"User","site_admin":false},"body":"Does that need to be rollup.period and rollup.function as in the other calls, or is it just rollup for this one?","created_at":"2014-01-28T16:31:49Z","updated_at":"2014-01-28T16:31:49Z","html_url":"https://github.com/tempodb/tempodb-python/pull/37#discussion_r9233090","pull_request_url":"https://api.github.com/repos/tempodb/tempodb-python/pulls/37","_links":{"self":{"href":"https://api.github.com/repos/tempodb/tempodb-python/pulls/comments/9233090"},"html":{"href":"https://github.com/tempodb/tempodb-python/pull/37#discussion_r9233090"},"pull_request":{"href":"https://api.github.com/repos/tempodb/tempodb-python/pulls/37"}}}}