diff options
author | Robin Gareus <robin@gareus.org> | 2017-11-29 12:03:47 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-11-29 12:06:42 +0100 |
commit | 5fd723b1f000da658ee13ae2cf79a0636a2bc0f2 (patch) | |
tree | 90d0243953d87a125240906b095b47a86b8c6206 /libs | |
parent | 77d16999b536364d9a5ef430c36d0ef0863533a7 (diff) |
Update LuaProc GC stat calc
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ardour/luaproc.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc index 9122fb32fb..d5a0f65d1e 100644 --- a/libs/ardour/luaproc.cc +++ b/libs/ardour/luaproc.cc @@ -131,7 +131,8 @@ void LuaProc::init () { #ifdef WITH_LUAPROC_STATS - _stats_avg[0] = _stats_avg[1] = _stats_max[0] = _stats_max[1] = _stats_cnt = 0; + _stats_avg[0] = _stats_avg[1] = _stats_max[0] = _stats_max[1] = 0; + _stats_cnt = -25; #endif lua.tweak_rt_gc (); @@ -746,14 +747,15 @@ LuaProc::connect_and_run (BufferSet& bufs, lua.collect_garbage_step (100 /*kB*/); #ifdef WITH_LUAPROC_STATS - ++_stats_cnt; - int64_t t2 = g_get_monotonic_time (); - int64_t ela0 = t1 - t0; - int64_t ela1 = t2 - t1; - if (ela0 > _stats_max[0]) _stats_max[0] = ela0; - if (ela1 > _stats_max[1]) _stats_max[1] = ela1; - _stats_avg[0] += ela0; - _stats_avg[1] += ela1; + if (++_stats_cnt > 0) { + int64_t t2 = g_get_monotonic_time (); + int64_t ela0 = t1 - t0; + int64_t ela1 = t2 - t1; + if (ela0 > _stats_max[0]) _stats_max[0] = ela0; + if (ela1 > _stats_max[1]) _stats_max[1] = ela1; + _stats_avg[0] += ela0; + _stats_avg[1] += ela1; + } #endif return 0; } |