Skip to content

Commit c76b467

Browse files
committedJul 15, 2020
add Model Cache for status command
1 parent fec1cb4 commit c76b467

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed
 

‎src/TerminalServer.php

+2-7
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,10 @@ public function onReceive(\Swoole\Server $server, int $fd, int $reactor_id, stri
9999
$server->send($fd, 'Http resquest count:' . \Swango\HttpServer::getTotalHttpRequest() . "\r\n");
100100
$server->send($fd, "[Model cache (Swoole\\Table) memory size(kb)]\r\n");
101101

102-
$tables = \Swango\Model\LocalCache::getAllInstances();
103-
if (empty($tables)) {
102+
$data = \Swango\Model\LocalCache::getAllInstanceSizes();
103+
if (empty($data)) {
104104
$server->send($fd, "*No model cache created\r\n");
105105
} else {
106-
$data = [];
107-
foreach ($tables as $key=>$table)
108-
$data[$key] = $table->memorySize;
109-
110-
unset($tables);
111106
foreach ($data as $key=>$memorySize) {
112107
$s = $key . ':';
113108
$l = strlen($key);

0 commit comments

Comments
 (0)
Please sign in to comment.