Пример #1
0
 public function testGetRates()
 {
     $stats = new Stats();
     $this->assertEquals(0, $stats->getRequestRate());
     $this->assertEquals(0, $stats->getHitRate());
     $this->assertEquals(0, $stats->getMissRate());
     $stats->setUptime(200);
     $stats->setGetHits(120);
     $stats->setGetMisses(240);
     $this->assertEquals(1.8, $stats->getRequestRate());
     $this->assertEquals(0.6, $stats->getHitRate());
     $this->assertEquals(1.2, $stats->getMissRate());
 }