-
Notifications
You must be signed in to change notification settings - Fork 2
/
Program.cs
39 lines (33 loc) · 1.37 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Threading;
using Akka.Actor;
namespace Akka.Monitoring.NewRelic.Demo
{
internal class Program
{
private static void Main(string[] args)
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Starting up actor system...");
var system = ActorSystem.Create("akka-performance-demo");
var didMonitorRegister = ActorMonitoringExtension.RegisterMonitor(system, new ActorNewRelicMonitor());
Console.WriteLine(didMonitorRegister
? "Successfully registered NewRelic monitor"
: "Failed to register New Relic monitor");
// Start up three sets of Pluto and Charon (reference to I'm Your Moon by Jonathan Coulton)
for (var i = 0; i < 3; i++)
{
var pluto = system.ActorOf<PlutoActor>();
var charon = system.ActorOf<CharonActor>();
charon.Tell(pluto);
}
Console.WriteLine("Waiting 60 seconds so the New Relic agent has time to harvest metrics");
Thread.Sleep(TimeSpan.FromSeconds(60));
Console.WriteLine("Shutting down...");
system.Terminate().Wait();
Console.WriteLine("Shutdown complete");
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
}
}