All Downloads are FREE. Search and download functionalities are using the official Maven repository.

SLING-INF.content.tests.speed.fireunit.main.js Maven / Gradle / Ivy

$(function() {
    var pageArray = [
        "/dev/my_sakai.html",
        "/dev/inbox.js",
        "/~user1",
        "/dev/directory.html",
        "/dev/profile_edit.html",
        "/dev/account_preferences.html",
        "/dev/search_people.html#q=*&facet=contacts",
        "/dev/search.html#q=user"
    ];

    var currentPage = "", activePage = "";
    var runProfiler = function(page) {
        console.log("starting profile on ", page);
        console.profile();
        $("#ifr").attr("src", page);
        $("#ifr").unbind("load");
        $("#ifr").bind("load", function() {
            // sometimes load event is fired twice, not sure why
            if (activePage === currentPage) {
                return;
            }
            activePage = currentPage;
            setTimeout(function() {
                console.profileEnd();
                var profile = fireunit.getProfile();
                var res = [];
                for (var i=0,j=profile.data.length; i 30 || fn.time > 100)) {
                        res.push(fn);
                    }
                }
                for (var x=0,y=res.length; x" + currentPage + "" + sfn.name + "" + sfn.fileName + "" + sfn.calls + "" + sfn.ownTime + "" + sfn.time + "" + sfn.maxTime + "" + sfn.avgTime + "");
                }
                currentPage = pageArray.pop();
                if (currentPage) {
                    runProfiler(currentPage);
                } else {
                    var data = $("table").html();
                    // POST results to the format_results_server
                    $.ajax({
                        url: "http://localhost:4567/",
                        type: "POST",
                        data: data,
                        contentType: "text/plain",
                        success: function(data) {
                            console.log("posted data successfully");
                        },
                        error: function() {
                            console.log("error posting data");
                        }
                    });
                }
            }, 10000);
        });
    };
    currentPage = pageArray.pop();
    runProfiler(currentPage);
});





© 2015 - 2025 Weber Informatics LLC | Privacy Policy