aboutsummaryrefslogtreecommitdiff
path: root/serialize_lib/serialize.lua
Commit message (Collapse)AuthorAge
* Merge commit 'd4593491efbcab47efd918d7918b97b4621828b3'orwell962021-05-03
|
* Update serialize_liborwell962021-04-04
|
* Add 'serialize_lib/' from commit 'a6e8b8b4353863ad563a4d5187f40fea702ea2de'orwell962021-03-13
| | | | | | git-subtree-dir: serialize_lib git-subtree-mainline: b82e10051d69730b7459cceae4e4e8719b4445d0 git-subtree-split: a6e8b8b4353863ad563a4d5187f40fea702ea2de
* Remove serialize_lib in order to re-add it as subtreeorwell962021-03-13
|
* Fix serialisation: breach of contract, file left openBlockhead2021-01-18
| | | | Previous commit did not fix saving, but is kept because there is a corner case for which it is required (see MT forum)
* Some more serializer fixes (backported from new_lzb):orwell962021-01-12
| | | | | | - Move DUMP_DEBUG_SAVE block before the actual saving so it can be used to trace serializer errors - Don't crash on functions in data, ignore them silently - Increase the save interval
* serialize_lib: Allow empty strings in keyorwell962021-01-12
|
* Serialize_lib: finish up and add atomic apiorwell962021-01-12
|
* Implement basic serialization and file openingorwell962021-01-12
an>(); void add(const std::string &name, float value); void avg(const std::string &name, float value); void clear(); float getValue(const std::string &name) const; int getAvgCount(const std::string &name) const; u64 getElapsedMs() const; typedef std::map<std::string, float> GraphValues; // Returns the line count int print(std::ostream &o, u32 page = 1, u32 pagecount = 1); void getPage(GraphValues &o, u32 page, u32 pagecount); void graphAdd(const std::string &id, float value) { MutexAutoLock lock(m_mutex); std::map<std::string, float>::iterator i = m_graphvalues.find(id); if(i == m_graphvalues.end()) m_graphvalues[id] = value; else i->second += value; } void graphGet(GraphValues &result) { MutexAutoLock lock(m_mutex); result = m_graphvalues; m_graphvalues.clear(); } void remove(const std::string& name) { MutexAutoLock lock(m_mutex); m_avgcounts.erase(name); m_data.erase(name); } private: std::mutex m_mutex; std::map<std::string, float> m_data; std::map<std::string, int> m_avgcounts; std::map<std::string, float> m_graphvalues; u64 m_start_time; }; enum ScopeProfilerType{ SPT_ADD, SPT_AVG, SPT_GRAPH_ADD };