OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "remoting/base/current_process_stats_agent.h" |
| 6 |
| 7 namespace remoting { |
| 8 |
| 9 CurrentProcessStatsAgent::CurrentProcessStatsAgent( |
| 10 const std::string& process_name) |
| 11 : process_name_(process_name), |
| 12 metrics_(base::ProcessMetrics::CreateCurrentProcessMetrics()) {} |
| 13 |
| 14 CurrentProcessStatsAgent::~CurrentProcessStatsAgent() = default; |
| 15 |
| 16 protocol::ProcessResourceUsage CurrentProcessStatsAgent::GetResourceUsage() { |
| 17 protocol::ProcessResourceUsage current; |
| 18 current.set_process_name(process_name_); |
| 19 current.set_processor_usage(metrics_->GetPlatformIndependentCPUUsage()); |
| 20 current.set_working_set_size(metrics_->GetWorkingSetSize()); |
| 21 current.set_pagefile_size(metrics_->GetPagefileUsage()); |
| 22 return current; |
| 23 } |
| 24 |
| 25 } // namespace remoting |
OLD | NEW |