Removing accidental duplicate code
This commit is contained in:
parent
702a44efc3
commit
42324ab9da
1 changed files with 2 additions and 39 deletions
|
@ -58,41 +58,6 @@ namespace Microsoft.DotNet.Cli
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_isCollectingTelemetry = true;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
//initialize in task to offload to parallel thread
|
|
||||||
_trackEventTask = Task.Factory.StartNew(() => InitializeTelemetry());
|
|
||||||
}
|
|
||||||
catch(Exception)
|
|
||||||
{
|
|
||||||
Debug.Fail("Exception during telemetry task initialization");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void TrackEvent(string eventName, IList<string> properties, IDictionary<string, double> measurements)
|
|
||||||
{
|
|
||||||
if (!_isCollectingTelemetry)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_trackEventTask = _trackEventTask.ContinueWith(
|
|
||||||
x => TrackEventTask(eventName,
|
|
||||||
properties,
|
|
||||||
measurements)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
catch(Exception)
|
|
||||||
{
|
|
||||||
Debug.Fail("Exception during telemetry task continuation");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void InitializeTelemetry()
|
|
||||||
{
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (PerfTrace.Current.CaptureTiming())
|
using (PerfTrace.Current.CaptureTiming())
|
||||||
|
@ -101,11 +66,9 @@ namespace Microsoft.DotNet.Cli
|
||||||
_trackEventTask = Task.Factory.StartNew(() => InitializeTelemetry());
|
_trackEventTask = Task.Factory.StartNew(() => InitializeTelemetry());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch(Exception)
|
||||||
{
|
{
|
||||||
// we dont want to fail the tool if telemetry fais. We should be able to detect abnormalities from data
|
Debug.Fail("Exception during telemetry task initialization");
|
||||||
// at the server end
|
|
||||||
Debug.Fail("Exception during telemetry initialization");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue