Record Class CompilationProfile

java.lang.Object
java.lang.Record
io.micronaut.python.compiler.CompilationProfile
Record Components:
attributes - The attributes of the compilation: the JVM, the target directory, the number of compilations of this JVM, ...
phases - The phases in the order they started, with their total inclusive time and invocations
counters - The counters, by name
artifacts - The inventory of the output directory by kind, when the compilation wrote to disk

@Internal public record CompilationProfile(Map<String,String> attributes, List<CompilationProfile.Phase> phases, Map<String,Long> counters, List<CompilationProfile.Artifact> artifacts) extends Record
The profile of one Python compilation: how long each phase of the compiler took, what it counted on the way, and the inventory of what it wrote. Collected only when profiling is enabled (see PyronautCompiler.Builder.profileReportFile(java.io.File)), and rendered as one block of key=value lines, so that a report file holding several compilations can be compared between revisions without a parser.
Since:
5.3.0
  • Constructor Details

  • Method Details

    • phase

      public CompilationProfile.Phase phase(String name)
      The phase of the given name.
      Parameters:
      name - The name
      Returns:
      The phase, or null when it did not run
    • artifact

      public CompilationProfile.Artifact artifact(String kind)
      The inventory of the given kind.
      Parameters:
      kind - The kind
      Returns:
      The artifact, or null when nothing of the kind was written
    • render

      public String render()
      Renders the profile as a block of key=value lines, one compilation per block: the attributes, then phase.<name>.ms (and phase.<name>.count when a phase ran more than once) per phase in start order, then counter.<name> and artifact.<kind>.count / artifact.<kind>.bytes.
      Returns:
      The rendered profile
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • attributes

      public Map<String,String> attributes()
      Returns the value of the attributes record component.
      Returns:
      the value of the attributes record component
    • phases

      public List<CompilationProfile.Phase> phases()
      Returns the value of the phases record component.
      Returns:
      the value of the phases record component
    • counters

      public Map<String,Long> counters()
      Returns the value of the counters record component.
      Returns:
      the value of the counters record component
    • artifacts

      public List<CompilationProfile.Artifact> artifacts()
      Returns the value of the artifacts record component.
      Returns:
      the value of the artifacts record component