PHP 클래스 InfluxDB\Database

저자: Stephen "TheCodeAssassin" Hoogendijk
파일 보기 프로젝트 열기: influxdb/influxdb-php 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$client Client
$name string The name of the Database

공개 메소드들

메소드 설명
__construct ( string $name, Client $client ) Construct a database object
alterRetentionPolicy ( InfluxDB\Database\RetentionPolicy $retentionPolicy )
create ( InfluxDB\Database\RetentionPolicy $retentionPolicy = null, boolean $createIfNotExists = true ) : influxdb\ResultSet Create this database
createRetentionPolicy ( InfluxDB\Database\RetentionPolicy $retentionPolicy ) : influxdb\ResultSet
drop ( ) Drop this database
exists ( ) : boolean
getClient ( ) : Client
getName ( ) : string
getQueryBuilder ( ) : InfluxDB\Query\Builder Retrieve the query builder
listRetentionPolicies ( ) : array
query ( string $query, array $params = [] ) : influxdb\ResultSet Query influxDB
writePayload ( string | array $payload, string $precision = self::PRECISION_NANOSECONDS, string | null $retentionPolicy = null ) : boolean Write a payload into InfluxDB using the current driver. This method is similar to writePoints(), except it takes a string payload instead of an array of Points. This is useful in the following situations:
writePoints ( array $points, string $precision = self::PRECISION_NANOSECONDS, string | null $retentionPolicy = null ) : boolean Write points into InfluxDB using the current driver. This is the recommended method for inserting data into InfluxDB.

보호된 메소드들

메소드 설명
getRetentionPolicyQuery ( string $method, InfluxDB\Database\RetentionPolicy $retentionPolicy ) : string

메소드 상세

__construct() 공개 메소드

Construct a database object
public __construct ( string $name, Client $client )
$name string
$client Client

alterRetentionPolicy() 공개 메소드

public alterRetentionPolicy ( InfluxDB\Database\RetentionPolicy $retentionPolicy )
$retentionPolicy InfluxDB\Database\RetentionPolicy

create() 공개 메소드

Create this database
public create ( InfluxDB\Database\RetentionPolicy $retentionPolicy = null, boolean $createIfNotExists = true ) : influxdb\ResultSet
$retentionPolicy InfluxDB\Database\RetentionPolicy
$createIfNotExists boolean Only create the database if it does not yet exist
리턴 influxdb\ResultSet

createRetentionPolicy() 공개 메소드

public createRetentionPolicy ( InfluxDB\Database\RetentionPolicy $retentionPolicy ) : influxdb\ResultSet
$retentionPolicy InfluxDB\Database\RetentionPolicy
리턴 influxdb\ResultSet

drop() 공개 메소드

Drop this database
public drop ( )

exists() 공개 메소드

public exists ( ) : boolean
리턴 boolean

getClient() 공개 메소드

public getClient ( ) : Client
리턴 Client

getName() 공개 메소드

public getName ( ) : string
리턴 string

getQueryBuilder() 공개 메소드

Retrieve the query builder
public getQueryBuilder ( ) : InfluxDB\Query\Builder
리턴 InfluxDB\Query\Builder

getRetentionPolicyQuery() 보호된 메소드

protected getRetentionPolicyQuery ( string $method, InfluxDB\Database\RetentionPolicy $retentionPolicy ) : string
$method string
$retentionPolicy InfluxDB\Database\RetentionPolicy
리턴 string

listRetentionPolicies() 공개 메소드

public listRetentionPolicies ( ) : array
리턴 array

query() 공개 메소드

Query influxDB
public query ( string $query, array $params = [] ) : influxdb\ResultSet
$query string
$params array
리턴 influxdb\ResultSet

writePayload() 공개 메소드

1) Performing unique queries that may not conform to the current Point standard. 2) Inserting very large set of points into a measurement where looping via array_map() actually hurts performance as the payload may be calculated in advance by caller.
public writePayload ( string | array $payload, string $precision = self::PRECISION_NANOSECONDS, string | null $retentionPolicy = null ) : boolean
$payload string | array InfluxDB payload (Or array of payloads) that conform to the Line syntax.
$precision string The timestamp precision (defaults to nanoseconds).
$retentionPolicy string | null Specifies an explicit retention policy to use when writing all points. If not set, the default retention period will be used. This is only applicable for the Guzzle driver. The UDP driver utilizes the endpoint configuration defined in the server's influxdb configuration file.
리턴 boolean

writePoints() 공개 메소드

Write points into InfluxDB using the current driver. This is the recommended method for inserting data into InfluxDB.
public writePoints ( array $points, string $precision = self::PRECISION_NANOSECONDS, string | null $retentionPolicy = null ) : boolean
$points array Array of Point objects
$precision string The timestamp precision (defaults to nanoseconds).
$retentionPolicy string | null Specifies an explicit retention policy to use when writing all points. If not set, the default retention period will be used. This is only applicable for the Guzzle driver. The UDP driver utilizes the endpoint configuration defined in the server's influxdb configuration file.
리턴 boolean

프로퍼티 상세

$client 보호되어 있는 프로퍼티

protected Client,influxdb $client
리턴 Client

$name 보호되어 있는 프로퍼티

The name of the Database
protected string $name
리턴 string