public function testStats_ExtendedHierarchy() { $this->container->expects($this->once())->method('getData')->will($this->returnValue(array('Foo.foobar' => 5, 'Bar' => 1, 'Foo.foobar.baz' => 1))); $expected = array('Foo' => array('foobar' => array(5, 'baz' => 1)), 'Bar' => 1); $instance = new TransientStatsdCollector($this->blobStore, 42); $this->assertEquals($expected, $instance->getStats()); }
private function initStats($date) { $this->transientStatsdCollector->shouldRecord($this->isEnabled()); $this->transientStatsdCollector->init('misses', 0); $this->transientStatsdCollector->init('deletes', 0); $this->transientStatsdCollector->init('hits', array()); $this->transientStatsdCollector->init('medianRetrievalResponseTime', array()); $this->transientStatsdCollector->init('noCache', array()); $this->transientStatsdCollector->set('meta.version', self::VERSION); $this->transientStatsdCollector->set('meta.cacheLifetime.embedded', $GLOBALS['smwgQueryResultCacheLifetime']); $this->transientStatsdCollector->set('meta.cacheLifetime.nonEmbedded', $GLOBALS['smwgQueryResultNonEmbeddedCacheLifetime']); $this->transientStatsdCollector->init('meta.collectionDate.start', $date); $this->transientStatsdCollector->set('meta.collectionDate.update', $date); }