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
126d438c
Commit
126d438c
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Distinguish between high-load / probation / good-before.
Refers to
#36
parent
c8985889
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ATxCommon/Monitoring/Cpu.cs
+9
-3
9 additions, 3 deletions
ATxCommon/Monitoring/Cpu.cs
with
9 additions
and
3 deletions
ATxCommon/Monitoring/Cpu.cs
+
9
−
3
View file @
126d438c
...
...
@@ -110,9 +110,15 @@ namespace ATxCommon.Monitoring
_loadReadings
[
3
]
=
_cpuCounter
.
NextValue
();
_load
=
_loadReadings
.
Average
();
if
(
_loadReadings
[
3
]
>
_limit
)
{
Log
.
Debug
(
"CPU load ({0}) violating limit ({1})!"
,
_loadReadings
[
3
],
_limit
);
_behaving
=
0
;
// TODO: fire callback for violating load limit
if
(
_behaving
>
_probation
)
{
// this means the load was considered as "low" before
// TODO: fire callback for violating load limit
Log
.
Debug
(
"CPU load ({0}) violating limit ({1})!"
,
_loadReadings
[
3
],
_limit
);
}
else
if
(
_behaving
>
0
)
{
// this means we were still in probation, so no need to trigger again...
Log
.
Debug
(
"Resetting behaving counter to 0 (was {0})."
,
_behaving
);
}
_behaving
=
0
;
}
else
{
_behaving
++;
if
(
_behaving
==
_probation
)
{
...
...
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