Skip to content

Commit 2631816

Browse files
committed
PR 35: Updated to add more relevent data to log +semver:minor
- Updated to add more relevent data to log +semver:minor
1 parent 4305edf commit 2631816

File tree

2 files changed

+29
-6
lines changed

2 files changed

+29
-6
lines changed

TfsWitMigrator.Console/Program.cs

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,41 @@ class RunOptions
4040

4141
static int Main(string[] args)
4242
{
43+
Telemetry.Current.TrackEvent("ApplicationStart");
44+
DateTime startTime = DateTime.Now;
45+
Stopwatch mainTimer = new Stopwatch();
46+
mainTimer.Start();
47+
//////////////////////////////////////////////////
4348
Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
4449
Trace.Listeners.Add(new TextWriterTraceListener(string.Format(@"{0}-{1}.log", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"), "MigrationRun"), "myListener"));
4550
//////////////////////////////////////////////////
46-
Stopwatch stopwatch = new Stopwatch();
47-
stopwatch.Start();
51+
Trace.WriteLine(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name);
52+
Trace.WriteLine(System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
53+
Trace.WriteLine(string.Format("Telemitery Enabled: {0}", Telemetry.Current.IsEnabled().ToString()));
54+
Trace.WriteLine(string.Format("SessionID: {0}", Telemetry.Current.Context.Session.Id));
55+
Trace.WriteLine(string.Format("User: {0}", Telemetry.Current.Context.User.Id));
56+
Trace.WriteLine(string.Format("Start Time: {0}", startTime.ToUniversalTime()));
57+
Trace.WriteLine("----------------------------------------------------------------");
58+
Trace.WriteLine("------------------------------START-----------------------------");
59+
Trace.WriteLine("----------------------------------------------------------------");
4860
//////////////////////////////////////////////////
4961
int result = (int)Parser.Default.ParseArguments<InitOptions, RunOptions>(args).MapResult(
5062
(InitOptions opts) => RunInitAndReturnExitCode(opts),
5163
(RunOptions opts) => RunExecuteAndReturnExitCode(opts),
5264
errs => 1);
5365
//////////////////////////////////////////////////
54-
Console.WriteLine();
55-
Console.WriteLine("Freedom");
56-
Console.ReadKey();
66+
Trace.WriteLine("----------------------------------------------------------------");
67+
Trace.WriteLine("-------------------------------END------------------------------");
68+
Trace.WriteLine("----------------------------------------------------------------");
69+
mainTimer.Stop();
70+
Telemetry.Current.TrackEvent("ApplicationEnd", null,
71+
new Dictionary<string, double> {
72+
{ "ApplicationDuration", mainTimer.ElapsedMilliseconds }
73+
});
74+
Telemetry.Current.Flush();
75+
76+
Trace.WriteLine(string.Format("Duration: {0}", mainTimer.Elapsed.ToString("c")));
77+
Trace.WriteLine(string.Format("End Time: {0}", startTime.ToUniversalTime()));
5778
return result;
5879
}
5980

TfsWitMigrator.Core/_VSTS.DataBulkEditor.Engine.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@
326326
</ItemGroup>
327327
<ItemGroup>
328328
<None Include="app.config" />
329-
<None Include="ApplicationInsights.config" />
329+
<None Include="ApplicationInsights.config">
330+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
331+
</None>
330332
<None Include="packages.config" />
331333
<None Include="_VSTS.DataBulkEditor.Engine.nuspec" />
332334
</ItemGroup>

0 commit comments

Comments
 (0)