/** * @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 endMemoryProfile($key, $sampleRate = 1) { $this->client->endMemoryProfile($key, $sampleRate); }
/** * Ends a timer * * @param string $key Something like: 'foo.bar' */ private function endMemoryProfile($key) { $this->client->endMemoryProfile($key); }