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
4ebb8ee0
Commit
4ebb8ee0
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Remove WmiSummary method.
parent
b759c7ab
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ATxCommon/SystemChecks.cs
+0
-35
0 additions, 35 deletions
ATxCommon/SystemChecks.cs
ATxService/AutoTx.cs
+1
-2
1 addition, 2 deletions
ATxService/AutoTx.cs
with
1 addition
and
37 deletions
ATxCommon/SystemChecks.cs
+
0
−
35
View file @
4ebb8ee0
...
@@ -103,41 +103,6 @@ namespace ATxCommon
...
@@ -103,41 +103,6 @@ namespace ATxCommon
return
-
1
;
return
-
1
;
}
}
/// <summary>
/// Validate the WMI query methods work correctly and create a summary or warning message.
/// </summary>
/// <returns>A summary with current readings from WMI or a warning message.</returns>
public
static
string
WmiSummary
()
{
var
failed
=
new
List
<
string
>();
var
load
=
GetCpuUsage
();
var
free
=
GetFreeMemory
();
var
summary
=
$"CPU load:
{
load
}
\n"
+
$"Free system memory:
{
Conv
.
MegabytesToString
(
free
)}
\n"
;
Log
.
Warn
(
summary
);
if
(
load
==
-
1
)
{
failed
.
Add
(
"CPU load"
);
}
if
(
free
==
-
1
)
{
failed
.
Add
(
"free RAM"
);
}
if
(
failed
.
Count
>
0
)
{
summary
=
"*******************************************************\n"
+
"WARNING: Checking system parameters via WMI failed for:\n"
;
foreach
(
var
property
in
failed
)
{
summary
+=
$" -
{
property
}
\n"
;
}
summary
+=
"\n"
+
"-------------------------------------------------------\n"
+
"Limits configured for these properties will be IGNORED!\n"
+
"-------------------------------------------------------\n\n"
;
Log
.
Error
(
summary
);
}
return
summary
;
}
/// <summary>
/// <summary>
/// Get the free space of a drive in bytes.
/// Get the free space of a drive in bytes.
/// </summary>
/// </summary>
...
...
This diff is collapsed.
Click to expand it.
ATxService/AutoTx.cs
+
1
−
2
View file @
4ebb8ee0
...
@@ -360,8 +360,7 @@ namespace ATxService
...
@@ -360,8 +360,7 @@ namespace ATxService
msg
+=
"\n------ Current system parameters ------\n"
+
msg
+=
"\n------ Current system parameters ------\n"
+
"Hostname: "
+
Environment
.
MachineName
+
"\n"
+
$"Hostname:
{
Environment
.
MachineName
}
\n"
;
SystemChecks
.
WmiSummary
();
foreach
(
var
driveToCheck
in
_config
.
SpaceMonitoring
)
{
foreach
(
var
driveToCheck
in
_config
.
SpaceMonitoring
)
{
msg
+=
"Free space on drive '"
+
driveToCheck
.
DriveName
+
"': "
+
msg
+=
"Free space on drive '"
+
driveToCheck
.
DriveName
+
"': "
+
...
...
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