This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
appleCake.setThreadName("Server network") | |
-- Sets the name for the current thread, making it easier to identity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
appleCake.setName("EpicGame4004") | |
-- sets the process and current threads name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
appleCake.enable() -- enable everything | |
appleCake.enable("all") | |
appleCake.enable("none") -- disable everything | |
appleCake.enable("profile") -- only enable profiles | |
appleCake.enable("mark") -- only enable marks | |
appleCake.enable("counter") -- only enable counters | |
appleCake.enable(appleCake.enableLevels["profile"] + appleCake.enableLevels["mark"]) -- enable only profiles and marks, disable counters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local jprof = appleCake.jprof | |
jprof.write() | |
jprof.write("profile.json") | |
jprof.write("profile-4/4/4-04:44.json") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local jprof = appleCake.jprof | |
jprof.push("frame") | |
jprof.push("update") | |
jprof.popAll() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local jprof = appleCake.jprof | |
jprof.pop("Foo") | |
jprof.pop("Bar") | |
jprof.pop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local appleCake = require("lib.AppleCake")(true) | |
local jprof = appleCake.jprof | |
appleCake.beginSession() -- or jprof.START(), if you want to only use the jprof table | |
function love.run() | |
love.load(love.arg.parseGameArguments(arg), arg) | |
love.timer.step() | |
local dt = 0 | |
return function() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local jprof = appleCake.jprof | |
jprof.push("Foo") | |
jprof.push("Foo", "Bar") | |
jprof.push("Foo", love.graphics.getStats()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local counter -- Recommedned to reuse tables for commonly used counters | |
function state:update(dt) | |
counter = appleCake.counter("State", {"value"=self.value, "valueZ"=self.valueZ}, counter) -- You can create overlapping bar graphs | |
end | |
-- record memory each update | |
local memory | |
function love.update(dt) | |
memory = appleCake.counter("Memory", {"kb"=collectgarbage("count")}, memory) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local timer = 0 | |
local sinCounter | |
function love.update(dt) | |
timer = timer + dt | |
sinCounter = appleCake.counter("sin", {sin=math.sin(timer)}, sinCounter) | |
if timer > 0.1 then | |
appleCake.counter("memory", {memory=collectgarbage("count")}) | |
timer = 0 |