yurunsoft / tdengine-restful-connector Goto Github PK
View Code? Open in Web Editor NEWPHP TDEngine RESTful connector
License: MIT License
PHP TDEngine RESTful connector
License: MIT License
[Coroutine-1970]
--------------------------------------------------------------------
#0 Swoole\Coroutine\Channel->push() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/YurunHttp/Handler/Swoole/SwooleHttpConnectionPool.php:97]
#1 Yurun\Util\YurunHttp\Handler\Swoole\SwooleHttpConnectionPool->release() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/YurunHttp/Handler/Swoole/SwooleHttpConnectionManager.php:100]
#2 Yurun\Util\YurunHttp\Handler\Swoole\SwooleHttpConnectionManager->release() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/YurunHttp/Handler/Swoole.php:404]
#3 Yurun\Util\YurunHttp\Handler\Swoole->recvDefer() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/YurunHttp/Handler/Swoole.php:227]
#4 Yurun\Util\YurunHttp\Handler\Swoole->send() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/YurunHttp.php:117]
#5 Yurun\Util\YurunHttp::send() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/HttpRequest.php:977]
#6 Yurun\Util\HttpRequest->send() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/HttpRequest.php:1036]
#7 Yurun\Util\HttpRequest->post() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-restful-connector/src/Client.php:63]
#8 Yurun\TDEngine\Client->request() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-restful-connector/src/Client.php:99]
#9 Yurun\TDEngine\Client->sql() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/ClientHandler/Restful/Handler.php:18]
#10 Yurun\TDEngine\Orm\ClientHandler\Restful\Handler->query() called at [/home/www/hyperf-skeleton/app/Service/CreateAlert2.php:23]
#11 App\Service\CreateAlert2->handle() called at [/home/www/hyperf-skeleton/app/Command/NodeCommand.php:57]
#12 App\Command\NodeCommand->App\Command\{closure}() called at [/home/www/hyperf-skeleton/vendor/hyperf/utils/src/Functions.php:274]
#13 call() called at [/home/www/hyperf-skeleton/vendor/hyperf/utils/src/Coroutine.php:62]
use 0.94960713386536 s
[2022-11-25 02:57:28 @5365.0] WARNING Channel::~Channel() (ERRNO 10003): channel is destroyed, 976 producers will be discarded
`use Yurun\TDEngine;
$taosClient = new TDEngine\Client(new TDEngine\ClientConfig([
'host' => '127.0.0.1',
'hostName' => '',
'port' => 6041,
'user' => 'root',
'password' => 'taosdata',
'db' => 'weather',
'ssl' => false,
'timestampFormat' => TDEngine\Constants\TimeStampFormat::LOCAL_STRING, // 此配置 TDengine 3.0 下失效,统一返回格式为:2022-11-25T05:41:04.690Z
'keepAlive' => true,
'version' => '3', // TDengine 版本
'timezone' => 'UTC', // TDengine >= 3.0 时支持,可选参数,指定返回时间的时区
]));
$result = $taosClient->sql(sprintf('select * from weather.station');
`
查询出来的时间为"ts": "2023-12-02T15:26:34.000Z",用convert报错,该怎么调整代码能够显示2023-12-02 23:26:34.000
看起来是taosd
的RESTful接口返回内容变了:
如上图,我是依赖codeception创建了测试代码,在2.6上是可以正确运行的。
翻查了提示信息中对应部分的源码,发现是处理POST请求的返回值时解析错误。
[Coroutine-1970]
--------------------------------------------------------------------
#0 Swoole\Coroutine\Channel->push() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/YurunHttp/Handler/Swoole/SwooleHttpConnectionPool.php:97]
#1 Yurun\Util\YurunHttp\Handler\Swoole\SwooleHttpConnectionPool->release() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/YurunHttp/Handler/Swoole/SwooleHttpConnectionManager.php:100]
#2 Yurun\Util\YurunHttp\Handler\Swoole\SwooleHttpConnectionManager->release() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/YurunHttp/Handler/Swoole.php:404]
#3 Yurun\Util\YurunHttp\Handler\Swoole->recvDefer() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/YurunHttp/Handler/Swoole.php:227]
#4 Yurun\Util\YurunHttp\Handler\Swoole->send() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/YurunHttp.php:117]
#5 Yurun\Util\YurunHttp::send() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/HttpRequest.php:977]
#6 Yurun\Util\HttpRequest->send() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/yurun-http/src/HttpRequest.php:1036]
#7 Yurun\Util\HttpRequest->post() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-restful-connector/src/Client.php:63]
#8 Yurun\TDEngine\Client->request() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-restful-connector/src/Client.php:99]
#9 Yurun\TDEngine\Client->sql() called at [/home/www/hyperf-skeleton/vendor/yurunsoft/tdengine-orm/src/ClientHandler/Restful/Handler.php:18]
#10 Yurun\TDEngine\Orm\ClientHandler\Restful\Handler->query() called at [/home/www/hyperf-skeleton/app/Service/CreateAlert2.php:23]
#11 App\Service\CreateAlert2->handle() called at [/home/www/hyperf-skeleton/app/Command/NodeCommand.php:57]
#12 App\Command\NodeCommand->App\Command\{closure}() called at [/home/www/hyperf-skeleton/vendor/hyperf/utils/src/Functions.php:274]
#13 call() called at [/home/www/hyperf-skeleton/vendor/hyperf/utils/src/Coroutine.php:62]
use 0.94960713386536 s
[2022-11-25 02:57:28 @5365.0] WARNING Channel::~Channel() (ERRNO 10003): channel is destroyed, 976 producers will be discarded
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.