Exemplo n.º 1
0
 function getDataSource($arOrder, $arFilter, $arSelect)
 {
     return CPerfomanceHit::GetList($arOrder, $arFilter, false, false, $arSelect);
 }
Exemplo n.º 2
0
 function getDataSource($arOrder, $arFilter, $arSelect)
 {
     return CPerfomanceHit::GetList($arOrder, $arFilter, false, array("nPageSize" => CAdminResult::GetNavSize($this->sTableID)), $arSelect);
 }
Exemplo n.º 3
0
$arHeaders = array(array("id" => "IS_ADMIN", "content" => GetMessage("PERFMON_HIT_IS_ADMIN"), "sort" => "IS_ADMIN"), array("id" => "REQUEST_METHOD", "content" => GetMessage("PERFMON_HIT_REQUEST_METHOD"), "sort" => "REQUEST_METHOD"), array("id" => "SERVER_NAME", "content" => GetMessage("PERFMON_HIT_SERVER_NAME"), "sort" => "SERVER_NAME"), array("id" => "SERVER_PORT", "content" => GetMessage("PERFMON_HIT_SERVER_PORT"), "sort" => "SERVER_PORT"), array("id" => "SCRIPT_NAME", "content" => GetMessage("PERFMON_HIT_PAGE"), "sort" => "SCRIPT_NAME", "default" => true), array("id" => "PERCENT", "content" => GetMessage("PERFMON_HIT_PERCENT"), "sort" => "SUM_PAGE_TIME", "align" => "right", "default" => true), array("id" => "REQUEST_URI", "content" => GetMessage("PERFMON_HIT_REQUEST_URI"), "sort" => "REQUEST_URI"), array("id" => "COUNT", "content" => GetMessage("PERFMON_HIT_COUNT"), "sort" => "COUNT", "align" => "right", "default" => true));
$arGrpFuncs = array("MAX", "MIN", "SUM", "AVG");
$arGrpCols = array("INCLUDED_FILES" => 0, "MEMORY_PEAK_USAGE" => 0, "CACHE_SIZE" => 0, "CACHE_COUNT" => 0, "CACHE_COUNT_R" => 0, "CACHE_COUNT_W" => 0, "CACHE_COUNT_C" => 0, "PAGE_TIME" => 4, "PROLOG_TIME" => 4, "AGENTS_TIME" => 4, "WORK_AREA_TIME" => 4, "EPILOG_TIME" => 4, "EVENTS_TIME" => 4, "COMPONENTS" => 0, "COMPONENTS_TIME" => 4, "QUERIES" => 0, "QUERIES_TIME" => 4);
$arDefColumns = array("SUM_PAGE_TIME", "AVG_PAGE_TIME", "AVG_COMPONENTS", "AVG_QUERIES");
foreach ($arGrpCols as $col => $prec) {
    foreach ($arGrpFuncs as $func) {
        $arHeaders[] = array("id" => $func . "_" . $col, "content" => GetMessage("PERFMON_HIT_" . $func . "_" . $col), "sort" => $func . "_" . $col, "align" => "right", "default" => in_array($func . "_" . $col, $arDefColumns));
    }
}
$lAdmin->AddHeaders($arHeaders);
$arSelectedFields = $lAdmin->GetVisibleHeaderColumns();
if (!is_array($arSelectedFields) || count($arSelectedFields) < 1) {
    $arSelectedFields = array("SCRIPT_NAME", "COUNT", "MAX_INCLUDED_FILES", "MAX_MEMORY_PEAK_USAGE", "AVG_QUERIES");
}
$cData = new CPerfomanceHit();
$rsTotal = $cData->GetList(array("COUNT" => "ASC"), $arFilter, true, false, array("COUNT", "SUM_PAGE_TIME"));
$arTotal = $rsTotal->Fetch();
$rsData = $cData->GetList(array($by => $order), $arFilter, true, false, $arSelectedFields);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("PERFMON_HIT_PAGE2")));
$max_display_url = COption::GetOptionInt("perfmon", "max_display_url");
while ($arRes = $rsData->NavNext(true, "f_")) {
    $row =& $lAdmin->AddRow($f_NAME, $arRes);
    $row->AddViewField("SCRIPT_NAME", '<a href="perfmon_hit_list.php?lang=' . LANGUAGE_ID . '&amp;set_filter=Y&amp;find_script_name=' . $f_SCRIPT_NAME . '">' . $f_SCRIPT_NAME . '</a>');
    $page_time = doubleval($arTotal["SUM_PAGE_TIME"]);
    if ($page_time > 0) {
        $row->AddViewField("PERCENT", str_replace(" ", "&nbsp;", number_format($arRes["SUM_PAGE_TIME"] / $page_time * 100, 2, ".", " ")) . "%");
    } else {
        $row->AddViewField("PERCENT", "&nbsp;");
    }
Exemplo n.º 4
0
				<td width="20%" align="center"><?php 
        echo GetMessage("PERFMON_PANEL_DEV_PERCENT");
        ?>
</td>
				<td width="20%" align="center"><?php 
        echo GetMessage("PERFMON_PANEL_DEV_COUNT");
        ?>
</td>
				<td width="20%" align="center"><?php 
        echo GetMessage("PERFMON_PANEL_DEV_AVG_PAGE_TIME");
        ?>
</td>
			</tr>
			<?php 
        $cData = new CPerfomanceHit();
        $rsData = $cData->GetList(array("SUM_PAGE_TIME" => "DESC"), array("=IS_ADMIN" => "N"), true, false, array("SCRIPT_NAME", "COUNT", "SUM_PAGE_TIME", "AVG_PAGE_TIME"));
        $i = 20;
        while (($ar = $rsData->Fetch()) && $i > 0) {
            $ar["PERCENT"] = $ar["SUM_PAGE_TIME"] / $arTotalPage["SUM_PAGE_TIME"] * 100;
            $i--;
            ?>
			<tr>
				<td><a href="perfmon_hit_list.php?lang=<?php 
            echo LANGUAGE_ID;
            ?>
&amp;set_filter=Y&amp;find_script_name=<?php 
            echo urlencode(htmlspecialcharsbx($ar["SCRIPT_NAME"]));
            ?>
"><?php 
            echo $ar["SCRIPT_NAME"];
            ?>
Exemplo n.º 5
0
$lAdmin->AddHeaders($arHeaders);

$arSelectedFields = $lAdmin->GetVisibleHeaderColumns();
if (!is_array($arSelectedFields) || (count($arSelectedFields) < 1))
	$arSelectedFields = array(
		"SCRIPT_NAME",
		"COUNT",
		"MAX_INCLUDED_FILES",
		"MAX_MEMORY_PEAK_USAGE",
		"AVG_QUERIES",
	);


$cData = new CPerfomanceHit;

$rsTotal = $cData->GetList(array("COUNT" => "ASC"), $arFilter, true, false, array("COUNT", "SUM_PAGE_TIME"));
$arTotal = $rsTotal->Fetch();

$rsData = $cData->GetList(
	array($by => $order),
	$arFilter,
	true,
	array("nPageSize" => CAdminResult::GetNavSize($sTableID)),
	$arSelectedFields
);

$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("PERFMON_HIT_PAGE2")));

