mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
0ee83437e3
git-subtree-dir: lib/influxdb-php-sdk git-subtree-mainline:15a338061dgit-subtree-split:1928d59eb9
77 lines
1.9 KiB
PHP
77 lines
1.9 KiB
PHP
<?php
|
|
namespace Corley\Benchmarks\InfluxDB;
|
|
|
|
use Athletic\AthleticEvent;
|
|
|
|
class MessageToInlineProtocolEvent extends AthleticEvent
|
|
{
|
|
/**
|
|
* @iterations 10000
|
|
*/
|
|
public function convertMessageToInlineProtocolWithNoTags()
|
|
{
|
|
\InfluxDB\Adapter\message_to_inline_protocol(
|
|
[
|
|
"points" => [
|
|
[
|
|
"measurement" => "vm-serie",
|
|
"fields" => [
|
|
"cpu" => 18.12,
|
|
"free" => 712423,
|
|
],
|
|
],
|
|
]
|
|
]
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @iterations 10000
|
|
*/
|
|
public function convertMessageToInlineProtocolWithGlobalTags()
|
|
{
|
|
\InfluxDB\Adapter\message_to_inline_protocol(
|
|
[
|
|
"tags" => [
|
|
"dc" => "eu-west-1",
|
|
],
|
|
"points" => [
|
|
[
|
|
"measurement" => "vm-serie",
|
|
"fields" => [
|
|
"cpu" => 18.12,
|
|
"free" => 712423,
|
|
],
|
|
],
|
|
]
|
|
]
|
|
);
|
|
}
|
|
|
|
/**
|
|
* @iterations 10000
|
|
*/
|
|
public function convertMessageToInlineProtocolWithDifferentTagLevels()
|
|
{
|
|
\InfluxDB\Adapter\message_to_inline_protocol(
|
|
[
|
|
"tags" => [
|
|
"dc" => "eu-west-1",
|
|
],
|
|
"points" => [
|
|
[
|
|
"measurement" => "vm-serie",
|
|
"tags" => [
|
|
"server" => "tc12",
|
|
],
|
|
"fields" => [
|
|
"cpu" => 18.12,
|
|
"free" => 712423,
|
|
],
|
|
],
|
|
]
|
|
]
|
|
);
|
|
}
|
|
}
|