)]}'
{"thresh/src/main/java/monasca/thresh/infrastructure/thresholding/MetricAggregationBolt.java":[{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"814fdba9649a3ca099536b863e587a6e4c9dee5e","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    final List\u003cMetricDefinitionAndTenantId\u003e toRemove \u003d new ArrayList\u003c\u003e();"},{"line_number":234,"context_line":"    for (Map.Entry\u003cMetricDefinitionAndTenantId, Metric\u003e entry: savedMetrics.entrySet()) {"},{"line_number":235,"context_line":"      long now \u003d currentTimeSeconds();"},{"line_number":236,"context_line":"      final long age \u003d entry.getValue().getTimestamp() / 1000 - now;"},{"line_number":237,"context_line":"      if (age \u003e MAX_SAVED_METRIC_AGE) {"},{"line_number":238,"context_line":"        toRemove.add(entry.getKey());"},{"line_number":239,"context_line":"      }"}],"source_content_type":"text/x-java","patch_set":1,"id":"5a9d85d2_6e5fcb41","line":236,"range":{"start_line":236,"start_character":57,"end_line":236,"end_character":61},"updated":"2016-06-21 03:57:35.000000000","message":"Couldn\u0027t we take this operation\n  \n timestamp / 1000\n\ninto specific method, this operation seems to be repeated in at least two places (according to changed lines of code). Perhaps there\u0027s more. Maybe something like\n\n timestampToSeconds(int timestamp) {}\n\nwhat do you think ?","commit_id":"803c4d56499a4e36705f48e6bfcfbd41d08ec083"},{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"c5dd93819b72db813ff136037982b234d104b7d9","unresolved":false,"context_lines":[{"line_number":331,"context_line":"    logger.info(\"Received AlarmCreatedEvent for {}\", subAlarm);"},{"line_number":332,"context_line":"    final SubAlarmStats newStats \u003d addSubAlarm(metricDefinitionAndTenantId, subAlarm);"},{"line_number":333,"context_line":"    // See if we have a saved metric for this SubAlarm. Add to the SubAlarm if we do."},{"line_number":334,"context_line":"    // Because the Metric comes directly from the MetricFilterinBolt but the"},{"line_number":335,"context_line":"    // SubAlarm comes from the AlarmCreationBolt, it is very likely that the"},{"line_number":336,"context_line":"    // Metric arrives first"},{"line_number":337,"context_line":"    final Metric metric \u003d savedMetrics.get(metricDefinitionAndTenantId);"}],"source_content_type":"text/x-java","patch_set":4,"id":"3aaa91ec_ab55ec50","line":334,"range":{"start_line":334,"start_character":50,"end_line":334,"end_character":68},"updated":"2016-06-23 15:06:54.000000000","message":"MetricFilteringBolt","commit_id":"98c3e31a85b110ea2e3376db3c023f8831651566"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"669108329d782d95f200daf207ff7a43f599a207","unresolved":false,"context_lines":[{"line_number":236,"context_line":"   * Clean saved metrics since the SubAlarm should show up within seconds of"},{"line_number":237,"context_line":"   * the metric being received"},{"line_number":238,"context_line":"   */"},{"line_number":239,"context_line":"  private void cleanSavedMetrics() {"},{"line_number":240,"context_line":"    if (savedMetrics.isEmpty()) {"},{"line_number":241,"context_line":"      return;"},{"line_number":242,"context_line":"    }"}],"source_content_type":"text/x-java","patch_set":5,"id":"3aaa91ec_9b30be57","line":239,"range":{"start_line":239,"start_character":15,"end_line":239,"end_character":32},"updated":"2016-06-27 11:35:53.000000000","message":"Could you add debug statement here informing how many saved metrics will be cleaned during execution of this method ?","commit_id":"0cc32bc6b9bd5218e06f90a7ca0793a95d29e0a8"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"33b9ab88c7f8e5fe950d4a5492a5935e4505eafd","unresolved":false,"context_lines":[{"line_number":236,"context_line":"   * Clean saved metrics since the SubAlarm should show up within seconds of"},{"line_number":237,"context_line":"   * the metric being received"},{"line_number":238,"context_line":"   */"},{"line_number":239,"context_line":"  private void cleanSavedMetrics() {"},{"line_number":240,"context_line":"    if (savedMetrics.isEmpty()) {"},{"line_number":241,"context_line":"      return;"},{"line_number":242,"context_line":"    }"}],"source_content_type":"text/x-java","patch_set":5,"id":"3aaa91ec_69542221","line":239,"range":{"start_line":239,"start_character":15,"end_line":239,"end_character":32},"in_reply_to":"3aaa91ec_9b30be57","updated":"2016-06-27 14:41:19.000000000","message":"Good idea. Can\u0027t have too much debug logging. Done","commit_id":"0cc32bc6b9bd5218e06f90a7ca0793a95d29e0a8"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"669108329d782d95f200daf207ff7a43f599a207","unresolved":false,"context_lines":[{"line_number":259,"context_line":"  private boolean savedMetricTooOld(final Metric metric) {"},{"line_number":260,"context_line":"    final long now \u003d currentTimeSeconds();"},{"line_number":261,"context_line":"    final long age \u003d metricTimestampInSeconds(metric) - now;"},{"line_number":262,"context_line":"    return age \u003e MAX_SAVED_METRIC_AGE;"},{"line_number":263,"context_line":"  }"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"  private void sendSubAlarmStateChange(SubAlarmStats subAlarmStats) {"}],"source_content_type":"text/x-java","patch_set":5,"id":"3aaa91ec_dbb526ed","line":262,"range":{"start_line":262,"start_character":17,"end_line":262,"end_character":37},"updated":"2016-06-27 11:35:53.000000000","message":"So effectively it means that if we did not receive metric for 10 seconds measurements are lost ? If that\u0027s a correct assumption, could you rename variable to something like\n\n  MAX_SAVED_METRIC_AGE_SECONDS","commit_id":"0cc32bc6b9bd5218e06f90a7ca0793a95d29e0a8"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"33b9ab88c7f8e5fe950d4a5492a5935e4505eafd","unresolved":false,"context_lines":[{"line_number":259,"context_line":"  private boolean savedMetricTooOld(final Metric metric) {"},{"line_number":260,"context_line":"    final long now \u003d currentTimeSeconds();"},{"line_number":261,"context_line":"    final long age \u003d metricTimestampInSeconds(metric) - now;"},{"line_number":262,"context_line":"    return age \u003e MAX_SAVED_METRIC_AGE;"},{"line_number":263,"context_line":"  }"},{"line_number":264,"context_line":""},{"line_number":265,"context_line":"  private void sendSubAlarmStateChange(SubAlarmStats subAlarmStats) {"}],"source_content_type":"text/x-java","patch_set":5,"id":"3aaa91ec_29217ab5","line":262,"range":{"start_line":262,"start_character":17,"end_line":262,"end_character":37},"in_reply_to":"3aaa91ec_dbb526ed","updated":"2016-06-27 14:41:19.000000000","message":"Yes, that assumption is correct. Done","commit_id":"0cc32bc6b9bd5218e06f90a7ca0793a95d29e0a8"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"543d164fd36e1e94acd4791bfdef36fa7aae93cb","unresolved":false,"context_lines":[{"line_number":83,"context_line":"  private transient Logger logger;"},{"line_number":84,"context_line":"  private OutputCollector collector;"},{"line_number":85,"context_line":"  private boolean upToDate \u003d true;"},{"line_number":86,"context_line":"  private Map\u003cMetricDefinitionAndTenantId, Metric\u003e savedMetrics \u003d new HashMap\u003c\u003e();"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"  public MetricAggregationBolt(ThresholdingConfiguration config) {"},{"line_number":89,"context_line":"    this.config \u003d config;"}],"source_content_type":"text/x-java","patch_set":6,"id":"3aaa91ec_6b622fda","line":86,"range":{"start_line":86,"start_character":51,"end_line":86,"end_character":63},"updated":"2016-06-28 07:43:32.000000000","message":"I am looking at this name and I don\u0027t feel like savedMetrics is correct one. After all you are not persisting them here, only temporarily store.\n\nPerhaps we could use stashedMetrics as a name, what do you think ?","commit_id":"3927da16971dbdeec78f4d203f0de035083906cd"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"819a306174eaac250a68eb499d27347cbb7b887b","unresolved":false,"context_lines":[{"line_number":83,"context_line":"  private transient Logger logger;"},{"line_number":84,"context_line":"  private OutputCollector collector;"},{"line_number":85,"context_line":"  private boolean upToDate \u003d true;"},{"line_number":86,"context_line":"  private Map\u003cMetricDefinitionAndTenantId, Metric\u003e savedMetrics \u003d new HashMap\u003c\u003e();"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"  public MetricAggregationBolt(ThresholdingConfiguration config) {"},{"line_number":89,"context_line":"    this.config \u003d config;"}],"source_content_type":"text/x-java","patch_set":6,"id":"3aaa91ec_9f3fbc24","line":86,"range":{"start_line":86,"start_character":51,"end_line":86,"end_character":63},"in_reply_to":"3aaa91ec_6b622fda","updated":"2016-06-28 14:44:06.000000000","message":"I don\u0027t see any real difference between saved and stashed. They are really synonyms","commit_id":"3927da16971dbdeec78f4d203f0de035083906cd"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"370dd412a1750a6e12a7b6c87c05f7f21cbab1a0","unresolved":false,"context_lines":[{"line_number":83,"context_line":"  private transient Logger logger;"},{"line_number":84,"context_line":"  private OutputCollector collector;"},{"line_number":85,"context_line":"  private boolean upToDate \u003d true;"},{"line_number":86,"context_line":"  private Map\u003cMetricDefinitionAndTenantId, Metric\u003e savedMetrics \u003d new HashMap\u003c\u003e();"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"  public MetricAggregationBolt(ThresholdingConfiguration config) {"},{"line_number":89,"context_line":"    this.config \u003d config;"}],"source_content_type":"text/x-java","patch_set":6,"id":"3aaa91ec_b1b736f4","line":86,"range":{"start_line":86,"start_character":51,"end_line":86,"end_character":63},"in_reply_to":"3aaa91ec_9f3fbc24","updated":"2016-06-28 22:16:31.000000000","message":"I am not native english speaker, sometimes I get caught up in things like that. I am fine with the name :)","commit_id":"3927da16971dbdeec78f4d203f0de035083906cd"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"543d164fd36e1e94acd4791bfdef36fa7aae93cb","unresolved":false,"context_lines":[{"line_number":191,"context_line":"          sendSubAlarmStateChange(stats);"},{"line_number":192,"context_line":"        }"},{"line_number":193,"context_line":"      } else {"},{"line_number":194,"context_line":"        logger.warn(\"Metric is too old, age {} seconds: timestamp {} for {}, {}\","},{"line_number":195,"context_line":"            currentTimeSeconds() - timestamp_secs, timestamp_secs, metricDefinitionAndTenantId,"},{"line_number":196,"context_line":"            stats.getStats());"},{"line_number":197,"context_line":"      }"}],"source_content_type":"text/x-java","patch_set":6,"id":"3aaa91ec_ab36d7b1","line":194,"range":{"start_line":194,"start_character":15,"end_line":194,"end_character":19},"updated":"2016-06-28 07:43:32.000000000","message":"That line keeps me wonder, why do we need new method to actually clean stashed metric, couldn\u0027t we rely on this code here ?","commit_id":"3927da16971dbdeec78f4d203f0de035083906cd"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"819a306174eaac250a68eb499d27347cbb7b887b","unresolved":false,"context_lines":[{"line_number":191,"context_line":"          sendSubAlarmStateChange(stats);"},{"line_number":192,"context_line":"        }"},{"line_number":193,"context_line":"      } else {"},{"line_number":194,"context_line":"        logger.warn(\"Metric is too old, age {} seconds: timestamp {} for {}, {}\","},{"line_number":195,"context_line":"            currentTimeSeconds() - timestamp_secs, timestamp_secs, metricDefinitionAndTenantId,"},{"line_number":196,"context_line":"            stats.getStats());"},{"line_number":197,"context_line":"      }"}],"source_content_type":"text/x-java","patch_set":6,"id":"3aaa91ec_1f60ec34","line":194,"range":{"start_line":194,"start_character":15,"end_line":194,"end_character":19},"in_reply_to":"3aaa91ec_ab36d7b1","updated":"2016-06-28 14:44:06.000000000","message":"Only if the SubAlarm does show up. If it doesn\u0027t, then the saved metric would never be deleted","commit_id":"3927da16971dbdeec78f4d203f0de035083906cd"},{"author":{"_account_id":16168,"name":"Tomasz Trębski","email":"kornicameister@gmail.com","username":"trebskit"},"change_message_id":"543d164fd36e1e94acd4791bfdef36fa7aae93cb","unresolved":false,"context_lines":[{"line_number":257,"context_line":"   * @param Metric to check"},{"line_number":258,"context_line":"   * @return true if saved Metric is too old, false otherwise"},{"line_number":259,"context_line":"   */"},{"line_number":260,"context_line":"  private boolean savedMetricTooOld(final Metric metric) {"},{"line_number":261,"context_line":"    final long now \u003d currentTimeSeconds();"},{"line_number":262,"context_line":"    final long age \u003d metricTimestampInSeconds(metric) - now;"},{"line_number":263,"context_line":"    return age \u003e MAX_SAVED_METRIC_AGE_SECONDS;"}],"source_content_type":"text/x-java","patch_set":6,"id":"3aaa91ec_ab81b74f","line":260,"updated":"2016-06-28 07:43:32.000000000","message":"Should be\n\n  isSavedMetricTooOld\n\nor \n\n isStashedMetricTooOld\n\nif we change the name of variable.","commit_id":"3927da16971dbdeec78f4d203f0de035083906cd"},{"author":{"_account_id":11809,"name":"Craig Bryant","email":"craig.bryant@hpe.com","username":"craig-bryant"},"change_message_id":"819a306174eaac250a68eb499d27347cbb7b887b","unresolved":false,"context_lines":[{"line_number":257,"context_line":"   * @param Metric to check"},{"line_number":258,"context_line":"   * @return true if saved Metric is too old, false otherwise"},{"line_number":259,"context_line":"   */"},{"line_number":260,"context_line":"  private boolean savedMetricTooOld(final Metric metric) {"},{"line_number":261,"context_line":"    final long now \u003d currentTimeSeconds();"},{"line_number":262,"context_line":"    final long age \u003d metricTimestampInSeconds(metric) - now;"},{"line_number":263,"context_line":"    return age \u003e MAX_SAVED_METRIC_AGE_SECONDS;"}],"source_content_type":"text/x-java","patch_set":6,"id":"3aaa91ec_dfe5c4a8","line":260,"in_reply_to":"3aaa91ec_ab81b74f","updated":"2016-06-28 14:44:06.000000000","message":"See above","commit_id":"3927da16971dbdeec78f4d203f0de035083906cd"},{"author":{"_account_id":16222,"name":"witek","email":"witold.bedyk@suse.com","username":"witek"},"change_message_id":"b21e189aa30b1465146fe3abef613f6a7dca0068","unresolved":false,"context_lines":[{"line_number":257,"context_line":"   * @param Metric to check"},{"line_number":258,"context_line":"   * @return true if saved Metric is too old, false otherwise"},{"line_number":259,"context_line":"   */"},{"line_number":260,"context_line":"  private boolean savedMetricTooOld(final Metric metric) {"},{"line_number":261,"context_line":"    final long now \u003d currentTimeSeconds();"},{"line_number":262,"context_line":"    final long age \u003d metricTimestampInSeconds(metric) - now;"},{"line_number":263,"context_line":"    return age \u003e MAX_SAVED_METRIC_AGE_SECONDS;"}],"source_content_type":"text/x-java","patch_set":6,"id":"3aaa91ec_9f114755","line":260,"in_reply_to":"3aaa91ec_dfe5c4a8","updated":"2016-06-29 12:26:02.000000000","message":"I think Tomasz meant primarily the \u0027is\u0027 prefix because the method returns boolean value. Also for me is\n\n isSavedMetricTooOld\n\nbetter.","commit_id":"3927da16971dbdeec78f4d203f0de035083906cd"}]}
