Class HprofData


  • public final class HprofData
    extends Object
    Represents sampling profiler data. Can be converted to ASCII or binary hprof-style output using AsciiHprofWriter or BinaryHprofWriter.

    The data includes:

    • the start time of the last sampling period
    • the history of thread start and end events
    • stack traces with frequency counts
      • Method Detail

        • getStartMillis

          public long getStartMillis()
          The start time in milliseconds of the last profiling period.
        • setStartMillis

          public void setStartMillis​(long startMillis)
          Set the time for the start of the current sampling period.
        • getDepth

          public int getDepth()
          Get the stack sampling depth
        • setDepth

          public void setDepth​(int depth)
          Set the stack sampling depth
        • getThreadHistory

          public List<HprofData.ThreadEvent> getThreadHistory()
          Return an unmodifiable history of start and end thread events.
        • getSamples

          public Set<HprofData.Sample> getSamples()
          Return a new set containing the current sample data.
        • addThreadEvent

          public void addThreadEvent​(HprofData.ThreadEvent event)
          Record an event in the thread history.
        • addStackTrace

          public void addStackTrace​(HprofData.StackTrace stackTrace,
                                    int[] countCell)
          Record an stack trace and an associated int[] cell of sample cound for the stack trace. The caller is allowed retain a pointer to the cell to update the count. The SamplingProfiler intentionally does not present a mutable view of the count.