)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"2cb16ad5c0ba593d70ae992a18e196a3f64f1017","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2013-08-27 22:39:42 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Implement \u0027reset_on\u0027 for mongodb"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Id2bf1c1d15e7498a9625a6f15a074c5338e74d59"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAASn%2F%2F5r8%3D","line":8,"updated":"2013-08-28 07:50:55.000000000","message":"Can you update the commit message with a more complete explaination of what is reset_on ?","commit_id":"7a6df811c7b4cca04687e36dd381c02a5801d48a"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"42e67ef4bf0e40ab24186732d5364695cb7ee6cf","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2013-08-27 22:39:42 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Implement \u0027reset_on\u0027 for mongodb"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: Id2bf1c1d15e7498a9625a6f15a074c5338e74d59"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"AAAASn%2F%2F5q8%3D","line":8,"in_reply_to":"AAAASn%2F%2F5r8%3D","updated":"2013-08-28 07:54:21.000000000","message":"And the blueprint name","commit_id":"7a6df811c7b4cca04687e36dd381c02a5801d48a"}],"ceilometer/storage/__init__.py":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"b38ebe9b4115803abf4d03da7c1e6c5330f30813","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    :param resource: Optional filter for resource id."},{"line_number":94,"context_line":"    :param meter: Optional filter for meter type using the meter name."},{"line_number":95,"context_line":"    :param source: Optional source filter."},{"line_number":96,"context_line":"    :param metaquery: Optional filter on the metadata"},{"line_number":97,"context_line":"    \"\"\""},{"line_number":98,"context_line":"    def __init__(self, user\u003dNone, project\u003dNone,"},{"line_number":99,"context_line":"                 start\u003dNone, start_timestamp_op\u003dNone,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASn%2F%2F%2F00%3D","line":96,"updated":"2013-08-27 02:22:12.000000000","message":"the reset_on param definition is in the second patch, they should be together","commit_id":"6f22c3b7840c97fcd8d469040fb8e0daac97b9f7"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"9a453b6660a4bb12f63d3c707b60a0a271ad1bff","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    :param resource: Optional filter for resource id."},{"line_number":94,"context_line":"    :param meter: Optional filter for meter type using the meter name."},{"line_number":95,"context_line":"    :param source: Optional source filter."},{"line_number":96,"context_line":"    :param metaquery: Optional filter on the metadata"},{"line_number":97,"context_line":"    \"\"\""},{"line_number":98,"context_line":"    def __init__(self, user\u003dNone, project\u003dNone,"},{"line_number":99,"context_line":"                 start\u003dNone, start_timestamp_op\u003dNone,"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASn%2F%2F8H0%3D","line":96,"in_reply_to":"AAAASn%2F%2F%2F00%3D","updated":"2013-08-27 20:47:56.000000000","message":"Done","commit_id":"6f22c3b7840c97fcd8d469040fb8e0daac97b9f7"},{"author":{"_account_id":4491,"name":"Lianhao Lu","email":"llh_misc@outlook.com","username":"lianhao-lu"},"change_message_id":"594a17d904df2c3a68c2c92365e3eedeaffe109f","unresolved":false,"context_lines":[{"line_number":103,"context_line":"                 end\u003dNone, end_timestamp_op\u003dNone,"},{"line_number":104,"context_line":"                 resource\u003dNone, meter\u003dNone,"},{"line_number":105,"context_line":"                 source\u003dNone, metaquery\u003d{},"},{"line_number":106,"context_line":"                 reset_on\u003dNone):"},{"line_number":107,"context_line":"        self.user \u003d user"},{"line_number":108,"context_line":"        self.project \u003d project"},{"line_number":109,"context_line":"        self.start \u003d utils.sanitize_timestamp(start)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAASn%2F%2FoWM%3D","line":106,"updated":"2013-09-02 07:29:45.000000000","message":"If I read the code correctly, no one is using this, right?","commit_id":"bd24a0628dc8a474172a10a60834c4d309c00f74"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"6743f850ddf30a9ab0fba47d222627076187f0f9","unresolved":false,"context_lines":[{"line_number":103,"context_line":"                 end\u003dNone, end_timestamp_op\u003dNone,"},{"line_number":104,"context_line":"                 resource\u003dNone, meter\u003dNone,"},{"line_number":105,"context_line":"                 source\u003dNone, metaquery\u003d{},"},{"line_number":106,"context_line":"                 reset_on\u003dNone):"},{"line_number":107,"context_line":"        self.user \u003d user"},{"line_number":108,"context_line":"        self.project \u003d project"},{"line_number":109,"context_line":"        self.start \u003d utils.sanitize_timestamp(start)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAASn%2F%2Fn6U%3D","line":106,"in_reply_to":"AAAASn%2F%2FoWM%3D","updated":"2013-09-02 10:10:16.000000000","message":"Indeed, it\u0027s a leftover from a previous patch set. Thanks for spotting this!","commit_id":"bd24a0628dc8a474172a10a60834c4d309c00f74"}],"ceilometer/storage/impl_mongodb.py":[{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"aedb53a8304ef64262efce49401f95a99cb63ea0","unresolved":false,"context_lines":[{"line_number":277,"context_line":"            /* The watched field might be null for some samples. Skip these"},{"line_number":278,"context_line":"             * ones, assuming the value has not changed."},{"line_number":279,"context_line":"             * A \"null\" value might also indicate we have reached the sentinel,"},{"line_number":280,"context_line":"             * so test for that. */"},{"line_number":281,"context_line":"            if (values[i].watched_field_value \u003d\u003d null \u0026\u0026 i !\u003d (n_samples - 1))"},{"line_number":282,"context_line":"                continue;"},{"line_number":283,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAARn%2F%2F13s%3D","line":280,"updated":"2013-08-21 09:39:09.000000000","message":"If the first sample have watched_field_value \u003d null, it will not skipped.","commit_id":"790f532b64f78002aa92de0990b4a63af390515e"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"aedb53a8304ef64262efce49401f95a99cb63ea0","unresolved":false,"context_lines":[{"line_number":320,"context_line":"                   subres.duration_end \u003d values[i].duration_end;"},{"line_number":321,"context_line":"            }"},{"line_number":322,"context_line":"        }"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"        return res;"},{"line_number":325,"context_line":"    }"},{"line_number":326,"context_line":"    \"\"\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAARn%2F%2F19w%3D","line":323,"updated":"2013-08-21 09:39:09.000000000","message":"What do you think about adding methods for each kind of job to do ? \n\n    new_stat\n    update_stat\n    finalize_stat\n\nAnd removing the sentinel and just doing:\n\n    cur_watched_field \u003d null samples[0].watched_field\n    stat \u003d new_stats(samples[0])\n\n    for (var i \u003d 1; i \u003c samples.length; i++) {\n       if (samples[i].watched_field !\u003d cur_watched_field) {\n           finalize_stat(stat)\n           cur_watched_field \u003d samples[i].watched_field\n           stat \u003d new_stat(samples[i])\n        } else {\n           update_stat(subres, samples[i])\n        }\n    }\n    finalize_stat(stat)\n    return res","commit_id":"790f532b64f78002aa92de0990b4a63af390515e"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"1d9a5e2ea45417e95499b937874997ff98ac99a1","unresolved":false,"context_lines":[{"line_number":346,"context_line":"        if (i \u003d\u003d samples.length)"},{"line_number":347,"context_line":"            return {};"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"        var subres \u003d new_stats(samples[i]);"},{"line_number":350,"context_line":"        i++;"},{"line_number":351,"context_line":"        for (; i \u003c samples.length; i++) {"},{"line_number":352,"context_line":"            var sample \u003d samples[i];"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2Fgak%3D","line":349,"updated":"2013-09-04 00:15:38.000000000","message":"This seems to assume that all samples are presented to this code in order. I don\u0027t think that would be true if the database was sharded (the map-reduce would run on separate servers, and the set of data passed in to reduce on each node would depend on the shard key configuration and number of shards). I also don\u0027t think the samples are necessarily sorted when they are passed here, are they?","commit_id":"72d12364cfb3f951671782a503c05a89ea5a1335"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"9d882b2ce7cbddd613cd55977386d2cbc2403113","unresolved":false,"context_lines":[{"line_number":346,"context_line":"        if (i \u003d\u003d samples.length)"},{"line_number":347,"context_line":"            return {};"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"        var subres \u003d new_stats(samples[i]);"},{"line_number":350,"context_line":"        i++;"},{"line_number":351,"context_line":"        for (; i \u003c samples.length; i++) {"},{"line_number":352,"context_line":"            var sample \u003d samples[i];"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2FeKg%3D","line":349,"in_reply_to":"AAAASn%2F%2Fe%2FA%3D","updated":"2013-09-04 12:39:03.000000000","message":"That would ensure that any given result set is passed to this function in order. It would not ensure that all results are passed in at the same time (sharded systems or large data sets may call reduce more than once).\n\nI don\u0027t see an easy way to do this correctly with map-reduce that scales to a real system. We should find someone who *is* a Mongo expert, and get their help.","commit_id":"72d12364cfb3f951671782a503c05a89ea5a1335"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"4ce1b45026f1241085d50fde56e388b8d0527ace","unresolved":false,"context_lines":[{"line_number":346,"context_line":"        if (i \u003d\u003d samples.length)"},{"line_number":347,"context_line":"            return {};"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"        var subres \u003d new_stats(samples[i]);"},{"line_number":350,"context_line":"        i++;"},{"line_number":351,"context_line":"        for (; i \u003c samples.length; i++) {"},{"line_number":352,"context_line":"            var sample \u003d samples[i];"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2FYIM%3D","line":349,"in_reply_to":"AAAASn%2F%2FeKg%3D","updated":"2013-09-05 13:55:09.000000000","message":"You\u0027re right. I talked to Mehdi about that, and iiuc, one solution would be to:\n\n1) Run a query to gather all samples from the mongo servers\n2) Run the map_reduce operation on this collection\n\nWDYT ?","commit_id":"72d12364cfb3f951671782a503c05a89ea5a1335"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"58b8cfc68df7774376cbf746984b3e9fb58800eb","unresolved":false,"context_lines":[{"line_number":346,"context_line":"        if (i \u003d\u003d samples.length)"},{"line_number":347,"context_line":"            return {};"},{"line_number":348,"context_line":""},{"line_number":349,"context_line":"        var subres \u003d new_stats(samples[i]);"},{"line_number":350,"context_line":"        i++;"},{"line_number":351,"context_line":"        for (; i \u003c samples.length; i++) {"},{"line_number":352,"context_line":"            var sample \u003d samples[i];"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2Fe%2FA%3D","line":349,"in_reply_to":"AAAASn%2F%2Fgak%3D","updated":"2013-09-04 08:48:39.000000000","message":"I\u0027m no MongoDB expert, but you\u0027re probably right. I think adding \"$orderby: { timestamp: 1 }\" would do the trick, WDYT ?","commit_id":"72d12364cfb3f951671782a503c05a89ea5a1335"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"627d39a73f2eb7c183b200cceae478d9ba0d3588","unresolved":false,"context_lines":[{"line_number":793,"context_line":"            yield models.Sample(**s)"},{"line_number":794,"context_line":""},{"line_number":795,"context_line":"    def get_meter_statistics(self, sample_filter, period\u003dNone, groupby\u003dNone,"},{"line_number":796,"context_line":"                             reset_on\u003d\"\"):"},{"line_number":797,"context_line":"        \"\"\"Return an iterable of models.Statistics instance containing meter"},{"line_number":798,"context_line":"        statistics described by the query parameters."},{"line_number":799,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2FjHo%3D","line":796,"updated":"2013-09-03 16:25:39.000000000","message":"why does this default to an empty string and not None?","commit_id":"72d12364cfb3f951671782a503c05a89ea5a1335"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"c323b08852c677a26e4f0eb76b7e161f88bd9d83","unresolved":false,"context_lines":[{"line_number":793,"context_line":"            yield models.Sample(**s)"},{"line_number":794,"context_line":""},{"line_number":795,"context_line":"    def get_meter_statistics(self, sample_filter, period\u003dNone, groupby\u003dNone,"},{"line_number":796,"context_line":"                             reset_on\u003d\"\"):"},{"line_number":797,"context_line":"        \"\"\"Return an iterable of models.Statistics instance containing meter"},{"line_number":798,"context_line":"        statistics described by the query parameters."},{"line_number":799,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2Figo%3D","line":796,"in_reply_to":"AAAASn%2F%2FjHo%3D","updated":"2013-09-03 19:06:47.000000000","message":"Because \u0027reset_on\u0027 is supposed to be a string, but None would do and would be more consistent. I\u0027ll change that.","commit_id":"72d12364cfb3f951671782a503c05a89ea5a1335"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"627d39a73f2eb7c183b200cceae478d9ba0d3588","unresolved":false,"context_lines":[{"line_number":811,"context_line":"            reduce_function \u003d self.REDUCE_STATS_RESET_ON"},{"line_number":812,"context_line":"            watched_field_param \u003d {"},{"line_number":813,"context_line":"                \u0027watched_field_value\u0027: \"this.resource_metadata.%s\" % reset_on"},{"line_number":814,"context_line":"            }"},{"line_number":815,"context_line":"        else:"},{"line_number":816,"context_line":"            reduce_function \u003d self.REDUCE_STATS"},{"line_number":817,"context_line":"            watched_field_param \u003d {\u0027watched_field_value\u0027: \"null\"}"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2FjIw%3D","line":814,"updated":"2013-09-03 16:25:39.000000000","message":"this places priority on reset_on","commit_id":"72d12364cfb3f951671782a503c05a89ea5a1335"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"627d39a73f2eb7c183b200cceae478d9ba0d3588","unresolved":false,"context_lines":[{"line_number":828,"context_line":"                             \u0027period_first\u0027: period_start,"},{"line_number":829,"context_line":"                             \u0027groupby_fields\u0027: json.dumps(groupby)}"},{"line_number":830,"context_line":"            if groupby:"},{"line_number":831,"context_line":"                map_stats \u003d self.MAP_STATS_PERIOD_GROUPBY % params_period"},{"line_number":832,"context_line":"            else:"},{"line_number":833,"context_line":"                map_stats \u003d self.MAP_STATS_PERIOD % \\"},{"line_number":834,"context_line":"                    dict(params_period.items() + watched_field_param.items())"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2FjIo%3D","line":831,"updated":"2013-09-03 16:25:39.000000000","message":"priority on groupby","commit_id":"72d12364cfb3f951671782a503c05a89ea5a1335"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"627d39a73f2eb7c183b200cceae478d9ba0d3588","unresolved":false,"context_lines":[{"line_number":835,"context_line":"        else:"},{"line_number":836,"context_line":"            if groupby:"},{"line_number":837,"context_line":"                params_groupby \u003d {\u0027groupby_fields\u0027: json.dumps(groupby)}"},{"line_number":838,"context_line":"                map_stats \u003d self.MAP_STATS_GROUPBY % params_groupby"},{"line_number":839,"context_line":"            else:"},{"line_number":840,"context_line":"                map_stats \u003d self.MAP_STATS % watched_field_param"},{"line_number":841,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2FjIM%3D","line":838,"updated":"2013-09-03 16:25:39.000000000","message":"priority on groupby","commit_id":"72d12364cfb3f951671782a503c05a89ea5a1335"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"627d39a73f2eb7c183b200cceae478d9ba0d3588","unresolved":false,"context_lines":[{"line_number":870,"context_line":"                    for values in result[\u0027value\u0027].values():"},{"line_number":871,"context_line":"                        if isinstance(values, list):"},{"line_number":872,"context_line":"                            for value in values:"},{"line_number":873,"context_line":"                                stats.append((models.Statistics(**value)))"},{"line_number":874,"context_line":"                else:"},{"line_number":875,"context_line":"                    # The reduction did not happen."},{"line_number":876,"context_line":"                    stats.append((models.Statistics(**(result[\u0027value\u0027]))))"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2FjF4%3D","line":873,"updated":"2013-09-03 16:25:39.000000000","message":"should this be extend rather than append?","commit_id":"72d12364cfb3f951671782a503c05a89ea5a1335"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"c323b08852c677a26e4f0eb76b7e161f88bd9d83","unresolved":false,"context_lines":[{"line_number":870,"context_line":"                    for values in result[\u0027value\u0027].values():"},{"line_number":871,"context_line":"                        if isinstance(values, list):"},{"line_number":872,"context_line":"                            for value in values:"},{"line_number":873,"context_line":"                                stats.append((models.Statistics(**value)))"},{"line_number":874,"context_line":"                else:"},{"line_number":875,"context_line":"                    # The reduction did not happen."},{"line_number":876,"context_line":"                    stats.append((models.Statistics(**(result[\u0027value\u0027]))))"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2Fifw%3D","line":873,"in_reply_to":"AAAASn%2F%2FjF4%3D","updated":"2013-09-03 19:06:47.000000000","message":"I don\u0027t think so.","commit_id":"72d12364cfb3f951671782a503c05a89ea5a1335"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"627d39a73f2eb7c183b200cceae478d9ba0d3588","unresolved":false,"context_lines":[{"line_number":873,"context_line":"                                stats.append((models.Statistics(**value)))"},{"line_number":874,"context_line":"                else:"},{"line_number":875,"context_line":"                    # The reduction did not happen."},{"line_number":876,"context_line":"                    stats.append((models.Statistics(**(result[\u0027value\u0027]))))"},{"line_number":877,"context_line":""},{"line_number":878,"context_line":"        else:"},{"line_number":879,"context_line":"            stats \u003d [models.Statistics(**(r[\u0027value\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2FjF0%3D","line":876,"updated":"2013-09-03 16:25:39.000000000","message":"same as above.","commit_id":"72d12364cfb3f951671782a503c05a89ea5a1335"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"c323b08852c677a26e4f0eb76b7e161f88bd9d83","unresolved":false,"context_lines":[{"line_number":873,"context_line":"                                stats.append((models.Statistics(**value)))"},{"line_number":874,"context_line":"                else:"},{"line_number":875,"context_line":"                    # The reduction did not happen."},{"line_number":876,"context_line":"                    stats.append((models.Statistics(**(result[\u0027value\u0027]))))"},{"line_number":877,"context_line":""},{"line_number":878,"context_line":"        else:"},{"line_number":879,"context_line":"            stats \u003d [models.Statistics(**(r[\u0027value\u0027]))"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAASn%2F%2Fh%2Bs%3D","line":876,"in_reply_to":"AAAASn%2F%2FjF0%3D","updated":"2013-09-03 19:06:47.000000000","message":"I still do not think so. There are extra parentheses though, due to a copy/paste from the original code. Not sure they make the code easier to read here, so I think I\u0027ll remove them in the next patchset.","commit_id":"72d12364cfb3f951671782a503c05a89ea5a1335"}],"tests/storage/test_impl_mongodb.py":[{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"82aa1e5bdf9796b1d96b9fbb15412bc7d1947cfd","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                                                        name\u003d\u0027meter_ttl\u0027))"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"class StatisticsTest(MongoDBEngineTestBase):"},{"line_number":130,"context_line":"    def add_some_samples(self):"},{"line_number":131,"context_line":"        for i in range(5):"},{"line_number":132,"context_line":"            c \u003d sample.Sample("}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASn%2F%2F%2BqM%3D","line":129,"updated":"2013-08-27 09:10:33.000000000","message":"This tests use only external storage API, it must be in test_storage_scenarios.py","commit_id":"6f22c3b7840c97fcd8d469040fb8e0daac97b9f7"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"9a453b6660a4bb12f63d3c707b60a0a271ad1bff","unresolved":false,"context_lines":[{"line_number":126,"context_line":"                                                        name\u003d\u0027meter_ttl\u0027))"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"class StatisticsTest(MongoDBEngineTestBase):"},{"line_number":130,"context_line":"    def add_some_samples(self):"},{"line_number":131,"context_line":"        for i in range(5):"},{"line_number":132,"context_line":"            c \u003d sample.Sample("}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASn%2F%2F8Yg%3D","line":129,"in_reply_to":"AAAASn%2F%2F%2BqM%3D","updated":"2013-08-27 20:47:56.000000000","message":"Done","commit_id":"6f22c3b7840c97fcd8d469040fb8e0daac97b9f7"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"b38ebe9b4115803abf4d03da7c1e6c5330f30813","unresolved":false,"context_lines":[{"line_number":189,"context_line":"        self.assertEqual(res[0].watched_field_value, \u0027bar\u0027)"},{"line_number":190,"context_line":"        # The statistics are sorted by their \u0027period_start\u0027 field. res[1] and"},{"line_number":191,"context_line":"        # res[2] have the same value for this field, so we cannot know in what"},{"line_number":192,"context_line":"        # order they will appear."},{"line_number":193,"context_line":"        self.assertTrue((res[1].watched_field_value \u003d\u003d \u0027bar\u0027 and"},{"line_number":194,"context_line":"                         res[2].watched_field_value \u003d\u003d \u0027baz\u0027) or"},{"line_number":195,"context_line":"                        (res[1].watched_field_value \u003d\u003d \u0027baz\u0027 and"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASn%2F%2F%2Fu0%3D","line":192,"updated":"2013-08-27 02:22:12.000000000","message":"this seems sketchy. anyway to choose a different period that doesn\u0027t cause this?","commit_id":"6f22c3b7840c97fcd8d469040fb8e0daac97b9f7"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"9a453b6660a4bb12f63d3c707b60a0a271ad1bff","unresolved":false,"context_lines":[{"line_number":189,"context_line":"        self.assertEqual(res[0].watched_field_value, \u0027bar\u0027)"},{"line_number":190,"context_line":"        # The statistics are sorted by their \u0027period_start\u0027 field. res[1] and"},{"line_number":191,"context_line":"        # res[2] have the same value for this field, so we cannot know in what"},{"line_number":192,"context_line":"        # order they will appear."},{"line_number":193,"context_line":"        self.assertTrue((res[1].watched_field_value \u003d\u003d \u0027bar\u0027 and"},{"line_number":194,"context_line":"                         res[2].watched_field_value \u003d\u003d \u0027baz\u0027) or"},{"line_number":195,"context_line":"                        (res[1].watched_field_value \u003d\u003d \u0027baz\u0027 and"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASn%2F%2F8E4%3D","line":192,"in_reply_to":"AAAASn%2F%2F%2Fu0%3D","updated":"2013-08-27 20:47:56.000000000","message":"The point of this tests is to use a period that holds samples with both \u0027bar\u0027 and \u0027baz\u0027 values, so I think we should keep this period.","commit_id":"6f22c3b7840c97fcd8d469040fb8e0daac97b9f7"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"b38ebe9b4115803abf4d03da7c1e6c5330f30813","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        sample_filter \u003d storage.SampleFilter("},{"line_number":239,"context_line":"            meter\u003d\u0027instance\u0027,"},{"line_number":240,"context_line":"            metaquery\u003d{},"},{"line_number":241,"context_line":"            reset_on\u003d\u0027foo\u0027"},{"line_number":242,"context_line":"        )"},{"line_number":243,"context_line":"        res \u003d self.conn.get_meter_statistics(sample_filter)"},{"line_number":244,"context_line":"        self.assertEqual(res, [])"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASn%2F%2F%2FuY%3D","line":241,"updated":"2013-08-27 02:22:12.000000000","message":"you probably could\u0027ve just used add_some_samples and chose a reset_on value that wasn\u0027t in metadata rather than copy/paste the above loop.","commit_id":"6f22c3b7840c97fcd8d469040fb8e0daac97b9f7"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"9a453b6660a4bb12f63d3c707b60a0a271ad1bff","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        sample_filter \u003d storage.SampleFilter("},{"line_number":239,"context_line":"            meter\u003d\u0027instance\u0027,"},{"line_number":240,"context_line":"            metaquery\u003d{},"},{"line_number":241,"context_line":"            reset_on\u003d\u0027foo\u0027"},{"line_number":242,"context_line":"        )"},{"line_number":243,"context_line":"        res \u003d self.conn.get_meter_statistics(sample_filter)"},{"line_number":244,"context_line":"        self.assertEqual(res, [])"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASn%2F%2F8YY%3D","line":241,"in_reply_to":"AAAASn%2F%2F%2FuY%3D","updated":"2013-08-27 20:47:56.000000000","message":"Done","commit_id":"6f22c3b7840c97fcd8d469040fb8e0daac97b9f7"}],"tests/storage/test_storage_scenarios.py":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d440640a3129a5cc7d08ee23072c78de6104ce86","unresolved":false,"context_lines":[{"line_number":1413,"context_line":"class StatisticsResetOn(DBTestBase,"},{"line_number":1414,"context_line":"                        tests_db.MixinTestsWithBackendScenarios):"},{"line_number":1415,"context_line":""},{"line_number":1416,"context_line":"    def prepare_data(self):"},{"line_number":1417,"context_line":"        # We do not need any samples to be added automatically. Let\u0027s just do"},{"line_number":1418,"context_line":"        # nothing here."},{"line_number":1419,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F7c8%3D","line":1416,"updated":"2013-08-27 21:35:18.000000000","message":"do we need \u0027timeutils.utcnow.override_time \u003d None\u0027 in teardown? just inherit tests_db.TestBase instead of DBTestBase if we don\u0027t need anything from DBTestBase","commit_id":"0819234d83f7faaaf95ab1e103ff150319b64e6e"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"5e53a8bdd6d182e4d4bea267717c6c6b392f5eab","unresolved":false,"context_lines":[{"line_number":1413,"context_line":"class StatisticsResetOn(DBTestBase,"},{"line_number":1414,"context_line":"                        tests_db.MixinTestsWithBackendScenarios):"},{"line_number":1415,"context_line":""},{"line_number":1416,"context_line":"    def prepare_data(self):"},{"line_number":1417,"context_line":"        # We do not need any samples to be added automatically. Let\u0027s just do"},{"line_number":1418,"context_line":"        # nothing here."},{"line_number":1419,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F7KE%3D","line":1416,"in_reply_to":"AAAASn%2F%2F7c8%3D","updated":"2013-08-27 23:58:03.000000000","message":"Done","commit_id":"0819234d83f7faaaf95ab1e103ff150319b64e6e"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d440640a3129a5cc7d08ee23072c78de6104ce86","unresolved":false,"context_lines":[{"line_number":1484,"context_line":"        self.assertTrue((res[1].watched_field_value \u003d\u003d \u0027bar\u0027 and"},{"line_number":1485,"context_line":"                         res[2].watched_field_value \u003d\u003d \u0027baz\u0027) or"},{"line_number":1486,"context_line":"                        (res[1].watched_field_value \u003d\u003d \u0027baz\u0027 and"},{"line_number":1487,"context_line":"                         res[2].watched_field_value \u003d\u003d \u0027bar\u0027))"},{"line_number":1488,"context_line":"        self.assertEqual(res[3].watched_field_value, \u0027baz\u0027)"},{"line_number":1489,"context_line":""},{"line_number":1490,"context_line":"    def test_get_meter_statistics_no_values(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F7Zw%3D","line":1487,"updated":"2013-08-27 21:35:18.000000000","message":"so i finally understand why it may be one or the other. for me the assertion isn\u0027t particularly useful, seems like its pretty much just checking that result[1] and result[2] have different watched_field_value? maybe just make that what we check for?","commit_id":"0819234d83f7faaaf95ab1e103ff150319b64e6e"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"5e53a8bdd6d182e4d4bea267717c6c6b392f5eab","unresolved":false,"context_lines":[{"line_number":1484,"context_line":"        self.assertTrue((res[1].watched_field_value \u003d\u003d \u0027bar\u0027 and"},{"line_number":1485,"context_line":"                         res[2].watched_field_value \u003d\u003d \u0027baz\u0027) or"},{"line_number":1486,"context_line":"                        (res[1].watched_field_value \u003d\u003d \u0027baz\u0027 and"},{"line_number":1487,"context_line":"                         res[2].watched_field_value \u003d\u003d \u0027bar\u0027))"},{"line_number":1488,"context_line":"        self.assertEqual(res[3].watched_field_value, \u0027baz\u0027)"},{"line_number":1489,"context_line":""},{"line_number":1490,"context_line":"    def test_get_meter_statistics_no_values(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F7Es%3D","line":1487,"in_reply_to":"AAAASn%2F%2F7Zw%3D","updated":"2013-08-27 23:58:03.000000000","message":"They need to be different, and they need to be right. They could be different but have garbage values, which would not be good. I\u0027d be in favor of keeping the test this way.","commit_id":"0819234d83f7faaaf95ab1e103ff150319b64e6e"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"2cb16ad5c0ba593d70ae992a18e196a3f64f1017","unresolved":false,"context_lines":[{"line_number":1411,"context_line":""},{"line_number":1412,"context_line":""},{"line_number":1413,"context_line":"class StatisticsResetOn(tests_db.TestBase,"},{"line_number":1414,"context_line":"                        tests_db.MixinTestsWithBackendScenarios):"},{"line_number":1415,"context_line":"    def add_some_samples(self):"},{"line_number":1416,"context_line":"        for i in range(5):"},{"line_number":1417,"context_line":"            c \u003d sample.Sample("}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAASn%2F%2F5r0%3D","line":1414,"updated":"2013-08-28 07:50:55.000000000","message":"All tests needs to verify that the compute statistics are the expected one too (max/min/avg/...).","commit_id":"7a6df811c7b4cca04687e36dd381c02a5801d48a"}]}
