Uploaded image for project: 'Metron'
  1. Metron
  2. METRON-2195

Add defensive log level checks when constructing logs is expensive

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Done
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: Next + 1
    • Labels:
      None

      Description

      There are instances where we log, and output strings for json objects and other things that are quite expensive.

      These are done regardless of the log level being enabled and can increase performance significantly:

      https://gist.github.com/mmiklavc/7fd6af13bfa0ca05d9b3f4e7806c8d77
      https://github.com/apache/metron/blob/master/metron-platform/metron-writer/metron-writer-storm/src/main/java/org/apache/metron/writer/hdfs/HdfsWriter.java#L127

      We need to find places where this happens, and employ the best practice check for the log level being enabled ( best practice if your parameters or log message construction takes a lot of time ).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tigerquoll Dale Richardson
                Reporter:
                otto Otto Fowler
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2.5h
                  2.5h