Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
bbdb7730
Commit
bbdb7730
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Remove unused method GetCpuUsage.
Refers to
#36
parent
2ce97b73
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ATxCommon/SystemChecks.cs
+0
-23
0 additions, 23 deletions
ATxCommon/SystemChecks.cs
with
0 additions
and
23 deletions
ATxCommon/SystemChecks.cs
+
0
−
23
View file @
bbdb7730
...
...
@@ -32,29 +32,6 @@ namespace ATxCommon
return
-
1
;
}
/// <summary>
/// Get the CPU usage in percent over all cores.
/// </summary>
/// <returns>CPU usage in percent or -1 if an error occured.</returns>
public
static
int
GetCpuUsage
()
{
// TODO: fix bug #36
try
{
var
searcher
=
new
ManagementObjectSearcher
(
"select * from Win32_PerfFormattedData_PerfOS_Processor"
);
foreach
(
var
mo
in
searcher
.
Get
())
{
var
obj
=
(
ManagementObject
)
mo
;
var
usage
=
obj
[
"PercentProcessorTime"
];
var
name
=
obj
[
"Name"
];
if
(
name
.
ToString
().
Equals
(
"_Total"
))
return
Convert
.
ToInt32
(
usage
);
}
}
catch
(
Exception
ex
)
{
Log
.
Warn
(
"Error in GetCpuUsage: {0}"
,
ex
.
Message
);
}
return
-
1
;
}
/// <summary>
/// Get the free space of a drive in bytes.
/// </summary>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment