| 1782 | } |
| 1783 | |
| 1784 | int64_t RuntimeProfile::UnitsPerSecond( |
| 1785 | const Counter* total_counter, const Counter* timer) { |
| 1786 | DCHECK(total_counter->unit() == TUnit::BYTES || total_counter->unit() == TUnit::UNIT); |
| 1787 | DCHECK(timer->unit() == TUnit::TIME_NS); |
| 1788 | |
| 1789 | if (timer->value() == 0) return 0; |
| 1790 | double secs = static_cast<double>(timer->value()) / 1000.0 / 1000.0 / 1000.0; |
| 1791 | return total_counter->value() / secs; |
| 1792 | } |
| 1793 | |
| 1794 | int64_t RuntimeProfile::CounterSum(const vector<Counter*>* counters) { |
| 1795 | int64_t value = 0; |