DespikerSender

Sends profiling data recorded by one or more profilers to the Desiker profiler.

<a href="https://github.com/kiith-sa/despiker">Despiker</a> is a real-time graphical profiler based on Tharsis.prof. It visualizes zones in frames while the game is running and allows the user to move between frames and automatically find the worst frame. Note that at the moment, Despiker is extremely experimental and unstable.

See <a href="http://defenestrate.eu/docs/despiker/index.html">Despiker documentation</a> for more info.

Constructors

this
this(Profiler[] profilers)

Construct a DespikerSender sending data recorded by specified profilers.

Public Imports

std.stdio
public import std.stdio;

Members

Functions

frameFilter
void frameFilter(DespikerFrameFilter rhs)

Set the filter to used by Despiker to determine which zones are frames.

reset
void reset()

Resets the sender.

sending
bool sending()

Is there a Despiker instance (that we are sending to) running at the moment?

startDespiker
void startDespiker(string defaultPath)

Open a Despiker window and start sending profiling data to it.

update
void update()

Update the sender.

Manifest constants

maxProfilers
enum maxProfilers;

Maximum number of profilers we can send data from.

Examples

// Profiler profiler - construct it somewhere first

auto sender = new DespikerSender([profiler]);

for(;;)
{
    // Despiker will consider code in this zone (named "frame") a part of a single frame.
    // Which zone is considered a frame can be changed by setting the 
    // sender.frameFilter property.
    auto frame = Zone(profiler, "frame");

    ... frame code here, with more zones ...

    if(... condition to start Despiker ...)
    {
        // Looks in the current directory, directory with the binary/exe and in PATH
        // use sender.startDespiker("path/to/despiker") to specify explicit path
        sender.startDespiker();
    }

    // No zones must be in progress while sender is being updated, so we end the frame
    // early by destroying it.
    destroy(frame);

    // Update the sender, send profiling data to Despiker if it is running
    sender.update();
}

Meta