Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CoFlow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sandra Borst
CoFlow
Commits
cd79087c
Commit
cd79087c
authored
6 months ago
by
Philipp Müller
Browse files
Options
Downloads
Patches
Plain Diff
add a dummy value to the distraction and total time to allow starting in stage 4 instead of 1
parent
7a606e6f
No related branches found
Branches containing commit
No related tags found
1 merge request
!23
add a dummy value to the distraction and total time to allow starting in stage 4 instead of 1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
InnoLabProjektDektopApp/InnoLabProjektDektopApp/Services/ProcessMonitor.cs
+8
-6
8 additions, 6 deletions
...topApp/InnoLabProjektDektopApp/Services/ProcessMonitor.cs
with
8 additions
and
6 deletions
InnoLabProjektDektopApp/InnoLabProjektDektopApp/Services/ProcessMonitor.cs
+
8
−
6
View file @
cd79087c
...
...
@@ -58,10 +58,14 @@ namespace InnoLabProjektDektopApp.Services
public
void
CalculateCurrentDistractionStage
(
DateTime
endTime
)
{
TimeSpan
totalDistractionTime
=
CalculateTotalDistractionTime
();
Debug
.
WriteLine
(
"Total distraction time: {0}"
,
totalDistractionTime
);
double
totalMinutes
=
(
endTime
-
startTime
).
TotalMinutes
;
double
distractedMinutes
=
totalDistractionTime
.
TotalMinutes
;
// Adds a dummy value to the distractedMinutes and totalMinutes so the stage starts in the middle
double
dummyTimeInMinutes
=
8
;
double
totalMinutes
=
(
endTime
-
startTime
).
TotalMinutes
+
2
*
dummyTimeInMinutes
;
double
distractedMinutes
=
totalDistractionTime
.
TotalMinutes
+
dummyTimeInMinutes
;
double
distractionFraction
=
(
distractedMinutes
/
totalMinutes
);
int
stage
=
(
int
)
Math
.
Ceiling
(
distractionFraction
*
7
);
Debug
.
WriteLine
(
$"Distraction stage:
{
stage
}
"
);
...
...
@@ -71,10 +75,8 @@ namespace InnoLabProjektDektopApp.Services
{
var
processName
=
Path
.
GetFileNameWithoutExtension
((
string
)((
ManagementBaseObject
)
e
[
"TargetInstance"
])[
"Name"
]);
if
(
processStartTimes
.
TryGetValue
(
processName
,
out
_
))
{
return
;
}
// Check if the process is already being tracked
if
(
processStartTimes
.
TryGetValue
(
processName
,
out
_
))
return
;
processStartTimes
[
processName
]
=
DateTime
.
Now
;
...
...
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