From 8b712932a4d9322117d21913d380d7e513bfb98f Mon Sep 17 00:00:00 2001 From: liyang Date: Wed, 18 Dec 2024 13:56:11 +0800 Subject: [PATCH] * [task#134816] add count of compile pipeline metric. --- .../system/rate/count_of_compile_pipeline.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/module/metric/calc/system/rate/count_of_compile_pipeline.php b/module/metric/calc/system/rate/count_of_compile_pipeline.php index b4a1dd5816..c53b6a287b 100644 --- a/module/metric/calc/system/rate/count_of_compile_pipeline.php +++ b/module/metric/calc/system/rate/count_of_compile_pipeline.php @@ -18,3 +18,22 @@ * @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html) * @Link https://www.zentao.net */ +class count_of_compile_pipeline extends baseCalc +{ + public $dataset = 'getCompile'; + + public $fieldList = array('t1.id'); + + public $result = 0; + + public function calculate($row) + { + $this->result += 1; + } + + public function getResult($options = array()) + { + $records = array(array('value' => $this->result)); + return $this->filterByOptions($records, $options); + } +}