Ejemplo n.º 1
0
        public void Points_are_written_to_database_passed_into_options()
        {
            const string databaseName = "databaseName";
            var          observer     = new InfluxDbObserver(new MetricMonitorRegistryPoller(DefaultMonitorRegistry.Instance), influxDbClient,
                                                             new InfluxDbObserverOptions(databaseName));

            observer.Update(new[] { new Metric("name", DateTimeOffset.UtcNow, new Tag[0], 0, new Metric[0]) });

            influxDbClient.Received(1).WriteAsync(Arg.Any <string>(), databaseName, Arg.Is <IEnumerable <Point> >(x => x.All(y => y.Measurement == "name")));
        }