Exemplo n.º 1
0
        /// <summary>
        /// Initializes publisher
        /// </summary>
        /// <param name="name">Provider name</param>
        /// <param name="providerRuntime">Provider runtime API</param>
        /// <param name="config">Provider configuration</param>
        /// <returns></returns>
        public async Task Init(string name, IProviderRuntime providerRuntime, IProviderConfiguration config)
        {
            this.Name   = name;
            this.logger = providerRuntime.GetLogger("MongoStatisticsPublisher");

            this.repository = new MongoStatisticsPublisherRepository(config.Properties["ConnectionString"], MongoUrl.Create(config.Properties["ConnectionString"]).DatabaseName);
        }
Exemplo n.º 2
0
 /// <summary>
 /// The Client init.
 /// </summary>
 /// <param name="config">
 /// The config.
 /// </param>
 /// <param name="address">
 /// The address.
 /// </param>
 /// <param name="clientId">
 /// The client id.
 /// </param>
 /// <returns>
 /// The <see cref="Task"/>.
 /// </returns>
 async Task IClientMetricsDataPublisher.Init(ClientConfiguration config, IPAddress address, string clientId)
 {
     this.repository = new MongoStatisticsPublisherRepository(config.DataConnectionString, MongoUrl.Create(config.DataConnectionString).DatabaseName);
 }