$max_display_url = COption::GetOptionInt("perfmon", "max_display_url");
    if (!$value) {
        unset($arFilter[$key]);
    }
}
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => GetMessage("PERFMON_HIT_ID"), "sort" => "ID", "align" => "right"), array("id" => "DATE_HIT", "content" => GetMessage("PERFMON_HIT_DATE_HIT"), "sort" => "DATE_HIT", "align" => "right"), array("id" => "IS_ADMIN", "content" => GetMessage("PERFMON_HIT_IS_ADMIN"), "sort" => "IS_ADMIN"), array("id" => "REQUEST_METHOD", "content" => GetMessage("PERFMON_HIT_REQUEST_METHOD"), "sort" => "REQUEST_METHOD"), array("id" => "SERVER_NAME", "content" => GetMessage("PERFMON_HIT_SERVER_NAME"), "sort" => "SERVER_NAME"), array("id" => "SERVER_PORT", "content" => GetMessage("PERFMON_HIT_SERVER_PORT"), "sort" => "SERVER_PORT"), array("id" => "SCRIPT_NAME", "content" => GetMessage("PERFMON_HIT_SCRIPT_NAME"), "sort" => "SCRIPT_NAME"), array("id" => "REQUEST_URI", "content" => GetMessage("PERFMON_HIT_REQUEST_URI2"), "sort" => "REQUEST_URI", "default" => true), array("id" => "PAGE_TIME", "content" => GetMessage("PERFMON_HIT_PAGE_TIME"), "sort" => "PAGE_TIME", "align" => "right", "default" => true), array("id" => "COMPONENTS", "content" => GetMessage("PERFMON_HIT_COMPONENTS"), "sort" => "COMPONENTS", "align" => "right", "default" => true), array("id" => "COMPONENTS_TIME", "content" => GetMessage("PERFMON_HIT_COMPONENTS_TIME"), "sort" => "COMPONENTS_TIME", "align" => "right", "default" => true), array("id" => "INCLUDED_FILES", "content" => GetMessage("PERFMON_HIT_INCLUDED_FILES"), "sort" => "INCLUDED_FILES", "align" => "right"), array("id" => "MEMORY_PEAK_USAGE", "content" => GetMessage("PERFMON_HIT_MEMORY_PEAK_USAGE"), "sort" => "MEMORY_PEAK_USAGE", "align" => "right"), array("id" => "CACHE_SIZE", "content" => GetMessage("PERFMON_HIT_CACHE_SIZE"), "sort" => "CACHE_SIZE", "align" => "right"), array("id" => "QUERIES", "content" => GetMessage("PERFMON_HIT_QUERIES"), "sort" => "QUERIES", "align" => "right", "default" => true), array("id" => "QUERIES_TIME", "content" => GetMessage("PERFMON_HIT_QUERIES_TIME"), "sort" => "QUERIES_TIME", "align" => "right", "default" => true), array("id" => "PROLOG_TIME", "content" => GetMessage("PERFMON_HIT_PROLOG_TIME"), "sort" => "PROLOG_TIME", "align" => "right"), array("id" => "AGENTS_TIME", "content" => GetMessage("PERFMON_HIT_AGENTS_TIME"), "sort" => "AGENTS_TIME", "align" => "right"), array("id" => "WORK_AREA_TIME", "content" => GetMessage("PERFMON_HIT_WORK_AREA_TIME"), "sort" => "WORK_AREA_TIME", "align" => "right"), array("id" => "EPILOG_TIME", "content" => GetMessage("PERFMON_HIT_EPILOG_TIME"), "sort" => "EPILOG_TIME", "align" => "right"), array("id" => "EVENTS_TIME", "content" => GetMessage("PERFMON_HIT_EVENTS_TIME"), "sort" => "EVENTS_TIME", "align" => "right")));
$arSelectedFields = $lAdmin->GetVisibleHeaderColumns();
if (!is_array($arSelectedFields) || count($arSelectedFields) < 1) {
    $arSelectedFields = array("ID", "DATE_HIT", "REQUEST_URI", "INCLUDED_FILES", "MEMORY_PEAK_USAGE", "QUERIES");
}
$arSelectedFields[] = "ID";
$arSelectedFields[] = "SQL_LOG";
$arSelectedFields[] = "SERVER_NAME";
$arSelectedFields[] = "SERVER_PORT";
$arNumCols = array("INCLUDED_FILES" => 0, "MEMORY_PEAK_USAGE" => 0, "CACHE_SIZE" => 0, "QUERIES_TIME" => 4, "PAGE_TIME" => 4, "PROLOG_TIME" => 4, "AGENTS_TIME" => 4, "WORK_AREA_TIME" => 4, "EPILOG_TIME" => 4, "EVENTS_TIME" => 4, "COMPONENTS_TIME" => 4);
$cData = new CPerfomanceHit();
$rsData = $cData->GetList(array($by => $order), $arFilter, false, false, $arSelectedFields);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("PERFMON_HIT_PAGE")));
$max_display_url = COption::GetOptionInt("perfmon", "max_display_url");
while ($arRes = $rsData->NavNext(true, "f_")) {
    $row =& $lAdmin->AddRow($f_NAME, $arRes);
    $row->AddViewField("IS_ADMIN", $f_IS_ADMIN == "Y" ? GetMessage("MAIN_YES") : GetMessage("MAIN_NO"));
    $row->AddViewField("DATE_HIT", str_replace(" ", "&nbsp;", $f_FULL_DATE_HIT));
    foreach ($arNumCols as $column_name => $precision) {
        if ($_REQUEST["mode"] == "excel") {
            $row->AddViewField($column_name, number_format($arRes[$column_name], $precision, ".", ""));
        } else {
            $row->AddViewField($column_name, str_replace(" ", "&nbsp;", number_format($arRes[$column_name], $precision, ".", " ")));
        }
    }