mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
Cover merge global tags also when are missing
This commit is contained in:
@@ -187,6 +187,35 @@ EOF
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group udp
|
||||
*/
|
||||
public function testFillWithGlobalTags()
|
||||
{
|
||||
$options = (new Options())
|
||||
->setDatabase("test")
|
||||
->setTags(["dc" => "eu-west"]);
|
||||
$adapter = $this->getMockBuilder("InfluxDB\\Adapter\\UdpAdapter")
|
||||
->setConstructorArgs([$options])
|
||||
->setMethods(["write"])
|
||||
->getMock();
|
||||
|
||||
$adapter->expects($this->once())
|
||||
->method("write")
|
||||
->with($this->matchesRegularExpression("/mem,dc=eu-west free=712423 \d+/i"));
|
||||
|
||||
$adapter->send([
|
||||
"points" => [
|
||||
[
|
||||
"measurement" => "mem",
|
||||
"fields" => [
|
||||
"free" => 712423,
|
||||
],
|
||||
],
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @group udp
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user