-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
InfluxDb formatter and some code movements
- Loading branch information
Maksim Naumov
committed
Jun 18, 2015
1 parent
8ede2fe
commit 2a00df5
Showing
12 changed files
with
505 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
/** | ||
* Created for Hitmeister Project. | ||
* User: Maksim Naumov <maksim.naumov@hitmeister.de> | ||
* Date: 18/06/15 | ||
* Time: 09:21 | ||
*/ | ||
|
||
namespace Hitmeister\Component\Metrics\Benchmarks\Formatter; | ||
|
||
use Athletic\AthleticEvent; | ||
use Hitmeister\Component\Metrics\Formatter\InfluxDbLineFormatter; | ||
use Hitmeister\Component\Metrics\Metric\CounterMetric; | ||
|
||
class InfluxDbLineEvent extends AthleticEvent | ||
{ | ||
/** | ||
* @var InfluxDbLineFormatter | ||
*/ | ||
private $formatter; | ||
|
||
/** | ||
* @var CounterMetric | ||
*/ | ||
private $metricName; | ||
|
||
/** | ||
* @var CounterMetric | ||
*/ | ||
private $metricTags; | ||
|
||
/** | ||
* @var CounterMetric | ||
*/ | ||
private $metricTagsSample; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
protected function classSetUp() | ||
{ | ||
$this->formatter = new InfluxDbLineFormatter(); | ||
|
||
$this->metricName = new CounterMetric('metric_name', 10); | ||
|
||
$this->metricTags = new CounterMetric('metric_name', 10, ['env' => 'prod', 'server' => 'web01']); | ||
|
||
$this->metricTagsSample = new CounterMetric('metric_name', ['counter1' => 10, 'counter2' => 20], ['env' => 'production baby', 'server' => 'web01']); | ||
$this->metricTagsSample->setSampleRate(0.4); | ||
} | ||
|
||
/** | ||
* @iterations 10000 | ||
*/ | ||
public function counterName() | ||
{ | ||
$this->formatter->format($this->metricName); | ||
} | ||
|
||
/** | ||
* @iterations 1000 | ||
*/ | ||
public function counterNameAndTags() | ||
{ | ||
$this->formatter->format($this->metricTags); | ||
} | ||
|
||
/** | ||
* @iterations 1000 | ||
*/ | ||
public function counterNameTagsAndSample() | ||
{ | ||
$this->formatter->format($this->metricTagsSample); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.