| 33 | } |
| 34 | |
| 35 | void TableLiveStatistics::update(TimelineStatistics const& data) |
| 36 | { |
| 37 | auto timepoint = std::chrono::steady_clock::now(); |
| 38 | |
| 39 | if (!_currentDataTimepoint.has_value()) { |
| 40 | _currentData = data; |
| 41 | _currentDataTimepoint = timepoint; |
| 42 | return; |
| 43 | } |
| 44 | |
| 45 | auto duration = static_cast<int>(std::chrono::duration_cast<std::chrono::milliseconds>(timepoint - *_currentDataTimepoint).count()); |
| 46 | if (duration > TimeInterval) { |
| 47 | _lastData = _currentData; |
| 48 | _lastDataTimepoint = _currentDataTimepoint; |
| 49 | |
| 50 | _currentData = data; |
| 51 | _currentDataTimepoint = timepoint; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | float TableLiveStatistics::calcObjectsPerSecond(ColorVector<uint64_t> const& lastCount, ColorVector<uint64_t> const& currentCount) const |
| 56 | { |
nothing calls this directly
no outgoing calls
no test coverage detected