-- -- Collect memory reference info. -- https://github.com/yaukeywang/LuaMemorySnapshotDump -- -- @filename MemoryReferenceInfo.lua -- @author WangYaoqi -- @date 2016-02-03 -- The global config of the mri. local cConfig = { m_bAllMemoryRefFileAddTime = true, m_bSingleMemoryRefFileAddTime = true, m_bComparedMemoryRefFileAddTime = true } -- Get the format string of date time. local function FormatDateTimeNow() local cDateTime = os.date("*t") local strDateTime = string.format("%04d%02d%02d-%02d%02d%02d", tostring(cDateTime.year), tostring(cDateTime.month), tostring(cDateTime.day), tostring(cDateTime.hour), tostring(cDateTime.min), tostring(cDateTime.sec)) return strDateTime end -- Get the string result without overrided __tostring. local function GetOriginalToStringResult(cObject) if not cObject then return "" end local cMt = getmetatable(cObject) if not cMt then return tostring(cObject) end -- Check tostring override. local strName = "" local cToString = rawget(cMt, "__tostring") if cToString then print('tostring overridden:', tostring(cObject)) --? rawset(cMt, "__tostring", nil) --? strName = tostring(cObject) --? rawset(cMt, "__tostring", cToString) --? else --? strName = tostring(cObject) end strName = tostring(cObject) return strName end -- Create a container to collect the mem ref info results. local function CreateObjectReferenceInfoContainer() -- Create new container. local cContainer = {} -- Contain [table/function] - [reference count] info. local cObjectReferenceCount = {} setmetatable(cObjectReferenceCount, {__mode = "k"}) -- Contain [table/function] - [name] info. local cObjectAddressToName = {} setmetatable(cObjectAddressToName, {__mode = "k"}) -- Set members. cContainer.m_cObjectReferenceCount = cObjectReferenceCount cContainer.m_cObjectAddressToName = cObjectAddressToName -- For stack info. cContainer.m_nStackLevel = -1 cContainer.m_strShortSrc = "None" cContainer.m_nCurrentLine = -1 return cContainer end -- Create a container to collect the mem ref info results from a dumped file. -- strFilePath - The file path. local function CreateObjectReferenceInfoContainerFromFile(strFilePath) -- Create a empty container. local cContainer = CreateObjectReferenceInfoContainer() cContainer.m_strShortSrc = strFilePath -- Cache ref info. local cRefInfo = cContainer.m_cObjectReferenceCount local cNameInfo = cContainer.m_cObjectAddressToName -- Read each line from file. local cFile = assert(io.open(strFilePath, "rb")) for strLine in cFile:lines() do local strHeader = string.sub(strLine, 1, 2) if "--" ~= strHeader then local _, _, strAddr, strName, strRefCount= string.find(strLine, "(.+)\t(.*)\t(%d+)") if strAddr then cRefInfo[strAddr] = strRefCount cNameInfo[strAddr] = strName end end end -- Close and clear file handler. io.close(cFile) cFile = nil return cContainer end -- Create a container to collect the mem ref info results from a dumped file. -- strObjectName - The object name you need to collect info. -- cObject - The object you need to collect info. local function CreateSingleObjectReferenceInfoContainer(strObjectName, cObject) -- Create new container. local cContainer = {} -- Contain [address] - [true] info. local cObjectExistTag = {} setmetatable(cObjectExistTag, {__mode = "k"}) -- Contain [name] - [true] info. local cObj
Publishing build artifacts and logs.
================================================================================
There are many ways you can publish artifacts, both privately and publically.
Methods include:
Sending logs/artifacts through e-mail.
Uploading logs/artifacts to an FTP server.
Uploading logs/artifacts to an rsync server.
Uploading it through good ol HTTP.
Basically, if there's a commandline utility for it, you can use it in the
post/failed.sh scripts. Refer to variables.txt for how to use variables for
organizing artifacts.