Commit 29aaddf
authored
Fix measuring duration of processor and command (#3040)
I noticed this when i had my migration run for a long time and at the
end I wanted to know, how long it really took. The migration duration
was zero.
## Processor
Although the log outputs `Duration` of the processor activity, this is
always zero. Its because `Duration` is not dynamic – it does not return
real current duration. Its value is calculated and updated only when
`Stop()` is called.
## Command base
Basically the same problem as in `Processor`, but from the other side.
The activity is stopped immediately after it is started, so it reports
zero duration at the end. Even when the telemetry is disabled, there is
no need to not measure duration of the command. Because even wihout
telemetry, we want to see duration in the log outputs. And `Stop()`
basically does nothing just updates duration.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Refactor**
* Enhanced activity lifecycle management within telemetry and processing
workflows.
* Removed unused code dependencies.
* **Style**
* Minor formatting improvements.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->File tree
2 files changed
+3
-6
lines changed- src
- MigrationTools.Host/Commands
- MigrationTools/Processors/Infrastructure
2 files changed
+3
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
| |||
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
108 | | - | |
| 107 | + | |
109 | 108 | | |
110 | 109 | | |
111 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | | - | |
10 | 8 | | |
11 | | - | |
12 | 9 | | |
13 | 10 | | |
14 | 11 | | |
| |||
139 | 136 | | |
140 | 137 | | |
141 | 138 | | |
| 139 | + | |
142 | 140 | | |
143 | 141 | | |
144 | 142 | | |
| |||
172 | 170 | | |
173 | 171 | | |
174 | 172 | | |
175 | | - | |
| 173 | + | |
0 commit comments