annotate Implab/Diagnostics/LogicalOperationScope.cs @ 276:b4e0f81c7425 v3

container configuration docs
author cin
date Sat, 28 Apr 2018 00:11:38 +0300
parents 34df34841225
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
253
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
1 using System;
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
2 using System.Diagnostics;
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
3
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
4 namespace Implab.Diagnostics {
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
5 public class LogicalOperationScope : IDisposable {
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
6 readonly TraceSource m_source;
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
7
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
8 readonly LogicalOperation m_operation;
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
9
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
10 internal LogicalOperationScope(TraceSource source, LogicalOperation operation) {
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
11 m_source = source;
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
12 m_operation = operation;
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
13 }
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
14
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
15 public void Dispose() {
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
16 m_operation.OperationStopwatch.Stop();
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
17 Trace.CorrelationManager.StopLogicalOperation();
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
18 m_source.TraceData(TraceEventType.Information, TraceEventCodes.StopLogicalOperation, m_operation);
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
19 }
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
20 }
34df34841225 Implab.Diagnostics drafts
cin
parents:
diff changeset
21 }