mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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,
|
|
],
|
|
],
|
|
]
|
|
]
|
|
);
|
|
}
|
|
}
|