Source
* The call stack can be obtained from Exception::getTrace() or from an API result debug stack trace. If no call
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
class CProfiler {
/**
* Determines time for single sql query to be considered slow.
*
* @var float
*/
protected $slowSqlQueryTime = 0.01;
/**
* Determines time for single Elasticsearch query to be considered slow.
*
* @var float
*/
protected $slowElasticQueryTime = 0.01;
/**
* Contains all api requests info.
*
* @var array
*/
protected $apiLog = [];
/**
* Contains SQL queries info.
*
* @var array
*/
protected $sqlQueryLog = [];
/**
* Contains Elasticsearch queries info.
*
* @var array
*/
protected $elasticQueryLog = [];
/**
* Total time of all performed sql queries.
*
* @var float
*/
protected $sqlTotalTime = 0.0;
/**
* Total time of all performed Elasticsearch queries.
*