* [misc] add comment.

This commit is contained in:
qixinzhi
2025-07-02 08:57:18 +00:00
parent 56b2091e77
commit 019d84e1fa
2 changed files with 34 additions and 6 deletions
+12 -6
View File
@@ -170,10 +170,12 @@ class metric extends control
*/
public function updateMetricLib()
{
// 保存当前的错误报告级别和显示错误的设置
/* 保存当前的错误报告级别和显示错误的设置。*/
/* Save the current error reporting level and display error settings. */
$originalDebug = $this->config->debug;
// 开启调试模式
/* 开启调试模式。*/
/* Enable debug mode. */
$this->config->debug = 2;
$this->metric->saveLogs('----------------------------------');
@@ -184,7 +186,8 @@ class metric extends control
$classifiedCalcGroup = $this->metric->classifyCalc($calcList);
$this->metricZen->calculateMetric($classifiedCalcGroup);
// 恢复之前的调试状态
/* 恢复之前的调试状态。*/
/* Restore the previous debug state. */
$this->config->debug = $originalDebug;
if(dao::isError())
@@ -197,10 +200,12 @@ class metric extends control
public function updateDashboardMetricLib()
{
// 保存当前的错误报告级别和显示错误的设置
/* 保存当前的错误报告级别和显示错误的设置。*/
/* Save the current error reporting level and display error settings. */
$originalDebug = $this->config->debug;
// 开启调试模式
/* 开启调试模式。*/
/* Enable debug mode. */
$this->config->debug = 2;
$this->metric->saveLogs('-------------------------------------------');
@@ -213,7 +218,8 @@ class metric extends control
$classifiedCalcGroup = $this->metric->classifyCalc($calcList);
$this->metricZen->calculateMetric($classifiedCalcGroup);
// 恢复之前的调试状态
/* 恢复之前的调试状态。*/
/* Restore the previous debug state. */
$this->config->debug = $originalDebug;
if(dao::isError())
+22
View File
@@ -225,21 +225,33 @@ class metricZen extends metric
{
set_time_limit(0);
$calcBeginTime = $this->startTime();
foreach($classifiedCalcGroup as $calcGroup)
{
try
{
/* 开始计算度量数据。*/
/* Start calculating metric data. */
$beginTime = $this->startTime();
$statement = $this->prepareDataset($calcGroup);
$sql = $statement ? $statement->get() : '';
$this->calcMetric($statement, $calcGroup->calcList);
$recordWithCode = $this->prepareMetricRecord($calcGroup->calcList);
$calcTime = $this->endTime($beginTime);
/* 开始插入度量数据。*/
/* Start inserting metric data. */
$beginTime = $this->startTime();
$this->metric->insertMetricLib($recordWithCode);
$executeTime = $this->endTime($beginTime);
/* 记录度量数据计算和插入的时间。*/
/* Record the time of metric data calculation and insertion. */
$total = 0;
$codes = '';
foreach($recordWithCode as $code => $records)
@@ -260,9 +272,13 @@ class metricZen extends metric
}
}
/* 记录度量数据计算的总时间。*/
/* Record the total time of metric data calculation. */
$executeTime = $this->endTime($calcBeginTime);
$this->metric->saveLogs("Calculate all consumed time: {$executeTime} seconds");
/* 开始去重。*/
/* Start deduplication. */
$beginTime = $this->startTime();
$metrics = $this->metric->getExecutableMetric();
foreach($metrics as $code)
@@ -272,7 +288,13 @@ class metricZen extends metric
$executeTime = $this->endTime($deduplicationBeginTime);
$this->metric->saveLogs("Deduplication consumed time: {$executeTime} seconds, the code: $code");
}
/* 重建主键。*/
/* Rebuild the primary key. */
$this->metric->rebuildPrimaryKey();
/* 记录去重的时间。*/
/* Record the time of deduplication. */
$executeTime = $this->endTime($beginTime);
$this->metric->saveLogs("Deduplicate all consumed time: {$executeTime} seconds");
}