当前位置: 首页>>代码示例>>PHP>>正文


PHP LogHelper::formatExecutionTime方法代码示例

本文整理汇总了PHP中LogHelper::formatExecutionTime方法的典型用法代码示例。如果您正苦于以下问题:PHP LogHelper::formatExecutionTime方法的具体用法?PHP LogHelper::formatExecutionTime怎么用?PHP LogHelper::formatExecutionTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LogHelper的用法示例。


在下文中一共展示了LogHelper::formatExecutionTime方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __call

    public function __call($methodName, $args) {
        $timeStart = microtime(TRUE);
        $result = call_user_func_array(array($this->controllerInstance, $methodName), $args);
        LogHelper::log_notice(t(
            'Data Controller execution time for @methodName(): !executionTime',
            array('@methodName' => $methodName, '!executionTime' => LogHelper::formatExecutionTime($timeStart))));

        return $result;
    }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:9,代码来源:AbstractDataControllerProxy.php

示例2: join

    final public function join(JoinController_SourceConfiguration $sourceConfigurationA, JoinController_SourceConfiguration $sourceConfigurationB) {
        $timeStart = microtime(TRUE);
        $result = $this->joinSourceConfigurations($sourceConfigurationA, $sourceConfigurationB);
        LogHelper::log_notice(t(
            '@className execution time: !executionTime',
            array('@className' => get_class($this), '!executionTime' => LogHelper::formatExecutionTime($timeStart))));

        return $result;
    }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:9,代码来源:AbstractJoinController.php

示例3: executeQueryStatement

    protected function executeQueryStatement(DataControllerCallContext $callcontext, DataSourceMetaData $datasource, $sql, __SQLDataSourceHandler__AbstractQueryCallbackProxy $callbackInstance) {
        $result = NULL;
        if (self::$STATEMENT_EXECUTION_MODE == self::STATEMENT_EXECUTION_MODE__PROCEED) {
            $connection = $this->getConnection($datasource);

            $timeStart = microtime(TRUE);
            $result = $this->getExtension('executeQueryStatement')->execute($this, $callcontext, $connection, $sql, $callbackInstance);
            LogHelper::log_notice(t('Database execution time: !executionTime', array('!executionTime' => LogHelper::formatExecutionTime($timeStart))));
        }

        return $result;
    }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:12,代码来源:AbstractSQLDataSourceQueryHandler.php

示例4: loadMetaModel

    protected function loadMetaModel(AbstractMetaModel $metamodel) {
        $metaModelName = get_class($this);

        LogHelper::log_notice(t('Loading @metamodelName ...', array('@metamodelName' => $metaModelName)));

        $metamodelTimeStart = microtime(TRUE);
        $metamodelMemoryUsage = memory_get_usage();

        if (isset($this->loaders)) {
            // preparing each loader for load operation
            foreach ($this->loaders as $priority => $loaders) {
                foreach ($loaders as $loader) {
                    $loader->prepare($metamodel);
                }
            }

            $filters = $this->getMetaModelFilters();
            foreach ($this->loaders as $priority => $loaders) {
                foreach ($loaders as $loader) {
                    $loaderClassName = get_class($loader);

                    $loaderTimeStart = microtime(TRUE);
                    $loader->load($metamodel, $filters);
                    LogHelper::log_notice(t(
                        "'@loaderClassName' Meta Model Loader execution time: !executionTime",
                        array('@loaderClassName' => $loaderClassName, '!executionTime' => LogHelper::formatExecutionTime($loaderTimeStart))));
                }
            }

            // finalizing loading operation
            foreach ($this->loaders as $priority => $loaders) {
                foreach ($loaders as $loader) {
                    $loader->finalize($metamodel);
                }
            }
        }

        LogHelper::log_notice(t(
            '@metamodelName loading time: !loadingTime; Memory consumed: !memoryUsage',
            array(
                '@metamodelName' => $metaModelName,
                '!loadingTime' => LogHelper::formatExecutionTime($metamodelTimeStart),
                '!memoryUsage' => (memory_get_usage() - $metamodelMemoryUsage))));
    }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:44,代码来源:AbstractMetaModelFactory.php

示例5: flush

    public function flush($subsetName = NULL) {
        $timeStart = microtime(TRUE);

        $result = parent::flush($subsetName);

        LogHelper::log_info(t(
            "[@cacheType] Execution time for@successFlag cache flush time is !executionTime",
            array(
                '@cacheType' => $this->getCacheType(),
                '!executionTime' => LogHelper::formatExecutionTime($timeStart),
                '@successFlag' => t(($result === FALSE) ? (' ' . t('UNSUCCESSFUL')) : ''))));

        return $result;
    }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:14,代码来源:AbstractSharedCacheHandler.php

