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/host/current_process_stats_agent.h" | |
6 | |
7 #include "base/process/process_metrics.h" | |
8 | |
9 namespace remoting { | |
10 | |
11 CurrentProcessStatsAgent::CurrentProcessStatsAgent( | |
12 const std::string& process_name) | |
13 : process_name_(process_name), | |
14 metrics_(base::ProcessMetrics::CreateCurrentProcessMetrics()) {} | |
15 | |
16 CurrentProcessStatsAgent::~CurrentProcessStatsAgent() = default; | |
17 | |
18 protocol::ProcessResourceUsage CurrentProcessStatsAgent::GetResourceUsage() { | |
19 protocol::ProcessResourceUsage current; | |
20 current.set_process_name(process_name_); | |
21 current.set_processor_usage(metrics_->GetPlatformIndependentCPUUsage()); | |
22 current.set_working_set_size(metrics_->GetWorkingSetSize()); | |
23 current.set_pagefile_size(metrics_->GetPagefileUsage()); | |
24 return current; | |
25 } | |
26 | |
27 } // namespace remoting | |
OLD | NEW |