| 145 | } |
| 146 | |
| 147 | void session_view::update_counters(span<std::int64_t const> stats_counters |
| 148 | , lt::clock_type::time_point const t) |
| 149 | { |
| 150 | // only update the previous counters if there's been enough |
| 151 | // time since it was last updated |
| 152 | if (t - m_timestamp[1] > lt::seconds(2)) |
| 153 | { |
| 154 | m_cnt[1].swap(m_cnt[0]); |
| 155 | m_timestamp[1] = m_timestamp[0]; |
| 156 | } |
| 157 | |
| 158 | m_cnt[0].assign(stats_counters.begin(), stats_counters.end()); |
| 159 | m_timestamp[0] = t; |
| 160 | render(); |
| 161 | } |
| 162 |