mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00: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)
|
||||
{
|
||||
$adapter->send([
|
||||
$adapter->send([[
|
||||
"name" => "video.search",
|
||||
"columns" => ["author", "title"],
|
||||
"points" => [
|
||||
["Guccini", "Autogrill"]
|
||||
]
|
||||
])->shouldBeCalledTimes(1);
|
||||
]])->shouldBeCalledTimes(1);
|
||||
|
||||
$this->mark("video.search", [
|
||||
"author" => "Guccini",
|
||||
|
||||
@@ -47,6 +47,7 @@ class Udp implements AdapterInterface
|
||||
|
||||
public function send($message)
|
||||
{
|
||||
$message = json_encode($message);
|
||||
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)
|
||||
{
|
||||
$data = [];
|
||||
$data =[];
|
||||
$data['name'] = $name;
|
||||
$data['columns'] = array_keys($values);
|
||||
$data['points'][] = array_values($values);
|
||||
|
||||
return $this->getAdapter()->send($data);
|
||||
return $this->getAdapter()->send([$data]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user