Files
librenms-librenms/benchmarks/Benchmarks/InfluxDB/MessageToInlineProtocolEvent.php
T
Walter Dal Mut 932cd992ff Optimized list to string conversion
The inline protocol converts key values to strings
2015-06-25 23:33:32 +02:00

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,
],
],
]
]
);
}
}