)]}'
{"ceilometer/api/controllers/v2.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"61addc2b9cc160b24ac9fc4ba25941ad0923aa13","unresolved":false,"context_lines":[{"line_number":211,"context_line":"    return {}"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"class NewSample(wtypes.Base):"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    meter_name \u003d wtypes.wsattr(wtypes.text, mandatory\u003dTrue)"},{"line_number":217,"context_line":"    \"The name of the meter\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2F%2F7c%3D","line":214,"updated":"2013-04-08 18:59:30.000000000","message":"Why wouldn\u0027t this just be the same Sample we return from queries?","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"933dfe386d912ef322167e0398fd791af580ff5a","unresolved":false,"context_lines":[{"line_number":211,"context_line":"    return {}"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"class NewSample(wtypes.Base):"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    meter_name \u003d wtypes.wsattr(wtypes.text, mandatory\u003dTrue)"},{"line_number":217,"context_line":"    \"The name of the meter\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2FuTg%3D","line":214,"in_reply_to":"AAAAOn%2F%2F%2F7c%3D","updated":"2013-04-26 03:23:37.000000000","message":"Done","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"61addc2b9cc160b24ac9fc4ba25941ad0923aa13","unresolved":false,"context_lines":[{"line_number":213,"context_line":""},{"line_number":214,"context_line":"class NewSample(wtypes.Base):"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    meter_name \u003d wtypes.wsattr(wtypes.text, mandatory\u003dTrue)"},{"line_number":217,"context_line":"    \"The name of the meter\""},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    meter_type \u003d wtypes.wsattr(wtypes.text, mandatory\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2F%2F7Q%3D","line":216,"updated":"2013-04-08 18:59:30.000000000","message":"As much as I agree that \"meter\" is better than \"counter\" I think we should be consistent. :-/","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"933dfe386d912ef322167e0398fd791af580ff5a","unresolved":false,"context_lines":[{"line_number":213,"context_line":""},{"line_number":214,"context_line":"class NewSample(wtypes.Base):"},{"line_number":215,"context_line":""},{"line_number":216,"context_line":"    meter_name \u003d wtypes.wsattr(wtypes.text, mandatory\u003dTrue)"},{"line_number":217,"context_line":"    \"The name of the meter\""},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    meter_type \u003d wtypes.wsattr(wtypes.text, mandatory\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2FuTc%3D","line":216,"in_reply_to":"AAAAOn%2F%2F%2F7Q%3D","updated":"2013-04-26 03:23:37.000000000","message":"Done","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"61addc2b9cc160b24ac9fc4ba25941ad0923aa13","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    resource_metadata \u003d {wtypes.text: wtypes.text}"},{"line_number":238,"context_line":"    \"Arbitrary metadata associated with the resource\""},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def validate(self):"},{"line_number":241,"context_line":"        \u0027\u0027\u0027Seems the mandatory option doesn\u0027t work so do it manually\u0027\u0027\u0027"},{"line_number":242,"context_line":"        if self.meter_name is wtypes.Unset:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2F%2F60%3D","line":239,"updated":"2013-04-08 18:59:30.000000000","message":"We also need source and timestamp (since the time the measurement was taken might be different from the time we get it). The timestamp could default to \"now\" (which we calculate).","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"61addc2b9cc160b24ac9fc4ba25941ad0923aa13","unresolved":false,"context_lines":[{"line_number":238,"context_line":"    \"Arbitrary metadata associated with the resource\""},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def validate(self):"},{"line_number":241,"context_line":"        \u0027\u0027\u0027Seems the mandatory option doesn\u0027t work so do it manually\u0027\u0027\u0027"},{"line_number":242,"context_line":"        if self.meter_name is wtypes.Unset:"},{"line_number":243,"context_line":"            raise wsme.exc.MissingArgument(\u0027meter_name\u0027)"},{"line_number":244,"context_line":"        if self.meter_type is wtypes.Unset:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2F%2F6U%3D","line":241,"updated":"2013-04-08 18:59:30.000000000","message":"Does mandatory mean the constructor needs to have the value as an argument, or does it mean that the object will always have the property?","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"933dfe386d912ef322167e0398fd791af580ff5a","unresolved":false,"context_lines":[{"line_number":238,"context_line":"    \"Arbitrary metadata associated with the resource\""},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def validate(self):"},{"line_number":241,"context_line":"        \u0027\u0027\u0027Seems the mandatory option doesn\u0027t work so do it manually\u0027\u0027\u0027"},{"line_number":242,"context_line":"        if self.meter_name is wtypes.Unset:"},{"line_number":243,"context_line":"            raise wsme.exc.MissingArgument(\u0027meter_name\u0027)"},{"line_number":244,"context_line":"        if self.meter_type is wtypes.Unset:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2FuTY%3D","line":241,"in_reply_to":"AAAAOn%2F%2F%2F6U%3D","updated":"2013-04-26 03:23:37.000000000","message":"Created-with I would think (constructor).","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"61addc2b9cc160b24ac9fc4ba25941ad0923aa13","unresolved":false,"context_lines":[{"line_number":432,"context_line":""},{"line_number":433,"context_line":"    @wsme.validate(NewSample)"},{"line_number":434,"context_line":"    @wsme_pecan.wsexpose(Sample, NewSample, body\u003dNewSample)"},{"line_number":435,"context_line":"    def post(self, sample_not_used, body):"},{"line_number":436,"context_line":"        \u0027\u0027\u0027"},{"line_number":437,"context_line":"        Note:"},{"line_number":438,"context_line":"           1) the above validate decorator seems to do nothing?"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2F%2F50%3D","line":435,"updated":"2013-04-08 18:59:30.000000000","message":"I\u0027m not sure why you need the sample_not_used argument there?\n\nSince the \"body\" argument name will show up in the autodoc output, should it be something like \"sample\" or \"samples\"?","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"933dfe386d912ef322167e0398fd791af580ff5a","unresolved":false,"context_lines":[{"line_number":432,"context_line":""},{"line_number":433,"context_line":"    @wsme.validate(NewSample)"},{"line_number":434,"context_line":"    @wsme_pecan.wsexpose(Sample, NewSample, body\u003dNewSample)"},{"line_number":435,"context_line":"    def post(self, sample_not_used, body):"},{"line_number":436,"context_line":"        \u0027\u0027\u0027"},{"line_number":437,"context_line":"        Note:"},{"line_number":438,"context_line":"           1) the above validate decorator seems to do nothing?"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2Fyxk%3D","line":435,"in_reply_to":"AAAAOn%2F%2F%2F50%3D","updated":"2013-04-26 03:23:37.000000000","message":"I think is was a bug (now fixed in 0.5b2) - now I am only using the body.","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"61addc2b9cc160b24ac9fc4ba25941ad0923aa13","unresolved":false,"context_lines":[{"line_number":436,"context_line":"        \u0027\u0027\u0027"},{"line_number":437,"context_line":"        Note:"},{"line_number":438,"context_line":"           1) the above validate decorator seems to do nothing?"},{"line_number":439,"context_line":"           2) not sure why I need NewSample and body\u003dNewSample but it"},{"line_number":440,"context_line":"              does not work without both - weird/not obvious."},{"line_number":441,"context_line":"           3) the mandatory option seems to also do nothing, I thought"},{"line_number":442,"context_line":"              this was the main point of wsme - validation?"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2F%2F58%3D","line":439,"updated":"2013-04-08 18:59:30.000000000","message":"The body arg tells the decorator what to do with the body of the posted message, if there is one.","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"61addc2b9cc160b24ac9fc4ba25941ad0923aa13","unresolved":false,"context_lines":[{"line_number":442,"context_line":"              this was the main point of wsme - validation?"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"        Accept a NewSample, note the following:"},{"line_number":445,"context_line":"        - Source will be set to the requestor\u0027s ipaddress"},{"line_number":446,"context_line":"        - The timestamp will be generated when received"},{"line_number":447,"context_line":"        - TODO: If admin the user_id/project_id can be set"},{"line_number":448,"context_line":"        - TODO: If not admin the user_id/project_id will be set the requestor"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2F%2F5g%3D","line":445,"updated":"2013-04-08 18:59:30.000000000","message":"I don\u0027t think that\u0027s the intent of the \"source\" field. It\u0027s supposed to be a name for the system so that a client will know how to interpret the user_id and project_id fields. We should consider renaming source to something more descriptive.","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"933dfe386d912ef322167e0398fd791af580ff5a","unresolved":false,"context_lines":[{"line_number":442,"context_line":"              this was the main point of wsme - validation?"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"        Accept a NewSample, note the following:"},{"line_number":445,"context_line":"        - Source will be set to the requestor\u0027s ipaddress"},{"line_number":446,"context_line":"        - The timestamp will be generated when received"},{"line_number":447,"context_line":"        - TODO: If admin the user_id/project_id can be set"},{"line_number":448,"context_line":"        - TODO: If not admin the user_id/project_id will be set the requestor"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2FyxU%3D","line":445,"in_reply_to":"AAAAOn%2F%2F%2F5g%3D","updated":"2013-04-26 03:23:37.000000000","message":"Well, I want to prevent the case of someone trying to post their own metering data.\nthat way they could mess with instance cpu meters. If I can\u0027t use \u0027source\u0027 then I am\nnot sure how to prevent this.","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"61addc2b9cc160b24ac9fc4ba25941ad0923aa13","unresolved":false,"context_lines":[{"line_number":446,"context_line":"        - The timestamp will be generated when received"},{"line_number":447,"context_line":"        - TODO: If admin the user_id/project_id can be set"},{"line_number":448,"context_line":"        - TODO: If not admin the user_id/project_id will be set the requestor"},{"line_number":449,"context_line":"        - TODO: we need throttling (don\u0027t allow a user to insert samples"},{"line_number":450,"context_line":"                at too high a rate)."},{"line_number":451,"context_line":"        - TODO: should really accept a list of NewSamples"},{"line_number":452,"context_line":"        - TODO: do we need to send via the collector first?"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2F%2F5c%3D","line":449,"updated":"2013-04-08 18:59:30.000000000","message":"We need throttling in general. Maybe we can do it in middleware?","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"61addc2b9cc160b24ac9fc4ba25941ad0923aa13","unresolved":false,"context_lines":[{"line_number":448,"context_line":"        - TODO: If not admin the user_id/project_id will be set the requestor"},{"line_number":449,"context_line":"        - TODO: we need throttling (don\u0027t allow a user to insert samples"},{"line_number":450,"context_line":"                at too high a rate)."},{"line_number":451,"context_line":"        - TODO: should really accept a list of NewSamples"},{"line_number":452,"context_line":"        - TODO: do we need to send via the collector first?"},{"line_number":453,"context_line":"        \u0027\u0027\u0027"},{"line_number":454,"context_line":"        s \u003d body"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2F%2F5U%3D","line":451,"updated":"2013-04-08 18:59:30.000000000","message":"But a small list.","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"61addc2b9cc160b24ac9fc4ba25941ad0923aa13","unresolved":false,"context_lines":[{"line_number":449,"context_line":"        - TODO: we need throttling (don\u0027t allow a user to insert samples"},{"line_number":450,"context_line":"                at too high a rate)."},{"line_number":451,"context_line":"        - TODO: should really accept a list of NewSamples"},{"line_number":452,"context_line":"        - TODO: do we need to send via the collector first?"},{"line_number":453,"context_line":"        \u0027\u0027\u0027"},{"line_number":454,"context_line":"        s \u003d body"},{"line_number":455,"context_line":"        #get auth info here (depends on"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2F%2F5A%3D","line":452,"updated":"2013-04-08 18:59:30.000000000","message":"If we still assume that someone may want to consume the messages directly, the API should send a message rather than writing to the db itself. If we don\u0027t assume that, we can just write to the db here (although maybe in the background, instead of blocking?).","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"933dfe386d912ef322167e0398fd791af580ff5a","unresolved":false,"context_lines":[{"line_number":449,"context_line":"        - TODO: we need throttling (don\u0027t allow a user to insert samples"},{"line_number":450,"context_line":"                at too high a rate)."},{"line_number":451,"context_line":"        - TODO: should really accept a list of NewSamples"},{"line_number":452,"context_line":"        - TODO: do we need to send via the collector first?"},{"line_number":453,"context_line":"        \u0027\u0027\u0027"},{"line_number":454,"context_line":"        s \u003d body"},{"line_number":455,"context_line":"        #get auth info here (depends on"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2FuTU%3D","line":452,"in_reply_to":"AAAAOn%2F%2F%2By8%3D","updated":"2013-04-26 03:23:37.000000000","message":"Done","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"a1fa6862619d27c78a6ff0579c63f57fd0a7e618","unresolved":false,"context_lines":[{"line_number":449,"context_line":"        - TODO: we need throttling (don\u0027t allow a user to insert samples"},{"line_number":450,"context_line":"                at too high a rate)."},{"line_number":451,"context_line":"        - TODO: should really accept a list of NewSamples"},{"line_number":452,"context_line":"        - TODO: do we need to send via the collector first?"},{"line_number":453,"context_line":"        \u0027\u0027\u0027"},{"line_number":454,"context_line":"        s \u003d body"},{"line_number":455,"context_line":"        #get auth info here (depends on"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2F%2By8%3D","line":452,"in_reply_to":"AAAAOn%2F%2F%2F5A%3D","updated":"2013-04-09 09:32:45.000000000","message":"We definitely don\u0027t want to write to the DB. You need to use a publishing pipeline.\nFor example, this API is very likely going to be the same interface used for alarming implementation, so it should send it there too.","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"d524ee6bad7c7a4cc231765301f73c7c70f7430a","unresolved":false,"context_lines":[{"line_number":412,"context_line":"    @wsme_pecan.wsexpose([Sample], body\u003d[Sample])"},{"line_number":413,"context_line":"    def post(self, body):"},{"line_number":414,"context_line":"        \u0027\u0027\u0027"},{"line_number":415,"context_line":"        Note:"},{"line_number":416,"context_line":"           1) the above validate decorator seems to do nothing."},{"line_number":417,"context_line":"           2) the mandatory options seems to also do nothing."},{"line_number":418,"context_line":"        \u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Ft2A%3D","line":415,"updated":"2013-04-26 14:32:44.000000000","message":"The docstring will eventually end up in our public documentation, so maybe these should move to comments?","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"f24ebfb4ac3b66d893331663adc2f1477d71d458","unresolved":false,"context_lines":[{"line_number":412,"context_line":"    @wsme_pecan.wsexpose([Sample], body\u003d[Sample])"},{"line_number":413,"context_line":"    def post(self, body):"},{"line_number":414,"context_line":"        \u0027\u0027\u0027"},{"line_number":415,"context_line":"        Note:"},{"line_number":416,"context_line":"           1) the above validate decorator seems to do nothing."},{"line_number":417,"context_line":"           2) the mandatory options seems to also do nothing."},{"line_number":418,"context_line":"        \u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FsA0%3D","line":415,"in_reply_to":"AAAAOn%2F%2Ft2A%3D","updated":"2013-04-29 01:58:04.000000000","message":"Done","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"d524ee6bad7c7a4cc231765301f73c7c70f7430a","unresolved":false,"context_lines":[{"line_number":416,"context_line":"           1) the above validate decorator seems to do nothing."},{"line_number":417,"context_line":"           2) the mandatory options seems to also do nothing."},{"line_number":418,"context_line":"        \u0027\u0027\u0027"},{"line_number":419,"context_line":"        # this is odd, body should already be in a list of Sample\u0027s"},{"line_number":420,"context_line":"        now \u003d timeutils.utcnow()"},{"line_number":421,"context_line":"        samples \u003d [Sample(**b) for b in body]"},{"line_number":422,"context_line":"        for s in samples:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Ft18%3D","line":419,"updated":"2013-04-26 14:32:44.000000000","message":"Still a bug in WSME?","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"f24ebfb4ac3b66d893331663adc2f1477d71d458","unresolved":false,"context_lines":[{"line_number":416,"context_line":"           1) the above validate decorator seems to do nothing."},{"line_number":417,"context_line":"           2) the mandatory options seems to also do nothing."},{"line_number":418,"context_line":"        \u0027\u0027\u0027"},{"line_number":419,"context_line":"        # this is odd, body should already be in a list of Sample\u0027s"},{"line_number":420,"context_line":"        now \u003d timeutils.utcnow()"},{"line_number":421,"context_line":"        samples \u003d [Sample(**b) for b in body]"},{"line_number":422,"context_line":"        for s in samples:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FsAw%3D","line":419,"in_reply_to":"AAAAOn%2F%2Ft18%3D","updated":"2013-04-29 01:58:04.000000000","message":"Yea, seems to be.","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"d524ee6bad7c7a4cc231765301f73c7c70f7430a","unresolved":false,"context_lines":[{"line_number":424,"context_line":"            if self._id !\u003d s.counter_name:"},{"line_number":425,"context_line":"                raise wsme.exc.InvalidInput(\u0027counter_name\u0027, s.counter_name,"},{"line_number":426,"context_line":"                                            \u0027should be %s\u0027 % self._id)"},{"line_number":427,"context_line":"            if s.timestamp is None or s.timestamp is wsme.Unset:"},{"line_number":428,"context_line":"                s.timestamp \u003d now"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        source \u003d \u0027custom:%s\u0027 % pecan.request.environ.get(\u0027REMOTE_ADDR\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Ft1U%3D","line":427,"updated":"2013-04-26 14:32:44.000000000","message":"Can the client ever pass an empty string, or does the earlier validation prevent that?","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"fbabf9edcc3c1a457cdedd2307ea44a0e9665b13","unresolved":false,"context_lines":[{"line_number":424,"context_line":"            if self._id !\u003d s.counter_name:"},{"line_number":425,"context_line":"                raise wsme.exc.InvalidInput(\u0027counter_name\u0027, s.counter_name,"},{"line_number":426,"context_line":"                                            \u0027should be %s\u0027 % self._id)"},{"line_number":427,"context_line":"            if s.timestamp is None or s.timestamp is wsme.Unset:"},{"line_number":428,"context_line":"                s.timestamp \u003d now"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        source \u003d \u0027custom:%s\u0027 % pecan.request.environ.get(\u0027REMOTE_ADDR\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fn1c%3D","line":427,"in_reply_to":"AAAAOn%2F%2FsA4%3D","updated":"2013-05-01 15:58:37.000000000","message":"Right. But is it possible for the user to pass us literally \u0027\u0027 and have that go into the database, or is something else verifying that the value provided is a real timestamp? The WSME type check *should* be, but does the datetime parser fail on an empty string, or provide some default?","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"f24ebfb4ac3b66d893331663adc2f1477d71d458","unresolved":false,"context_lines":[{"line_number":424,"context_line":"            if self._id !\u003d s.counter_name:"},{"line_number":425,"context_line":"                raise wsme.exc.InvalidInput(\u0027counter_name\u0027, s.counter_name,"},{"line_number":426,"context_line":"                                            \u0027should be %s\u0027 % self._id)"},{"line_number":427,"context_line":"            if s.timestamp is None or s.timestamp is wsme.Unset:"},{"line_number":428,"context_line":"                s.timestamp \u003d now"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        source \u003d \u0027custom:%s\u0027 % pecan.request.environ.get(\u0027REMOTE_ADDR\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FsA4%3D","line":427,"in_reply_to":"AAAAOn%2F%2Ft1U%3D","updated":"2013-04-29 01:58:04.000000000","message":"So the idea is if no timestamp, then we make one. Else use the user\u0027s timestamp.","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"587de82f970bfe569675a5189c28960a359c7b0a","unresolved":false,"context_lines":[{"line_number":427,"context_line":"            if s.timestamp is None or s.timestamp is wsme.Unset:"},{"line_number":428,"context_line":"                s.timestamp \u003d now"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        source \u003d \u0027custom:%s\u0027 % pecan.request.environ.get(\u0027REMOTE_ADDR\u0027,"},{"line_number":431,"context_line":"                                                         \u0027unknown\u0027)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        with pipeline.PublishContext("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fsuw%3D","line":430,"updated":"2013-04-27 06:26:20.000000000","message":"I think we may need to allow the user to specify its own source in the POST. So I suggest the \u0027custom:IPADDR\u0027 to be a prefix to the user specified source.","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"d524ee6bad7c7a4cc231765301f73c7c70f7430a","unresolved":false,"context_lines":[{"line_number":427,"context_line":"            if s.timestamp is None or s.timestamp is wsme.Unset:"},{"line_number":428,"context_line":"                s.timestamp \u003d now"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        source \u003d \u0027custom:%s\u0027 % pecan.request.environ.get(\u0027REMOTE_ADDR\u0027,"},{"line_number":431,"context_line":"                                                         \u0027unknown\u0027)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        with pipeline.PublishContext("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Ft1o%3D","line":430,"updated":"2013-04-26 14:32:44.000000000","message":"I\u0027m still worried that using the IP address is going to be an issue. What if I am collecting data from different servers? The scope for user, project, and resource won\u0027t be changing in that case.","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"fbabf9edcc3c1a457cdedd2307ea44a0e9665b13","unresolved":false,"context_lines":[{"line_number":427,"context_line":"            if s.timestamp is None or s.timestamp is wsme.Unset:"},{"line_number":428,"context_line":"                s.timestamp \u003d now"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        source \u003d \u0027custom:%s\u0027 % pecan.request.environ.get(\u0027REMOTE_ADDR\u0027,"},{"line_number":431,"context_line":"                                                         \u0027unknown\u0027)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        with pipeline.PublishContext("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fn00%3D","line":430,"in_reply_to":"AAAAOn%2F%2FsAY%3D","updated":"2013-05-01 15:58:37.000000000","message":"I like adding project_id as a prefix to what the user provides. That gives us a separate \"namespace\" for each project, but lets them provide whatever they want. We should probably document a maximum length or something and truncate the value.\n\nUnder the v1 API the list of sources comes from a JSON file in the config directory (we thought they would all be controlled by the deployer). We don\u0027t have an API for getting a list of sources in the v2 API. Do we need one? If so, I think we should just use a database query.","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"f24ebfb4ac3b66d893331663adc2f1477d71d458","unresolved":false,"context_lines":[{"line_number":427,"context_line":"            if s.timestamp is None or s.timestamp is wsme.Unset:"},{"line_number":428,"context_line":"                s.timestamp \u003d now"},{"line_number":429,"context_line":""},{"line_number":430,"context_line":"        source \u003d \u0027custom:%s\u0027 % pecan.request.environ.get(\u0027REMOTE_ADDR\u0027,"},{"line_number":431,"context_line":"                                                         \u0027unknown\u0027)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        with pipeline.PublishContext("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FsAY%3D","line":430,"in_reply_to":"AAAAOn%2F%2Ft1o%3D","updated":"2013-04-29 01:58:04.000000000","message":"How about:\n if admin:\n  can set any source\n else:\n  so \u003d project_id + source?","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"d524ee6bad7c7a4cc231765301f73c7c70f7430a","unresolved":false,"context_lines":[{"line_number":430,"context_line":"        source \u003d \u0027custom:%s\u0027 % pecan.request.environ.get(\u0027REMOTE_ADDR\u0027,"},{"line_number":431,"context_line":"                                                         \u0027unknown\u0027)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        with pipeline.PublishContext("},{"line_number":434,"context_line":"                context.get_admin_context(),"},{"line_number":435,"context_line":"                source,"},{"line_number":436,"context_line":"                pecan.request.pipeline_manager.pipelines,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Ft0w%3D","line":433,"updated":"2013-04-26 14:32:44.000000000","message":"We should probably provide a way to do this as a background task, rather than blocking the API thread for it. That can be done in a separate changeset, though.","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"587de82f970bfe569675a5189c28960a359c7b0a","unresolved":false,"context_lines":[{"line_number":430,"context_line":"        source \u003d \u0027custom:%s\u0027 % pecan.request.environ.get(\u0027REMOTE_ADDR\u0027,"},{"line_number":431,"context_line":"                                                         \u0027unknown\u0027)"},{"line_number":432,"context_line":""},{"line_number":433,"context_line":"        with pipeline.PublishContext("},{"line_number":434,"context_line":"                context.get_admin_context(),"},{"line_number":435,"context_line":"                source,"},{"line_number":436,"context_line":"                pecan.request.pipeline_manager.pipelines,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fsuo%3D","line":433,"in_reply_to":"AAAAOn%2F%2Ft0w%3D","updated":"2013-04-27 06:26:20.000000000","message":"Doug, do you mean to do it asynchronously? In that case, how can the user know its posted data are all actually got processed without any failure?","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"587de82f970bfe569675a5189c28960a359c7b0a","unresolved":false,"context_lines":[{"line_number":444,"context_line":"                project_id\u003ds.project_id,"},{"line_number":445,"context_line":"                resource_id\u003ds.resource_id,"},{"line_number":446,"context_line":"                timestamp\u003ds.timestamp.isoformat(),"},{"line_number":447,"context_line":"                resource_metadata\u003ds.resource_metadata) for s in samples])"},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"        # this is not ideal, it would be nice if the publisher"},{"line_number":450,"context_line":"        # returned the created sample message with message id."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fsuk%3D","line":447,"updated":"2013-04-27 06:26:20.000000000","message":"Does this mean that we have to deploy all the transformer/publisher on to the API server? How about having the API server do a rpc.call to transform/publish those meters in somewhere else, e.g. central/compute agent?","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"fbabf9edcc3c1a457cdedd2307ea44a0e9665b13","unresolved":false,"context_lines":[{"line_number":444,"context_line":"                project_id\u003ds.project_id,"},{"line_number":445,"context_line":"                resource_id\u003ds.resource_id,"},{"line_number":446,"context_line":"                timestamp\u003ds.timestamp.isoformat(),"},{"line_number":447,"context_line":"                resource_metadata\u003ds.resource_metadata) for s in samples])"},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"        # this is not ideal, it would be nice if the publisher"},{"line_number":450,"context_line":"        # returned the created sample message with message id."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fn0I%3D","line":447,"in_reply_to":"AAAAOn%2F%2FsAM%3D","updated":"2013-05-01 15:58:37.000000000","message":"Yes, we would need the publisher code on the API server for this to work. We could create a new notification and use that to send the data to the collector for processing, but that will produce more traffic. Using the pipeline directly seems more efficient, even though it does make deploying a bit more complex.","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"f24ebfb4ac3b66d893331663adc2f1477d71d458","unresolved":false,"context_lines":[{"line_number":444,"context_line":"                project_id\u003ds.project_id,"},{"line_number":445,"context_line":"                resource_id\u003ds.resource_id,"},{"line_number":446,"context_line":"                timestamp\u003ds.timestamp.isoformat(),"},{"line_number":447,"context_line":"                resource_metadata\u003ds.resource_metadata) for s in samples])"},{"line_number":448,"context_line":""},{"line_number":449,"context_line":"        # this is not ideal, it would be nice if the publisher"},{"line_number":450,"context_line":"        # returned the created sample message with message id."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FsAM%3D","line":447,"in_reply_to":"AAAAOn%2F%2Fsuk%3D","updated":"2013-04-29 01:58:04.000000000","message":"not sure, this is what Julien suggested.","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"d524ee6bad7c7a4cc231765301f73c7c70f7430a","unresolved":false,"context_lines":[{"line_number":448,"context_line":""},{"line_number":449,"context_line":"        # this is not ideal, it would be nice if the publisher"},{"line_number":450,"context_line":"        # returned the created sample message with message id."},{"line_number":451,"context_line":"        return [Sample(source\u003dsource,"},{"line_number":452,"context_line":"                       counter_name\u003ds.counter_name,"},{"line_number":453,"context_line":"                       counter_unit\u003ds.counter_unit,"},{"line_number":454,"context_line":"                       counter_type\u003ds.counter_type,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Ft0c%3D","line":451,"updated":"2013-04-26 14:32:44.000000000","message":"Why make new objects here? Could we set the source field on the samples in the loop at the top of this function and then return the same objects?","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"f24ebfb4ac3b66d893331663adc2f1477d71d458","unresolved":false,"context_lines":[{"line_number":448,"context_line":""},{"line_number":449,"context_line":"        # this is not ideal, it would be nice if the publisher"},{"line_number":450,"context_line":"        # returned the created sample message with message id."},{"line_number":451,"context_line":"        return [Sample(source\u003dsource,"},{"line_number":452,"context_line":"                       counter_name\u003ds.counter_name,"},{"line_number":453,"context_line":"                       counter_unit\u003ds.counter_unit,"},{"line_number":454,"context_line":"                       counter_type\u003ds.counter_type,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fr%2F8%3D","line":451,"in_reply_to":"AAAAOn%2F%2Ft0c%3D","updated":"2013-04-29 01:58:04.000000000","message":"Done","commit_id":"0a68a67dbf49e468a17d760ed605e36af1da5d14"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"2f41281d9fe1e1e6f86fc0adca027da58fd83276","unresolved":false,"context_lines":[{"line_number":442,"context_line":"        if not source:"},{"line_number":443,"context_line":"            source \u003d pecan.request.cfg.counter_source"},{"line_number":444,"context_line":"        for s in samples:"},{"line_number":445,"context_line":"            s.source \u003d source"},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"        with pipeline.PublishContext("},{"line_number":448,"context_line":"                context.get_admin_context(),"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAOn%2F%2Fnz4%3D","line":445,"updated":"2013-05-01 15:59:21.000000000","message":"Prepend the project id value here?","commit_id":"bc958cf5659d4777c351a5091f0c14830a19d41a"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"7a5c7892422cc3393177baecdf81e6b37e3ed6ab","unresolved":false,"context_lines":[{"line_number":436,"context_line":"            if s.source and not source:"},{"line_number":437,"context_line":"                source \u003d s.source"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        # make sure all samples have the same source set."},{"line_number":440,"context_line":"        if not source:"},{"line_number":441,"context_line":"            source \u003d pecan.request.cfg.counter_source"},{"line_number":442,"context_line":"        for s in samples:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAOn%2F%2FmP4%3D","line":439,"updated":"2013-05-02 13:06:57.000000000","message":"Source handling seems a bit dangerous. Either you\u0027re going to override it if the samples don\u0027t have the same, or set a default random one.\n\nI think the best thing to do here is to group the samples by source, and publish them with the group they requested.","commit_id":"a6ca2b6b6f31a4ced84400f164864c91ecdc73c0"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"15af06d6632d54e4ef5ec5f5e624f31eef163f97","unresolved":false,"context_lines":[{"line_number":436,"context_line":"            if s.source and not source:"},{"line_number":437,"context_line":"                source \u003d s.source"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        # make sure all samples have the same source set."},{"line_number":440,"context_line":"        if not source:"},{"line_number":441,"context_line":"            source \u003d pecan.request.cfg.counter_source"},{"line_number":442,"context_line":"        for s in samples:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAOn%2F%2FkrM%3D","line":439,"in_reply_to":"AAAAOn%2F%2FlWw%3D","updated":"2013-05-03 12:35:32.000000000","message":"My bad, I missed the check above actually. I\u0027m not sure it makes sense to make such a limitation since we could handle it gracefully, but OTOH that\u0027s not a stopper to me.","commit_id":"a6ca2b6b6f31a4ced84400f164864c91ecdc73c0"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"861a7e8b8024a840845afa2e036ff0dfec977dbd","unresolved":false,"context_lines":[{"line_number":436,"context_line":"            if s.source and not source:"},{"line_number":437,"context_line":"                source \u003d s.source"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"        # make sure all samples have the same source set."},{"line_number":440,"context_line":"        if not source:"},{"line_number":441,"context_line":"            source \u003d pecan.request.cfg.counter_source"},{"line_number":442,"context_line":"        for s in samples:"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAOn%2F%2FlWw%3D","line":439,"in_reply_to":"AAAAOn%2F%2FmP4%3D","updated":"2013-05-02 23:23:44.000000000","message":"We require all samples to be for the same counter_name, it does not make\nsense to be posting the same counter with different sources and the same user (unless you can think of an obvious use case). All I am doing here is making sure\nthat they are all the same and prepending the project_id.","commit_id":"a6ca2b6b6f31a4ced84400f164864c91ecdc73c0"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"7a5c7892422cc3393177baecdf81e6b37e3ed6ab","unresolved":false,"context_lines":[{"line_number":459,"context_line":"                resource_metadata\u003ds.resource_metadata) for s in samples])"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        # this is not ideal, it would be nice if the publisher"},{"line_number":462,"context_line":"        # returned the created sample message with message id."},{"line_number":463,"context_line":"        return samples"},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"    @wsme_pecan.wsexpose([Statistics], [Query], int)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAOn%2F%2FmP0%3D","line":462,"updated":"2013-05-02 13:06:57.000000000","message":"Agreed. Can you put a XXX or TODO so we don\u0027t forget until we report a bug or open a bp or something?","commit_id":"a6ca2b6b6f31a4ced84400f164864c91ecdc73c0"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"861a7e8b8024a840845afa2e036ff0dfec977dbd","unresolved":false,"context_lines":[{"line_number":459,"context_line":"                resource_metadata\u003ds.resource_metadata) for s in samples])"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        # this is not ideal, it would be nice if the publisher"},{"line_number":462,"context_line":"        # returned the created sample message with message id."},{"line_number":463,"context_line":"        return samples"},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"    @wsme_pecan.wsexpose([Statistics], [Query], int)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAOn%2F%2FlWs%3D","line":462,"in_reply_to":"AAAAOn%2F%2FmP0%3D","updated":"2013-05-02 23:23:44.000000000","message":"sure, I\u0027ll do that.","commit_id":"a6ca2b6b6f31a4ced84400f164864c91ecdc73c0"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"396874c9f629af9a3b58e45163f7bc86ff8c40b3","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        super(Sample, self).__init__(counter_volume\u003dcounter_volume,"},{"line_number":273,"context_line":"                                     resource_metadata\u003dresource_metadata,"},{"line_number":274,"context_line":"                                     timestamp\u003dtimestamp, **kwds)"},{"line_number":275,"context_line":"        \u0027\u0027\u0027Seems the mandatory option doesn\u0027t work so do it manually\u0027\u0027\u0027"},{"line_number":276,"context_line":"        for m in (\u0027counter_volume\u0027, \u0027counter_unit\u0027,"},{"line_number":277,"context_line":"                  \u0027counter_name\u0027, \u0027counter_type\u0027, \u0027resource_id\u0027):"},{"line_number":278,"context_line":"            if getattr(self, m) in (wsme.Unset, None):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOn%2F%2FeSc%3D","line":275,"updated":"2013-05-08 16:34:27.000000000","message":"Nitpick: should this be a normal comment as opposed to a docstring?","commit_id":"d1a6a0f726ab6a2399fe50e2c689579a44f60ac1"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"f2ce539cfd4d0117a082449bd23a9ede4be443ff","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        super(Sample, self).__init__(counter_volume\u003dcounter_volume,"},{"line_number":273,"context_line":"                                     resource_metadata\u003dresource_metadata,"},{"line_number":274,"context_line":"                                     timestamp\u003dtimestamp, **kwds)"},{"line_number":275,"context_line":"        \u0027\u0027\u0027Seems the mandatory option doesn\u0027t work so do it manually\u0027\u0027\u0027"},{"line_number":276,"context_line":"        for m in (\u0027counter_volume\u0027, \u0027counter_unit\u0027,"},{"line_number":277,"context_line":"                  \u0027counter_name\u0027, \u0027counter_type\u0027, \u0027resource_id\u0027):"},{"line_number":278,"context_line":"            if getattr(self, m) in (wsme.Unset, None):"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOn%2F%2FdJs%3D","line":275,"in_reply_to":"AAAAOn%2F%2FeSc%3D","updated":"2013-05-09 01:49:56.000000000","message":"Done","commit_id":"d1a6a0f726ab6a2399fe50e2c689579a44f60ac1"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"bdd3767e380e7203a5373493e50b7bafd2fd63ad","unresolved":false,"context_lines":[{"line_number":481,"context_line":"                                            \u0027should be %s\u0027 % self._id)"},{"line_number":482,"context_line":"            if s.timestamp is None or s.timestamp is wsme.Unset:"},{"line_number":483,"context_line":"                s.timestamp \u003d now"},{"line_number":484,"context_line":"            s.source \u003d \u0027%s:%s\u0027 % (s.project_id, source)"},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"        with pipeline.PublishContext("},{"line_number":487,"context_line":"                context.get_admin_context(),"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAOn%2F%2FasQ%3D","line":484,"updated":"2013-05-10 07:33:30.000000000","message":"what if the user doesn\u0027t provide project_id? like those metrics from glance? Can we agree to live with \":source\" as source? \n\nI think we should document this change to the user supplied source.","commit_id":"c9065364d42d1a2e3ef4da30a09ebf6b49336026"}],"ceilometer/api/hooks.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"8d6535d2a071f4209b9c22896cbfaf1545db11f3","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    new samples can be posted via the /v2/meters/ API."},{"line_number":55,"context_line":"    \u0027\u0027\u0027"},{"line_number":56,"context_line":"    def __init__(self):"},{"line_number":57,"context_line":"        self.pipeline_manager \u003d pipeline.setup_pipeline("},{"line_number":58,"context_line":"            transformer.TransformerExtensionManager("},{"line_number":59,"context_line":"                \u0027ceilometer.transformer\u0027,"},{"line_number":60,"context_line":"            ),"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAOn%2F%2Fglo%3D","line":57,"updated":"2013-05-07 13:12:16.000000000","message":"This is going to redo a lot of work each time a request comes in, even if the pipeline is not needed. If only the new controller needs the pipeline, maybe it should be created as a class attribute there? Or maybe just as a class attribute here, so we only take the hit of instantiating it (and scanning all of those plugins) one time. If you make it a class attribute in the hook, a reference can still be copied into the request to make it easier for controller methods to access.","commit_id":"c72e3e43f503226f26bfa1a8fc888e325cc91665"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"6dea0ee05bf3b95587a37d67d31d308155dcc2a5","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    new samples can be posted via the /v2/meters/ API."},{"line_number":55,"context_line":"    \u0027\u0027\u0027"},{"line_number":56,"context_line":"    def __init__(self):"},{"line_number":57,"context_line":"        self.pipeline_manager \u003d pipeline.setup_pipeline("},{"line_number":58,"context_line":"            transformer.TransformerExtensionManager("},{"line_number":59,"context_line":"                \u0027ceilometer.transformer\u0027,"},{"line_number":60,"context_line":"            ),"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAOn%2F%2FfZw%3D","line":57,"in_reply_to":"AAAAOn%2F%2Fglo%3D","updated":"2013-05-08 01:21:56.000000000","message":"Nice idea, didn\u0027t think of that.","commit_id":"c72e3e43f503226f26bfa1a8fc888e325cc91665"}],"ceilometer/tests/api.py":[{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"61addc2b9cc160b24ac9fc4ba25941ad0923aa13","unresolved":false,"context_lines":[{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    def post_json(self, path, **params):"},{"line_number":159,"context_line":"        full_path \u003d self.PATH_PREFIX + path"},{"line_number":160,"context_line":"        print \u0027post_json params\u003d%s\u0027 % params"},{"line_number":161,"context_line":"        resp \u003d self.app.post(full_path, params\u003dparams)"},{"line_number":162,"context_line":"        return resp"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2F%2F40%3D","line":160,"updated":"2013-04-08 18:59:30.000000000","message":"debug print","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"933dfe386d912ef322167e0398fd791af580ff5a","unresolved":false,"context_lines":[{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    def post_json(self, path, **params):"},{"line_number":159,"context_line":"        full_path \u003d self.PATH_PREFIX + path"},{"line_number":160,"context_line":"        print \u0027post_json params\u003d%s\u0027 % params"},{"line_number":161,"context_line":"        resp \u003d self.app.post(full_path, params\u003dparams)"},{"line_number":162,"context_line":"        return resp"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2FuTQ%3D","line":160,"in_reply_to":"AAAAOn%2F%2F%2F40%3D","updated":"2013-04-26 03:23:37.000000000","message":"I cleaned this up so it does what that above function does.\n\nprint \u0027GOT:\u0027, response","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"}],"tests/api/v2/test_post_samples.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"a1fa6862619d27c78a6ff0579c63f57fd0a7e618","unresolved":false,"context_lines":[{"line_number":41,"context_line":"                           \u0027name2\u0027: \u0027value2\u0027}}"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        data \u003d self.post_json(\u0027/meters/fruit/\u0027, sample\u003ds1)"},{"line_number":44,"context_line":"        print \u0027post result is %s\u0027 % data"},{"line_number":45,"context_line":"        self.assertEquals(s1, data)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2F%2By0%3D","line":44,"updated":"2013-04-09 09:32:45.000000000","message":"debug print :)","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"933dfe386d912ef322167e0398fd791af580ff5a","unresolved":false,"context_lines":[{"line_number":41,"context_line":"                           \u0027name2\u0027: \u0027value2\u0027}}"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"        data \u003d self.post_json(\u0027/meters/fruit/\u0027, sample\u003ds1)"},{"line_number":44,"context_line":"        print \u0027post result is %s\u0027 % data"},{"line_number":45,"context_line":"        self.assertEquals(s1, data)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOn%2F%2FuTM%3D","line":44,"in_reply_to":"AAAAOn%2F%2F%2By0%3D","updated":"2013-04-26 03:23:37.000000000","message":"Done","commit_id":"fdcd017d88a54a65778afc2a2424c6f6075c1ee0"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"7a5c7892422cc3393177baecdf81e6b37e3ed6ab","unresolved":false,"context_lines":[{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class TestPostSamples(FunctionalTest):"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def test_one(self):"},{"line_number":34,"context_line":"        s1 \u003d [{\u0027counter_name\u0027: \u0027apples\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAOn%2F%2FmPU%3D","line":31,"updated":"2013-05-02 13:06:57.000000000","message":"Having tests where you forget mandatory fields would be great. I\u0027m pretty sure it will be useful to check that WSME does the mandatory field check later if we try to remove the code you added to do this in place of WSME itself. :)","commit_id":"a6ca2b6b6f31a4ced84400f164864c91ecdc73c0"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"861a7e8b8024a840845afa2e036ff0dfec977dbd","unresolved":false,"context_lines":[{"line_number":28,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class TestPostSamples(FunctionalTest):"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def test_one(self):"},{"line_number":34,"context_line":"        s1 \u003d [{\u0027counter_name\u0027: \u0027apples\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAOn%2F%2FlWc%3D","line":31,"in_reply_to":"AAAAOn%2F%2FmPU%3D","updated":"2013-05-02 23:23:44.000000000","message":"ok","commit_id":"a6ca2b6b6f31a4ced84400f164864c91ecdc73c0"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"7a5c7892422cc3393177baecdf81e6b37e3ed6ab","unresolved":false,"context_lines":[{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        self.assertEquals(data.status_int, 400)"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def test_multiple_samples(self):"},{"line_number":74,"context_line":"        \u0027\u0027\u0027"},{"line_number":75,"context_line":"        send multiple samples."},{"line_number":76,"context_line":"        The usecase here is to reduce the chatter and send the counters"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAOn%2F%2FmPc%3D","line":73,"updated":"2013-05-02 13:06:57.000000000","message":"Having a test with different sources would be great","commit_id":"a6ca2b6b6f31a4ced84400f164864c91ecdc73c0"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"8d6535d2a071f4209b9c22896cbfaf1545db11f3","unresolved":false,"context_lines":[{"line_number":42,"context_line":"               \u0027resource_metadata\u0027: {\u0027name1\u0027: \u0027value1\u0027,"},{"line_number":43,"context_line":"                                     \u0027name2\u0027: \u0027value2\u0027}}]"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        data \u003d self.post_json(\u0027/meters/apples/\u0027, s1)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        # timestamp not given so it is generated."},{"line_number":48,"context_line":"        s1[0][\u0027timestamp\u0027] \u003d data.json[0][\u0027timestamp\u0027]"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAOn%2F%2Fgk4%3D","line":45,"updated":"2013-05-07 13:12:16.000000000","message":"What prevents this call from trying to publish the meters through the pipeline? Shouldn\u0027t that be stubbed out so we don\u0027t need a message broker on the test server?","commit_id":"c72e3e43f503226f26bfa1a8fc888e325cc91665"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"6dea0ee05bf3b95587a37d67d31d308155dcc2a5","unresolved":false,"context_lines":[{"line_number":42,"context_line":"               \u0027resource_metadata\u0027: {\u0027name1\u0027: \u0027value1\u0027,"},{"line_number":43,"context_line":"                                     \u0027name2\u0027: \u0027value2\u0027}}]"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        data \u003d self.post_json(\u0027/meters/apples/\u0027, s1)"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        # timestamp not given so it is generated."},{"line_number":48,"context_line":"        s1[0][\u0027timestamp\u0027] \u003d data.json[0][\u0027timestamp\u0027]"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAOn%2F%2FfZY%3D","line":45,"in_reply_to":"AAAAOn%2F%2Fgk4%3D","updated":"2013-05-08 01:21:56.000000000","message":"Done","commit_id":"c72e3e43f503226f26bfa1a8fc888e325cc91665"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"396874c9f629af9a3b58e45163f7bc86ff8c40b3","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                 \u0027counter_unit\u0027: \u0027instance\u0027,"},{"line_number":97,"context_line":"                 \u0027counter_volume\u0027: float(x * 3),"},{"line_number":98,"context_line":"                 \u0027source\u0027: \u0027evil\u0027,"},{"line_number":99,"context_line":"                 \u0027timestamp\u0027: dt.isoformat(),"},{"line_number":100,"context_line":"                 \u0027resource_id\u0027: \u0027bd9431c1-8d69-4ad3-803a-8d4a6b89fd36\u0027,"},{"line_number":101,"context_line":"                 \u0027project_id\u0027: \u002735b17138-b364-4e6a-a131-8f3099c5be68\u0027,"},{"line_number":102,"context_line":"                 \u0027user_id\u0027: \u0027efd87807-12d2-4b38-9c70-5f5c2ac427ff\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOn%2F%2FeSA%3D","line":99,"updated":"2013-05-08 16:34:27.000000000","message":"Would it be more realistic for the batched samples to have different timestamps?","commit_id":"d1a6a0f726ab6a2399fe50e2c689579a44f60ac1"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"dc697b9d6c43010686369deb52a42ae4c08c7147","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                 \u0027counter_unit\u0027: \u0027instance\u0027,"},{"line_number":97,"context_line":"                 \u0027counter_volume\u0027: float(x * 3),"},{"line_number":98,"context_line":"                 \u0027source\u0027: \u0027evil\u0027,"},{"line_number":99,"context_line":"                 \u0027timestamp\u0027: dt.isoformat(),"},{"line_number":100,"context_line":"                 \u0027resource_id\u0027: \u0027bd9431c1-8d69-4ad3-803a-8d4a6b89fd36\u0027,"},{"line_number":101,"context_line":"                 \u0027project_id\u0027: \u002735b17138-b364-4e6a-a131-8f3099c5be68\u0027,"},{"line_number":102,"context_line":"                 \u0027user_id\u0027: \u0027efd87807-12d2-4b38-9c70-5f5c2ac427ff\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOn%2F%2Fct4%3D","line":99,"in_reply_to":"AAAAOn%2F%2FdJo%3D","updated":"2013-05-09 09:00:13.000000000","message":"A-ha, missed the x. \n\nCool, sorry for the noise!","commit_id":"d1a6a0f726ab6a2399fe50e2c689579a44f60ac1"},{"author":{"_account_id":4715,"name":"Angus Salkeld","email":"asalkeld@redhat.com","username":"asalkeld"},"change_message_id":"f2ce539cfd4d0117a082449bd23a9ede4be443ff","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                 \u0027counter_unit\u0027: \u0027instance\u0027,"},{"line_number":97,"context_line":"                 \u0027counter_volume\u0027: float(x * 3),"},{"line_number":98,"context_line":"                 \u0027source\u0027: \u0027evil\u0027,"},{"line_number":99,"context_line":"                 \u0027timestamp\u0027: dt.isoformat(),"},{"line_number":100,"context_line":"                 \u0027resource_id\u0027: \u0027bd9431c1-8d69-4ad3-803a-8d4a6b89fd36\u0027,"},{"line_number":101,"context_line":"                 \u0027project_id\u0027: \u002735b17138-b364-4e6a-a131-8f3099c5be68\u0027,"},{"line_number":102,"context_line":"                 \u0027user_id\u0027: \u0027efd87807-12d2-4b38-9c70-5f5c2ac427ff\u0027,"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOn%2F%2FdJo%3D","line":99,"in_reply_to":"AAAAOn%2F%2FeSA%3D","updated":"2013-05-09 01:49:56.000000000","message":"they are:\n  for x in range(6):\n      dt \u003d datetime.datetime(2012, 8, 27, x, 0, tzinfo\u003dNone)\n\n see the \"x\" ^","commit_id":"d1a6a0f726ab6a2399fe50e2c689579a44f60ac1"}]}
