예제 #1
0
        }
    }
    foreach ($arID as $ID) {
        if (strlen($ID) <= 0) {
            continue;
        }
        $ID = intval($ID);
        switch ($_REQUEST['action']) {
            case "delete":
                CPerfomanceHistory::Delete($ID);
                break;
        }
    }
}
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => GetMessage("PERFMON_HIST_ID"), "align" => "right", "default" => true), array("id" => "TIMESTAMP_X", "content" => GetMessage("PERFMON_HIST_TIMESTAMP_X"), "align" => "right", "default" => true), array("id" => "TOTAL_MARK", "content" => GetMessage("PERFMON_HIST_TOTAL_MARK"), "align" => "right", "default" => true), array("id" => "ACCELERATOR_ENABLED", "content" => GetMessage("PERFMON_HIST_ACCELERATOR_ENABLED"), "align" => "right", "default" => true)));
$cData = new CPerfomanceHistory();
$rsData = $cData->GetList(array("ID" => "DESC"));
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("PERFMON_HIST_PAGE")));
while ($arRes = $rsData->NavNext(true, "f_")) {
    $row =& $lAdmin->AddRow($f_ID, $arRes);
    if ($_REQUEST["mode"] == "excel") {
        $row->AddViewField("TOTAL_MARK", number_format($f_TOTAL_MARK, 2, ".", ""));
    } else {
        $row->AddViewField("TOTAL_MARK", str_replace(" ", "&nbsp;", number_format($f_TOTAL_MARK, 2, ".", " ")));
    }
    $row->AddCheckField("ACCELERATOR_ENABLED", false);
    $arActions = array();
    if ($RIGHT >= "W") {
        $arActions[] = array("ICON" => "delete", "DEFAULT" => "Y", "TEXT" => GetMessage("PERFMON_HIST_DELETE"), "ACTION" => "if(confirm('" . GetMessageJS('PERFMON_HIST_DELETE_CONFIRM') . "')) " . $lAdmin->ActionDoGroup($f_ID, "delete"));
예제 #2
0
    /** @global CUser $USER */
    IncludeModuleLangFile(__FILE__);
    if ($_REQUEST["last"] === "Y" && isset($_SESSION["PERFMON_TIMES"]) && is_array($_SESSION["PERFMON_TIMES"]) && count($_SESSION["PERFMON_TIMES"]) > 0 && check_bitrix_sessid() && $APPLICATION->GetGroupRight("perfmon") >= "W") {
        $sec_per_page = number_format(array_sum($_SESSION["PERFMON_TIMES"]) / doubleval(count($_SESSION["PERFMON_TIMES"])), 4, ".", " ");
        COption::SetOptionString("perfmon", "mark_php_page_time", $sec_per_page);
        $result = number_format(doubleval(count($_SESSION["PERFMON_TIMES"])) / array_sum($_SESSION["PERFMON_TIMES"]), 2, ".", " ");
        COption::SetOptionString("perfmon", "mark_php_page_rate", $result);
        COption::SetOptionString("perfmon", "mark_php_page_date", ConvertTimeStamp(false, "FULL"));
        if (CModule::IncludeModule('perfmon')) {
            $ACCELERATOR_ENABLED = "N";
            foreach (CPerfomanceMeasure::GetAllAccelerators() as $accel) {
                if ($accel->IsWorking()) {
                    $ACCELERATOR_ENABLED = "Y";
                }
            }
            CPerfomanceHistory::Add($a = array("TOTAL_MARK" => round(doubleval(count($_SESSION["PERFMON_TIMES"])) / array_sum($_SESSION["PERFMON_TIMES"]), 2), "ACCELERATOR_ENABLED" => $ACCELERATOR_ENABLED));
        }
        ?>
<script>
			BX('mark_result_in_note').innerHTML = '<b><?php 
        echo GetMessage("PERFMON_PANEL_MARK_RESULT", array("#result#" => $result)), "<span class=\"required\"><sup>1</sup></span>";
        ?>
</b>';
			BX('page_rate_result').innerHTML = '<b><?php 
        echo $result;
        ?>
</b>';
			BX('page_time_result').innerHTML = '<?php 
        echo $sec_per_page;
        ?>
';