Class RenderingStats


  • public class RenderingStats
    extends java.lang.Object
    Exposes methods to time the various steps in the rendering process and provides a stats report. Every time the render method is invoked a new RenderingStats object is created that can then be accessed by the current RenderingStrategy to notify start/end times of memory allocation, IO, and rendering time.
    Since:
    OME2.2
    • Constructor Summary

      Constructors 
      Constructor Description
      RenderingStats​(Renderer context, omeis.providers.re.data.PlaneDef plane)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void endIO​(int c)
      Notifies the end of pixels data retrieval for the specified wavelength (channel).
      void endMalloc()
      Notifies the end of the allocation of an RGB memory buffers for the rendering process.
      void endRendering()
      Notifies the end of the trasnformation of the raw pixels data.
      java.lang.String getStats()
      Returns a stats report ready to be written to the log file.
      void startIO​(int c)
      Notifies the start of pixels data retrieval for the specified wavelength (channel).
      void startMalloc()
      Notifies the start of the allocation of an RGB memory buffer for the rendering process.
      void startRendering()
      Notifies the start of the trasnformation of the raw pixels data.
      void stop()
      Notifies this object that the rendering process has finished.
      • Methods inherited from class java.lang.Object

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

      • RenderingStats

        public RenderingStats​(Renderer context,
                              omeis.providers.re.data.PlaneDef plane)
        Creates a new instance. This constructor takes the current time, which is then used to calculate the total time the render method took to execute. The Renderer takes care of creating this object right before the rendering process starts and then calls the stop method just after the rendering process ends.
        Parameters:
        context - The object whose render method is being timed. Assumed not to be null.
        plane - Defines the plane that the render is processing. Assumed not to be null.
    • Method Detail

      • startMalloc

        public void startMalloc()
        Notifies the start of the allocation of an RGB memory buffer for the rendering process.
        See Also:
        endMalloc()
      • endMalloc

        public void endMalloc()
        Notifies the end of the allocation of an RGB memory buffers for the rendering process.
        See Also:
        startMalloc()
      • startIO

        public void startIO​(int c)
        Notifies the start of pixels data retrieval for the specified wavelength (channel).
        Parameters:
        c - The wavelength (channel) index.
        See Also:
        endIO(int)
      • endIO

        public void endIO​(int c)
        Notifies the end of pixels data retrieval for the specified wavelength (channel).
        Parameters:
        c - The wavelength (channel) index.
        See Also:
        startIO(int)
      • startRendering

        public void startRendering()
        Notifies the start of the trasnformation of the raw pixels data.
        See Also:
        endRendering()
      • endRendering

        public void endRendering()
        Notifies the end of the trasnformation of the raw pixels data.
        See Also:
        startRendering()
      • stop

        public void stop()
        Notifies this object that the rendering process has finished. The total rendering time is computed. That is, the time the render method took to execute. The getStats method can now be invoked to retrieve the stats report.
      • getStats

        public java.lang.String getStats()
        Returns a stats report ready to be written to the log file. The report includes memory allocation, IO, and rendering times as well as a summary of the rendering context in which the call to the render method took place. This method only provides a meaningful report if it is called after the stop method.
        Returns:
        A log message embedding the stats report.