datasource-perf.html revision 6e89f0a006cdbb50151504b3107096e365136687
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico<script type="text/javascript" src="/build/yui/yui.js"></script>
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico<p><select id="testSelector"></select> <input type="button" value="Run Test" id="btnRun" disabled=true></p>
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico(function() {
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico filter: "debug",
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico logInclude:{"perf":true},
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico useConsole: true
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico }).use("console", "profiler", "dump", "datasource", function(Y) {
040e298be5b23e77e33309d65449072183c82d5cacspike // Set up the page
040e298be5b23e77e33309d65449072183c82d5cacspike var BTNRUN = Y.get("#btnRun"),
040e298be5b23e77e33309d65449072183c82d5cacspike myConsole = new Y.Console().render();
040e298be5b23e77e33309d65449072183c82d5cacspike BTNRUN.set("disabled", false);
040e298be5b23e77e33309d65449072183c82d5cacspike Y.on("click", function(e){
040e298be5b23e77e33309d65449072183c82d5cacspike }, BTNRUN);
040e298be5b23e77e33309d65449072183c82d5cacspike Y.namespace("example").Perf = function() {
040e298be5b23e77e33309d65449072183c82d5cacspike var selectNode = Y.get("#testSelector"),
040e298be5b23e77e33309d65449072183c82d5cacspike allTests = [];
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico init: function() {
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico this.register("Test DataSource.Local", function() {
040e298be5b23e77e33309d65449072183c82d5cacspike source: ["a","b","c","d"]
040e298be5b23e77e33309d65449072183c82d5cacspike callback = {
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico success: function(o) {},
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico failure: function(e) {}
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico while(i++<100) {
040e298be5b23e77e33309d65449072183c82d5cacspike optionEl.innerHTML = "Test " + index + ": " + testName;
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico Y.log("Starting Test " + whichTest, "info", "perf");
1ef3c8b1b935901dd133c337031a7300334db424JazzyNico Y.log("Test " + whichTest + " completed", "info", "perf");