/** * @group memory */ public function testMemoryProfile() { $this->client->startMemoryProfile('foo.bar'); /** @noinspection PhpUnusedLocalVariableInspection */ $memoryUsage = memory_get_usage(); /** @noinspection PhpUnusedLocalVariableInspection */ $foobar = "fooooooooooooooooooooooooooooooooooooooooooooooooooooooobar"; $this->client->endMemoryProfile('foo.bar'); $message = $this->connection->getLastMessage(); $this->assertRegExp('/test\\.foo\\.bar:[0-9]{4,}|c/', $message); preg_match('/test\\.foo\\.bar\\:([0-9]*)|c/', $message, $matches); $this->assertGreaterThan(0, $matches[1]); }
/** * @inheritdoc */ public function startMemoryProfile($key) { $this->client->startMemoryProfile($key); }
/** * Starts a memory profile meassure * * @param string $key Something like: 'foo.bar' */ private function startMemoryProfile($key) { $this->client->startMemoryProfile($key); }