mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-02 00:32:09 +02:00
BUGFIX message
This commit is contained in:
@@ -23,13 +23,13 @@ class ClientSpec extends ObjectBehavior
|
|||||||
|
|
||||||
function it_should_send_data(\InfluxDB\Adapter\AdapterInterface $adapter)
|
function it_should_send_data(\InfluxDB\Adapter\AdapterInterface $adapter)
|
||||||
{
|
{
|
||||||
$adapter->send([
|
$adapter->send([[
|
||||||
"name" => "video.search",
|
"name" => "video.search",
|
||||||
"columns" => ["author", "title"],
|
"columns" => ["author", "title"],
|
||||||
"points" => [
|
"points" => [
|
||||||
["Guccini", "Autogrill"]
|
["Guccini", "Autogrill"]
|
||||||
]
|
]
|
||||||
])->shouldBeCalledTimes(1);
|
]])->shouldBeCalledTimes(1);
|
||||||
|
|
||||||
$this->mark("video.search", [
|
$this->mark("video.search", [
|
||||||
"author" => "Guccini",
|
"author" => "Guccini",
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ class Udp implements AdapterInterface
|
|||||||
|
|
||||||
public function send($message)
|
public function send($message)
|
||||||
{
|
{
|
||||||
|
$message = json_encode($message);
|
||||||
socket_sendto($this->getSocket(), $message, strlen($message), 0, $this->host, $this->port);
|
socket_sendto($this->getSocket(), $message, strlen($message), 0, $this->host, $this->port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ class Client implements ClientInterface
|
|||||||
|
|
||||||
public function mark($name, array $values)
|
public function mark($name, array $values)
|
||||||
{
|
{
|
||||||
$data = [];
|
$data =[];
|
||||||
$data['name'] = $name;
|
$data['name'] = $name;
|
||||||
$data['columns'] = array_keys($values);
|
$data['columns'] = array_keys($values);
|
||||||
$data['points'][] = array_values($values);
|
$data['points'][] = array_values($values);
|
||||||
|
|
||||||
return $this->getAdapter()->send($data);
|
return $this->getAdapter()->send([$data]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user