-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc6ace7
commit 3291651
Showing
3 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using AOPStatistics; | ||
using ConsoleTables; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace TestAOP | ||
{ | ||
[TestClass] | ||
public class TestInitializeAll | ||
{ | ||
[AssemblyInitialize] | ||
public static void Init(TestContext testContext) | ||
{ | ||
Console.WriteLine("test initialize"); | ||
Console.WriteLine("ither clean!"); | ||
} | ||
[AssemblyCleanup] | ||
public static void Clean() | ||
{ | ||
|
||
var table = new ConsoleTable("Class", "Method(Line)", "NumberHit", "TotalTime", "AverageTime"); | ||
if (GatherStatistics.timingMethod.Count == 0) | ||
{ | ||
Console.WriteLine("no statistics loaded"); | ||
return ; | ||
} | ||
var data = GatherStatistics.DataGathered() | ||
.OrderByDescending(it => it.TotalDuration / it.NumberHits) | ||
.ToArray(); | ||
|
||
foreach (var item in data) | ||
{ | ||
table.AddRow(item.m.className, $"{item.m.methodName}({item.m.line})", item.NumberHits, item.TotalDuration, (item.TotalDuration / item.NumberHits)); | ||
} | ||
var s = table.ToStringAlternative(); | ||
File.WriteAllText("statistics.txt", s); | ||
|
||
|
||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.