A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
AMO is for modelling and administration as far as I know. Not tracking activity.
This is not correct. AMO can do modelling, administration and tracing. This is the library I use in DAX Studio for capturing server side trace events. It cannot capture XEvents, but it can capture profiler events. So any event you can capture with SQL Profiler can be captured with AMO.
One more thing... You mention the ReadMe.... I have been looking and looking for just a small piece of documentation for this package on the Nuget page.
Where did you find it?
Interesting, I did not realise at the time but when I googled for "XELiveEventStreamer examples" it took me to an older release on nuget which had a readme with example code. The following link https://www.nuget.org/packages/Microsoft.SqlServer.XEvent.XELite/2019.7.2.9# had the sample code below:
static void OutputXELStream(string connectionString, string sessionName)
{
var cancellationTokenSource = new CancellationTokenSource();
var xeStream = new XELiveEventStreamer(connectionString, sessionName);
Console.WriteLine("Press any key to stop listening...");
Task waitTask = Task.Run(() =>
{
Console.ReadKey();
cancellationTokenSource.Cancel();
});
Task readTask = xeStream.ReadEventStream(() =>
{
Console.WriteLine("Connected to session");
return Task.CompletedTask;
},
xevent =>
{
Console.WriteLine(xevent);
Console.WriteLine("");
return Task.CompletedTask;
},
cancellationTokenSource.Token);
try
{
Task.WaitAny(waitTask, readTask);
}
catch (TaskCanceledException)
{
}
if (readTask.IsFaulted)
{
Console.Error.WriteLine("Failed with: {0}", readTask.Exception);
}
}