public override void DoWork(IlluminateDatabase database) { int totalUsers,connectedUsers; using (var masterSession = database.MasterStore.OpenSession()) { RavenQueryStatistics authUserStats; masterSession.Query<AuthUser>() .Statistics(out authUserStats) .ToArray(); totalUsers = authUserStats.TotalResults; RavenQueryStatistics connectedUserStats; masterSession.Query<ConnectedUser>() .Statistics(out connectedUserStats) .ToArray(); connectedUsers = connectedUserStats.TotalResults; } var apiKey = ConfigurationManager.AppSettings.Get("HOSTEDGRAPHITE_APIKEY"); try { using (var client = new GraphiteUdpClient(HostedGraphiteUrl, HostedGraphitePort, apiKey)) { client.Send(_totalUsersMetric, totalUsers); client.Send(_connctedUsersMetric, connectedUsers); } } catch { } }
public void Should_send_to_graphite_udp() { var graphiteUdp = new Graphite.GraphiteUdpClient("metrics.london.ttldev.local"); //graphiteUdp.Send("Test.Owain.Servers.Udp.One", 55, DateTime.Now); //graphiteUdp.Send("Test.Owain.Servers.two.udp", 33, DateTime.Now); //graphiteUdp.Send("Test.Owain.Servers.One.5m", 33, DateTime.Now); //graphiteUdp.Send("Test.Owain.Servers.2m.abc", 33, DateTime.Now); graphiteUdp.Send("Test.Owain1.Servers.Udp.2m", 33, DateTime.Now); graphiteUdp.Send("Test.Owain1.Servers.Udp.1m", 33, DateTime.Now); graphiteUdp.Send("Test.Owain1.Servers.Udpp.1m", 33, DateTime.Now); graphiteUdp.Send("Test.Owain1.Servers.1m.Udp.", 33, DateTime.Now); graphiteUdp.Send("Test.Owain1.Servers.30s.Udp.", 33, DateTime.Now); }
public void Should_send_list_to_graphite_udp() { var graphiteUdp = new Graphite.GraphiteUdpClient("metrics.london.ttldev.local"); var res = new List<IResult>(); var p1 = new Result("name", DateTime.Now, "test.path1"); p1.SetValue(20); var p2 = new Result("name", DateTime.Now, "test.path2"); p2.SetValue(20); var p3 = new Result("name", DateTime.Now, "test.path3"); p3.SetValue(30); res.Add(p1); //res.Add(p2); //res.Add(p3); graphiteUdp.Send(new GraphiteMetrics(res)); }
public override void Send(IList<IResult> result) { var client = new Graphite.GraphiteUdpClient(Hostname, Port); var gs = new GraphiteMetrics(result); client.Send(gs); }
public override void Send(IResult result) { var client = new Graphite.GraphiteUdpClient(Hostname, Port); client.Send(result.FullPath, result.Value, result.TimeStamp); }