Safe Haskell | None |
---|
This module provides some half-ready solutions to visualise heap profiles both during and after execution with the help of OpenGL. All the rendering functions will fill the viewport if the model view matrix is the identity (they also change the matrix), assuming the projection matrix is the following:
matrixMode $= Projection loadIdentity translate $ Vector3 (-1) (-1) 0 scale 2 2 1
In other words, these functions fill the unit square at the origin.
- colours :: [Color3 GLubyte]
- backgroundColour :: Color3 GLubyte
- otherColour :: Color3 GLubyte
- data SamplePair = SP {
- spTime1 :: !Time
- spTime2 :: !Time
- spData1 :: !ProfileSample
- spData2 :: !ProfileSample
- prepareSamples :: ProfileQuery p => p -> [SamplePair]
- renderSamples :: GraphMode -> [SamplePair] -> Time -> IO ()
- addSample :: [SamplePair] -> (Time, ProfileSample) -> [SamplePair]
- data GraphData
- graphNames :: GraphData -> IntMap String
- emptyGraph :: GraphData
- growGraph :: GraphData -> SinkInput -> IO GraphData
- renderGraph :: GraphMode -> GraphData -> IO ()
- data GraphMode
- = Accumulated
- | Separate
- nextGraphMode :: GraphMode -> GraphMode
Documentation
colours :: [Color3 GLubyte]Source
A list of highly different colours, where the differences diminish as we advance in the list. The first element is black, and there is no white.
backgroundColour :: Color3 GLubyteSource
The colour of the background (white). It is not a member of
colours
.
otherColour :: Color3 GLubyteSource
The colour used for unimportant cost centres (black). It is the
first element of colours
.
Processing raw samples (full profiles)
data SamplePair Source
Two heap profile samples which contain the exact same cost centres in the exact same order.
SP | |
|
prepareSamples :: ProfileQuery p => p -> [SamplePair]Source
Create a list of sample pairs where each cost centre is paired up
with the consecutive one, so it is easier to render them. Cost
centres with small costs (below costLimit
) are lumped together under
identifier 0, reserved for "Other".
renderSamples :: GraphMode -> [SamplePair] -> Time -> IO ()Source
Render a given list of prepared samples in the given mode. The third argument is the maximum time of the graph, which affects horizontal scaling.
addSample :: [SamplePair] -> (Time, ProfileSample) -> [SamplePair]Source
Integrating a new sample into the list of merged sample pairs we have so far. The input list should start with the latest sample, and the new sample pair will be the head of the result.
Processing optimised renders (profile streams)
An optimised graph rendering designed to be easily updated when a new sample arrives.
graphNames :: GraphData -> IntMap StringSource
The names of cost centres in a graph rendering.
An empty rendering.
growGraph :: GraphData -> SinkInput -> IO GraphDataSource
Integrate a new sample in an extensible graph.
renderGraph :: GraphMode -> GraphData -> IO ()Source
Render a stream in the given graph mode.
The possible ways of displaying heap profiles.
Accumulated | Cost centres are stacked on top of each other without overlapping. |
Separate | Each cost centre yields a separate line graph on the same scale. |
nextGraphMode :: GraphMode -> GraphModeSource
A cyclic successor function for graph modes.