wip: 🧠 初步的框架

This commit is contained in:
tk
2023-08-25 15:33:42 +08:00
parent 57c1ba2002
commit 18b4d7547a
1014 changed files with 122380 additions and 2 deletions

View File

@@ -0,0 +1,28 @@
namespace NetAdmin.Domain.Events;
/// <summary>
/// Sql命令执行后事件
/// </summary>
public sealed record SqlCommandAfterEvent : SqlCommandBeforeEvent
{
/// <summary>
/// Initializes a new instance of the <see cref="SqlCommandAfterEvent" /> class.
/// </summary>
public SqlCommandAfterEvent(CommandAfterEventArgs e) //
: base(e)
{
ElapsedMicroseconds = (long)((double)e.ElapsedTicks / Stopwatch.Frequency * 1_000_000);
EventId = nameof(SqlCommandAfterEvent);
}
/// <summary>
/// 耗时(单位:微秒)
/// </summary>
public long ElapsedMicroseconds { get; set; }
/// <inheritdoc />
public override string ToString()
{
return string.Format(CultureInfo.InvariantCulture, "SQL-{0}: {2} us {1}", Id, Sql, ElapsedMicroseconds);
}
}