panda3d.core.PStatThread

from panda3d.core import PStatThread
class PStatThread

A lightweight class that represents a single thread of execution to PStats. It corresponds one-to-one with Panda’s Thread instance.

Inheritance diagram

Inheritance diagram of PStatThread

__init__(client: PStatClient, index: int) → None

Normally, this constructor is called only from PStatClient. Use one of the constructors below to create your own Thread.

__init__(copy: PStatThread) → None
__init__(thread: Thread, client: PStatClient) → None

Creates a new named thread. This will be used to unify tasks that share a common thread, and differentiate tasks that occur in different threads.

assign(copy: PStatThread) → PStatThread
Return type

PStatThread

newFrame() → None

This must be called at the start of every “frame”, whatever a frame may be deemed to be, to accumulate all the stats that have collected so far for the thread and ship them off to the server.

Calling PStatClient.threadTick() will automatically call this for any threads with the indicated sync name.

addFrame(frame_data: PStatFrameData) → None

This is a slightly lower-level version of new_frame that also specifies the data to send for this frame.

getThread() → Thread

Returns the Panda Thread object associated with this particular PStatThread.

Return type

Thread

getIndex() → int

Returns the index number of this particular thread within the PStatClient.

property thread

Returns the Panda Thread object associated with this particular PStatThread.

Return type

Thread

property index

Returns the index number of this particular thread within the PStatClient.

Return type

int