e3b28d83c78dd06c9ad1f7588d95520195ff3bb6
[platform/core/csapi/system.git] / Tizen.System / RuntimeInfo / CpuUsage.cs
1 /*
2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 using System;
18 using System.Collections.Generic;
19 using System.Linq;
20 using System.Text;
21 using System.Threading.Tasks;
22
23 namespace Tizen.System
24 {
25     /// <summary>
26     /// Structure for cpu usage.
27     /// </summary>
28     public class CpuUsage
29     {
30         internal CpuUsage(Interop.RuntimeInfo.CpuUsage usage)
31         {
32             IoWait = usage.IoWait;
33             Nice = usage.IoWait;
34             System = usage.System;
35             User = usage.User;
36         }
37         /// <summary>
38         /// Time running un-niced user processes (Percent)
39         /// </summary>
40         public double User { get; internal set; }
41         /// <summary>
42         /// Time running kernel processes (Percent)
43         /// </summary>
44         public double System { get; internal set; }
45         /// <summary>
46         /// Time running niced user processes (Percent)
47         /// </summary>
48         public double Nice { get; internal set; }
49         /// <summary>
50         /// Time waiting for I/O completion (Percent)
51         /// </summary>
52         public double IoWait { get; internal set; }
53     }
54
55     /// <summary>
56     /// Structure for cpu usage per processes
57     /// </summary>
58     public class ProcessCpuUsage
59     {
60         internal ProcessCpuUsage(Interop.RuntimeInfo.ProcessCpuUsage usage)
61         {
62             UTime = usage.UTime;
63             STime = usage.STime;
64         }
65         /// <summary>
66         /// Amount of time that this process has been scheduled in user mode (clock ticks)
67         /// </summary>
68         public uint UTime { get; internal set; }
69         /// <summary>
70         /// Amount of time that this process has been scheduled in kernel mode (clock ticks)
71         /// </summary>
72         public uint STime { get; internal set; }
73     }
74 }