Beberlei\Metrics\Collector\InfluxDB::flush PHP Method

flush() public method

public flush ( )
    public function flush()
    {
        foreach ($this->data as $data) {
            $this->client->mark(array('points' => array(array('measurement' => $data[0], 'fields' => array('value' => $data[1]))), 'tags' => $this->tags));
        }
        $this->data = array();
    }

Usage Example

Beispiel #1
0
 public function testCollectMeasureWithTags()
 {
     $expectedTags = array('dc' => 'west', 'node' => 'nemesis101');
     $expectedArgs = array('points' => array(array('measurement' => 'series-name', 'fields' => array('value' => 47.11))), 'tags' => $expectedTags);
     $this->client->expects($this->once())->method('mark')->with($expectedArgs);
     $this->collector->setTags($expectedTags);
     $this->collector->measure('series-name', 47.11);
     $this->collector->flush();
 }
All Usage Examples Of Beberlei\Metrics\Collector\InfluxDB::flush