PHP Класс Datadogstatsd

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$__server
$__serverPort

Открытые методы

Метод Описание
configure ( $apiKey, $applicationKey, $datadogHost = 'https://app.datadoghq.com', $submitEventsOver = 'TCP', $localStatsdServer = 'localhost', $localStatsdPort = 8125, $curlVerifySslHost = 2, $curlVerifySslPeer = 1 )
decrement ( string | array $stats, float $sampleRate = 1, array $tags = null ) : boolean Decrements one or more stats counters.
event ( string $title, array $vals = [] ) : null Send an event to the Datadog HTTP api. Potentially slow, so avoid making many call in a row if you don't want to stall your app.
flush ( $udp_message )
gauge ( string $stat, float $value, float $sampleRate = 1, array $tags = null ) Gauge
histogram ( string $stat, float $value, float $sampleRate = 1, array $tags = null ) Histogram
increment ( string | array $stats, float $sampleRate = 1, array $tags = null ) : boolean Increments one or more stats counters
microtiming ( string $stat, float $time, float $sampleRate = 1, array $tags = null ) A convenient alias for the timing function when used with micro-timing
report ( $udp_message )
report_metric ( $udp_message )
send ( array $data, float $sampleRate = 1, array $tags = null ) : null Squirt the metrics over UDP
service_check ( string $name, integer $status, array $tags = null, string $hostname = null, string $message = null, integer $timestamp = null ) : null Send a custom service check status over UDP
set ( string $stat, float $value, float $sampleRate = 1, array $tags = null ) Set
timing ( string $stat, float $time, float $sampleRate = 1, array $tags = null ) Log timing information
updateStats ( string | array $stats, integer $delta = 1, float $sampleRate = 1, array $tags = null ) : boolean Updates one or more stats counters by arbitrary amounts.

Приватные методы

Метод Описание
escape_sc_message ( $msg )
eventUdp ( array $vals ) : null Formats $vals array into event for submission to Datadog via UDP

Описание методов

configure() публичный статический Метод

public static configure ( $apiKey, $applicationKey, $datadogHost = 'https://app.datadoghq.com', $submitEventsOver = 'TCP', $localStatsdServer = 'localhost', $localStatsdPort = 8125, $curlVerifySslHost = 2, $curlVerifySslPeer = 1 )

decrement() публичный статический Метод

Decrements one or more stats counters.
public static decrement ( string | array $stats, float $sampleRate = 1, array $tags = null ) : boolean
$stats string | array The metric(s) to decrement.
$sampleRate float the rate (0-1) for sampling.
$tags array Key Value array of Tag => Value, or single tag as string
Результат boolean

event() публичный статический Метод

Requires PHP >= 5.3.0
public static event ( string $title, array $vals = [] ) : null
$title string Title of the event
$vals array Optional values of the event. See http://docs.datadoghq.com/guides/dogstatsd/#events for the valid keys
Результат null

flush() публичный статический Метод

public static flush ( $udp_message )

gauge() публичный статический Метод

Gauge
public static gauge ( string $stat, float $value, float $sampleRate = 1, array $tags = null )
$stat string The metric
$value float The value
$sampleRate float the rate (0-1) for sampling.
$tags array Key Value array of Tag => Value, or single tag as string

histogram() публичный статический Метод

Histogram
public static histogram ( string $stat, float $value, float $sampleRate = 1, array $tags = null )
$stat string The metric
$value float The value
$sampleRate float the rate (0-1) for sampling.
$tags array Key Value array of Tag => Value, or single tag as string

increment() публичный статический Метод

Increments one or more stats counters
public static increment ( string | array $stats, float $sampleRate = 1, array $tags = null ) : boolean
$stats string | array The metric(s) to increment.
$sampleRate float the rate (0-1) for sampling.
$tags array Key Value array of Tag => Value, or single tag as string
Результат boolean

microtiming() публичный статический Метод

A convenient alias for the timing function when used with micro-timing
public static microtiming ( string $stat, float $time, float $sampleRate = 1, array $tags = null )
$stat string The metric name
$time float The elapsed time to log, IN SECONDS
$sampleRate float the rate (0-1) for sampling.
$tags array Key Value array of Tag => Value, or single tag as string

report() публичный статический Метод

public static report ( $udp_message )

report_metric() публичный статический Метод

public static report_metric ( $udp_message )

send() публичный статический Метод

Squirt the metrics over UDP
public static send ( array $data, float $sampleRate = 1, array $tags = null ) : null
$data array Incoming Data
$sampleRate float the rate (0-1) for sampling.
$tags array Key Value array of Tag => Value, or single tag as string
Результат null

service_check() публичный статический Метод

Send a custom service check status over UDP
public static service_check ( string $name, integer $status, array $tags = null, string $hostname = null, string $message = null, integer $timestamp = null ) : null
$name string service check name
$status integer service check status code (see static::OK, static::WARNING,...)
$tags array Key Value array of Tag => Value, or single tag as string
$hostname string hostname to associate with this service check status
$message string message to associate with this service check status
$timestamp integer timestamp for the service check status (defaults to now)
Результат null

set() публичный статический Метод

Set
public static set ( string $stat, float $value, float $sampleRate = 1, array $tags = null )
$stat string The metric
$value float The value
$sampleRate float the rate (0-1) for sampling.
$tags array Key Value array of Tag => Value, or single tag as string

timing() публичный статический Метод

Log timing information
public static timing ( string $stat, float $time, float $sampleRate = 1, array $tags = null )
$stat string The metric to in log timing info for.
$time float The elapsed time (ms) to log
$sampleRate float the rate (0-1) for sampling.
$tags array Key Value array of Tag => Value, or single tag as string

updateStats() публичный статический Метод

Updates one or more stats counters by arbitrary amounts.
public static updateStats ( string | array $stats, integer $delta = 1, float $sampleRate = 1, array $tags = null ) : boolean
$stats string | array The metric(s) to update. Should be either a string or array of metrics.
$delta integer The amount to increment/decrement each metric by.
$sampleRate float the rate (0-1) for sampling.
$tags array Key Value array of Tag => Value, or single tag as string
Результат boolean

Описание свойств

$__server защищенное статическое свойство

protected static $__server

$__serverPort защищенное статическое свойство

protected static $__serverPort