Release 4.0.0-preview1-00195
[platform/core/csapi/tizenfx.git] / src / Tizen.System.Information / 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 using System.ComponentModel;
23
24 namespace Tizen.System
25 {
26     /// <summary>
27     /// The structure for CPU usage.
28     /// </summary>
29     public class CpuUsage
30     {
31         [EditorBrowsable(EditorBrowsableState.Never)]
32         internal CpuUsage(Interop.RuntimeInfo.CpuUsage usage)
33         {
34             IoWait = usage.IoWait;
35             Nice = usage.IoWait;
36             System = usage.System;
37             User = usage.User;
38         }
39         /// <summary>
40         /// Running time of un-niced user processes (Percent).
41         /// </summary>
42         public double User { get; internal set; }
43         /// <summary>
44         /// Running time of kernel processes (Percent).
45         /// </summary>
46         public double System { get; internal set; }
47         /// <summary>
48         /// Running time of niced user processes (Percent).
49         /// </summary>
50         public double Nice { get; internal set; }
51         /// <summary>
52         /// Time waiting for I/O completion (Percent).
53         /// </summary>
54         public double IoWait { get; internal set; }
55     }
56
57     /// <summary>
58     /// The structure for CPU usage per process.
59     /// </summary>
60     public class ProcessCpuUsage
61     {
62         [EditorBrowsable(EditorBrowsableState.Never)]
63         internal ProcessCpuUsage(Interop.RuntimeInfo.ProcessCpuUsage usage)
64         {
65             UTime = usage.UTime;
66             STime = usage.STime;
67         }
68         /// <summary>
69         /// The amount of time this process has been scheduled in user mode (clock ticks).
70         /// </summary>
71         public uint UTime { get; internal set; }
72         /// <summary>
73         /// The amount of time this process has been scheduled in kernel mode (clock ticks).
74         /// </summary>
75         public uint STime { get; internal set; }
76     }
77 }