-
Notifications
You must be signed in to change notification settings - Fork 150
/
Program.cs
42 lines (35 loc) · 1.29 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
40
41
42
using System;
using System.Diagnostics;
using Metrics.Samples;
using Metrics.Utils;
using Nancy.Hosting.Self;
using Newtonsoft.Json;
namespace NancyFx.Sample
{
class Program
{
static void Main(string[] args)
{
JsonConvert.DefaultSettings = () => new JsonSerializerSettings { Formatting = Formatting.Indented };
using (ActionScheduler scheduler = new ActionScheduler())
using (var host = new NancyHost(new Uri("http://localhost:8090")))
{
host.Start();
Console.WriteLine("Nancy Running at http://localhost:8090");
Console.WriteLine("Press any key to exit");
Process.Start("http://localhost:8090/metrics/");
SampleMetrics.RunSomeRequests();
scheduler.Start(TimeSpan.FromMilliseconds(500), () =>
{
SetCounterSample.RunSomeRequests();
SetMeterSample.RunSomeRequests();
UserValueHistogramSample.RunSomeRequests();
UserValueTimerSample.RunSomeRequests();
SampleMetrics.RunSomeRequests();
});
HealthChecksSample.RegisterHealthChecks();
Console.ReadKey();
}
}
}
}