PHP 클래스 Datadogstatsd

파일 보기 프로젝트 열기: datadog/php-datadogstatsd 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$__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