Class ReportDecoder


  • public final class ReportDecoder
    extends java.lang.Object
    Class that helps to decode reports received from JS binaries that have been instrumented. Report is usually a map of String => Long. Where key is encoded instrumentation point and value is number of times that code was executed. To decode report beside report itself we need mapping file that was produced when JS binary was compiled.

    Expected usage: Map<String, InstrumentationPoint> mapping = ReportDecoder.parseMappingFromFile("mapping.txt"); Map<String, Long> encodedReport = readFile("report.txt"); ReportProfile report = ReportDecoder.decodeReport(mapping, encodedReport);

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.google.javascript.jscomp.instrumentation.reporter.proto.ReportProfile decodeReport​(java.util.Map<java.lang.String,​com.google.javascript.jscomp.instrumentation.reporter.proto.InstrumentationPoint> mapping, java.util.Map<java.lang.String,​java.lang.Long> frequencies)  
      static java.util.Map<java.lang.String,​com.google.javascript.jscomp.instrumentation.reporter.proto.InstrumentationPoint> parseMapping​(java.lang.String mappingFileContent)
      Parses the file found at location mappingFilePath and populates the properties of this class
      static java.util.Map<java.lang.String,​com.google.javascript.jscomp.instrumentation.reporter.proto.InstrumentationPoint> parseMappingFromFile​(java.lang.String mappingFilePath)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • parseMappingFromFile

        public static java.util.Map<java.lang.String,​com.google.javascript.jscomp.instrumentation.reporter.proto.InstrumentationPoint> parseMappingFromFile​(java.lang.String mappingFilePath)
                                                                                                                                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • parseMapping

        public static java.util.Map<java.lang.String,​com.google.javascript.jscomp.instrumentation.reporter.proto.InstrumentationPoint> parseMapping​(java.lang.String mappingFileContent)
        Parses the file found at location mappingFilePath and populates the properties of this class
      • decodeReport

        public static com.google.javascript.jscomp.instrumentation.reporter.proto.ReportProfile decodeReport​(java.util.Map<java.lang.String,​com.google.javascript.jscomp.instrumentation.reporter.proto.InstrumentationPoint> mapping,
                                                                                                             java.util.Map<java.lang.String,​java.lang.Long> frequencies)