/**
  * Reports counts info to New Relic
  *
  * @return void
  */
 protected function reportCounts()
 {
     $this->addCustomParameters([Config::PRODUCT_COUNT => $this->counter->getAllProductsCount(), Config::CONFIGURABLE_COUNT => $this->counter->getConfigurableCount(), Config::ACTIVE_COUNT => $this->counter->getActiveCatalogSize(), Config::CATEGORY_COUNT => $this->counter->getCategoryCount(), Config::WEBSITE_COUNT => $this->counter->getWebsiteCount(), Config::STORE_VIEW_COUNT => $this->counter->getStoreViewsCount(), Config::CUSTOMER_COUNT => $this->counter->getCustomerCount()]);
     if (!empty($this->customParameters)) {
         try {
             $this->cronEventFactory->create()->addData($this->customParameters)->sendRequest();
         } catch (\Exception $e) {
             $this->logger->critical(sprintf("New Relic Cron Event exception: %s\n%s", $e->getMessage(), $e->getTraceAsString()));
         }
     }
 }
예제 #2
0
 /**
  * Tests all configurable products count will return int
  *
  * @return void
  */
 public function testGetConfigurableCount()
 {
     $this->configurableManagement->expects($this->once())->method('getCount')->willReturn(1);
     $this->assertInternalType('int', $this->model->getConfigurableCount());
 }