示例6: parse


//.........这里部分代码省略.........
                                        $dataProvider->rollbackReading();
                                        $dataProvider->startReading();
                                        $record = $this->parseNextRecord($dataProvider, $dataSubmitters, $attempt);

                                        $attempt++;
                                    }
                                }
                            }
                            $dataProvider->endReading();

                            // checking if we reached the end
                            if (!isset($record)) {
                                $fileProcessedCompletely  = TRUE;
                                break;
                            }

                            // skipping required number of records
                            if ($skippedRecordCount < $this->skipRecordCount) {
                                $skippedRecordCount++;
                                continue;
                            }

                            $this->postProcessColumnValues($record);

                            // checking if we need to skip processing the record
                            $recordNumber = $dataProvider->getCurrentLineNumber();
                            if ($this->executeBeforeRecordSubmitted($dataSubmitters, $recordNumber, $record)) {
                                $this->submitRecord($dataSubmitters, $recordNumber, $record);
                                $this->executeAfterRecordSubmitted($dataSubmitters, $recordNumber, $record);

                                $loadedRecordCount++;
                                if (($loadedRecordCount % 1000) == 0) {
                                    LogHelper::log_info(t(
                                        'Processed @recordCount records so far (memory usage: @memoryUsed)',
                                        array('@recordCount' => $loadedRecordCount, '@memoryUsed' => memory_get_usage())));
                                }
                            }
                        }

                        $this->executeAfterProcessingRecords($dataSubmitters, $fileProcessedCompletely);
                    }

                    $this->finishProcessing($dataSubmitters);
                }
            }
            catch (DataParserException $e) {
                LogHelper::log_warn(t('Place of original exception @file:@line', array('@file' => $e->getFile(), '@line' => $e->getLine())));

                try {
                    $this->abortProcessing($dataSubmitters);
                }
                catch (Exception $ne) {
                    // we do not need to rethrow this exception. We need to preserve and rethrow original exception
                    LogHelper::log_error($ne);
                }

                try {
                    $dataProvider->closeResource();
                }
                catch (Exception $ne) {
                    // we do not need to rethrow this exception. We need to preserve and rethrow original exception
                    LogHelper::log_error($ne);
                }

                throw new IllegalStateException($e->getMessage());
            }
            catch (Exception $e) {
                LogHelper::log_warn(t('Place of original exception @file:@line', array('@file' => $e->getFile(), '@line' => $e->getLine())));

                try {
                    $this->abortProcessing($dataSubmitters);
                }
                catch (Exception $ne) {
                    // we do not need to rethrow this exception. We need to preserve and rethrow original exception
                    LogHelper::log_error($ne);
                }

                $ise = new IllegalStateException(
                    ExceptionHelper::getExceptionMessage($e) . t(' [%lineNumber line(s) parsed so far]', array('%lineNumber' => $dataProvider->getCurrentLineNumber())),
                    0, $e);
                try {
                    $dataProvider->closeResource();
                }
                catch (Exception $ne) {
                    // we do not need to rethrow this exception. We need to preserve and rethrow original exception
                    LogHelper::log_error($ne);
                }

                throw $ise;
            }

            $dataProvider->closeResource();
        }

        LogHelper::log_notice(t(
            'Processing @recordCount record(s) took !executionTime',
            array('@recordCount' => $loadedRecordCount, '!executionTime' => LogHelper::formatExecutionTime($timeStart))));

        return $loadedRecordCount;
    }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:101,代码来源:DelimiterDataParser.php

示例7: executeStatement

    public function executeStatement(DataSourceMetaData $datasource, $sql) {
        $affectedRecordCount = 0;
        if (self::$STATEMENT_EXECUTION_MODE == self::STATEMENT_EXECUTION_MODE__PROCEED) {
            $connection = $this->getConnection($datasource);

            $timeStart = microtime(TRUE);
            $affectedRecordCount = $this->getExtension('executeStatement')->execute($this, $connection, $sql);
            LogHelper::log_notice(t(
                'Database execution time for @statementCount statement(s): !executionTime',
                array(
                    '@statementCount' => count($sql),
                    '!executionTime' => LogHelper::formatExecutionTime($timeStart))));
        }

        return $affectedRecordCount;
    }
开发者ID:reisystems-india,项目名称:GovDashboard-Community,代码行数:16,代码来源:AbstractSQLDataSourceHandler.php


注:本文中的LogHelper::formatExecutionTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。