final class BlackfireProbe (View source)

Blackfire extension stubs.

Methods

static BlackfireProbe
getMainInstance()

Returns a global singleton and enables it by default.

static bool
isEnabled()

Tells whether the probe is currently profiling or not.

static 
addMarker(string $markerName = '')

Adds a marker for the Timeline View.

__construct(string $query, string|null $envId = null, string|null $envToken = null, string|null $agentSocket = null)

BlackfireProbe constructor. SHOULD NOT BE USED DIRECTLY! USE getMainInstance() INSTEAD!

bool
isVerified()

Tells if the probe is cryptographically verified, i.e. if the signature in X-Blackfire-Query HTTP header or BLACKFIRE_QUERY environment variable is valid.

setConfiguration(string $configuration)

No description

string
getResponseLine()

Gets the response message/status/line.

bool
enable()

Enables manual instrumentation. Starts collecting profiling data.

bool
discard()

Discards collected data and disables instrumentation.

bool
disable()

Disables instrumentation.

bool
close()

Stops the profiling and forces the collected data to be sent to Blackfire.

string|null
createSubProfileQuery()

Creates a sub-query string to create a new profile linked to the current one.

static void
setTransactionName(string $transactionName)

Sets a custom transaction name for Blackfire Monitoring.

static void
ignoreTransaction()

Disables Blackfire Monitoring instrumentation for a transaction.

static void
startTransaction()

Manually starts a transaction. Useful for CLI/Consumer monitoring.

static void
stopTransaction()

Manually stops a transaction. Useful for CLI/Consumer monitoring.

Details

static BlackfireProbe getMainInstance()

Returns a global singleton and enables it by default.

Return Value

BlackfireProbe

static bool isEnabled()

Tells whether the probe is currently profiling or not.

Return Value

bool

static addMarker(string $markerName = '')

Adds a marker for the Timeline View.

Parameters

string $markerName

__construct(string $query, string|null $envId = null, string|null $envToken = null, string|null $agentSocket = null)

BlackfireProbe constructor. SHOULD NOT BE USED DIRECTLY! USE getMainInstance() INSTEAD!

Parameters

string $query

An URL-encoded string that configures the probe. Part of the string is signed. Typically comes from X-Blackfire-Query HTTP header or BLACKRFIRE_QUERY environment variable.

string|null $envId

An id that is given to the agent for signature impersonation.

string|null $envToken

The token associated to $envId.

string|null $agentSocket

The URL where profiles will be written (directory, socket or TCP destination).

bool isVerified()

Tells if the probe is cryptographically verified, i.e. if the signature in X-Blackfire-Query HTTP header or BLACKFIRE_QUERY environment variable is valid.

Return Value

bool

setConfiguration(string $configuration)

No description

Parameters

string $configuration

string getResponseLine()

Gets the response message/status/line.

This lines gives details about the status of the probe. That can be:

  • an error: Blackfire-Error: $errNumber $urlEncodedErrorMessage
  • or not: Blackfire-Response: $rfc1738EncodedMessage

Return Value

string

The response line

bool enable()

Enables manual instrumentation. Starts collecting profiling data.

Return Value

bool

False if enabling failed.

bool discard()

Discards collected data and disables instrumentation.

Does not close the profile payload, allowing to re-enable the probe and aggregate data in the same profile.

Return Value

bool

False if the probe was not enabled.

bool disable()

Disables instrumentation.

Does not close the profile payload, allowing to re-enable the probe and to aggregate data in the same profile.

Return Value

bool

False if the probe was not enabled.

bool close()

Stops the profiling and forces the collected data to be sent to Blackfire.

Return Value

bool

False if the probe was not enabled.

string|null createSubProfileQuery()

Creates a sub-query string to create a new profile linked to the current one.

Generated query must be set in the X-Blackire-Query HTTP header or in the BLACKFIRE_QUERY environment variable.

Return Value

string|null

The sub-query or null if the current profile is not the first sample or profiling is disabled.

static void setTransactionName(string $transactionName)

Sets a custom transaction name for Blackfire Monitoring.

Parameters

string $transactionName

Name to register for the transaction (e.g. 'user_model:show')

Return Value

void

static void ignoreTransaction()

Disables Blackfire Monitoring instrumentation for a transaction.

Return Value

void

static void startTransaction()

Manually starts a transaction. Useful for CLI/Consumer monitoring.

Return Value

void

static void stopTransaction()

Manually stops a transaction. Useful for CLI/Consumer monitoring.

Return Value

void