示例#1
0
 public static BeatPulseContext AddVirtualMemorySizeLiveness(this BeatPulseContext context, long maximumMemoryBytes, string name = Constants.VirtualMemorySizeLiveness, string defaultPath = "virtualmemorysize")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UseLiveness(new MaximumValueLiveness <long>(maximumMemoryBytes, () => Process.GetCurrentProcess().VirtualMemorySize64));
     }));
 }
示例#2
0
 public static BeatPulseContext AddOracle(this BeatPulseContext context, string connectionString, string name = nameof(OracleLiveness), string defaultPath = "oracle")
 {
     return(context.AddLiveness(name, setup => {
         setup.UsePath(defaultPath);
         setup.UseLiveness(new OracleLiveness(connectionString));
     }));
 }
示例#3
0
 public static BeatPulseContext AddWorkingSetLiveness(this BeatPulseContext context, long maximumMemoryBytes, string name = Constants.WorkingSetLiveness, string defaultPath = "workingset")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UseLiveness(new MaximumValueLiveness <long>(maximumMemoryBytes, () => Process.GetCurrentProcess().WorkingSet64));
     }));
 }
示例#4
0
 public static BeatPulseContext AddBeatPulseGroup(this BeatPulseContext context, Uri uri, string defaultPath = "liveness", string name = nameof(BeatPulseLiveness))
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseFactory(sp => new BeatPulseLiveness(uri, sp.GetService <ILogger <BeatPulseLiveness> >()));
     }));
 }
示例#5
0
 public static BeatPulseContext AddSqlite(this BeatPulseContext context, string sqliteConnectionString, string healthQuery, string name = nameof(SqliteLiveness), string defaultPath = "sqlite")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UseLiveness(new SqliteLiveness(sqliteConnectionString, healthQuery));
         setup.UsePath(defaultPath);
     }));
 }
示例#6
0
        public static BeatPulseContext AddDocumentDb(this BeatPulseContext context, Action <DocumentDbOptions> options)
        {
            var documentDbOptions = new DocumentDbOptions();

            options(documentDbOptions);
            context.Add(new DocumentDbLiveness(documentDbOptions));
            return(context);
        }
示例#7
0
        public static BeatPulseContext AddDocumentDb(this BeatPulseContext context, Action <DocumentDbOptions> options, string defaultPath = "documentdb")
        {
            var documentDbOptions = new DocumentDbOptions();

            options(documentDbOptions);
            context.AddLiveness(new DocumentDbLiveness(documentDbOptions, defaultPath));
            return(context);
        }
示例#8
0
 public static BeatPulseContext AddSqlite(this BeatPulseContext context, string sqliteConnectionString, string healthQuery, string name = nameof(SqliteLiveness), string defaultPath = "sqlite")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseFactory(sp => new SqliteLiveness(sqliteConnectionString, healthQuery, sp.GetService <ILogger <SqliteLiveness> >()));
     }));
 }
 public static BeatPulseContext AddIdentityServer(this BeatPulseContext context, Uri idSvrUri, string name = nameof(IdSvrLiveness), string defaultPath = "idsvr")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseLiveness(new IdSvrLiveness(idSvrUri));
     }));
 }
示例#10
0
 public static BeatPulseContext AddAzureEventHub(this BeatPulseContext context, string connectionString, string eventHubName, string name = nameof(AzureEventHubLiveness), string defaultPath = "azureeventhub")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseFactory(sp => new AzureEventHubLiveness(connectionString, eventHubName, sp.GetService <ILogger <AzureEventHubLiveness> >()));
     }));
 }
示例#11
0
 public static BeatPulseContext AddAzureServiceBusQueue(this BeatPulseContext context, string connectionString, string queueName, string name = nameof(AzureServiceBusQueueLiveness), string defaultPath = "azureservicebusqueue")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseFactory(sp => new AzureServiceBusQueueLiveness(connectionString, queueName, sp.GetService <ILogger <AzureServiceBusQueueLiveness> >()));
     }));
 }
示例#12
0
 public static BeatPulseContext AddSqlServer(this BeatPulseContext context, string connectionString, string name = nameof(SqlServerLiveness), string defaultPath = "sqlserver")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseLiveness(new SqlServerLiveness(connectionString));
     }));
 }
 public static BeatPulseContext AddKafka(this BeatPulseContext context, Dictionary <string, object> config, string name = nameof(KafkaLiveness), string defaultPath = "kafka")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseFactory(sp => new KafkaLiveness(config, sp.GetService <ILogger <KafkaLiveness> >()));
     }));
 }
示例#14
0
 public static BeatPulseContext AddUrlGroup(this BeatPulseContext context, IEnumerable <Uri> uris, HttpMethod httpMethod, string defaultPath = "uri-group", string name = nameof(UriLiveness))
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseLiveness(new UriLiveness(uris, httpMethod));
     }));
 }
示例#15
0
 public static BeatPulseContext AddUrlGroup(this BeatPulseContext context, Uri uri, string defaultPath = "uri-group", string name = nameof(UriLiveness))
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseLiveness(new UriLiveness(new System.Uri[] { uri }, HttpMethod.Get));
     }));
 }
示例#16
0
 public static BeatPulseContext AddElasticsearch(this BeatPulseContext context, string url, string name = nameof(ElasticsearchLiveness), string defaultPath = "elasticsearchliveness")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseLiveness(new ElasticsearchLiveness(url));
     }));
 }
示例#17
0
 public static BeatPulseContext AddRedis(this BeatPulseContext context, string redisConnectionString, string name = nameof(RedisLiveness), string defaultPath = "redis")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseFactory(sp => new RedisLiveness(redisConnectionString, sp.GetService <ILogger <RedisLiveness> >()));
     }));
 }
 public static BeatPulseContext AddAzureServiceBusManagement(this BeatPulseContext context, string clientID, string clientSecret, string tenantID, string name = nameof(AzureServiceBusManagementLiveness), string defaultPath = "azureservicebusmanagementliveness")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseLiveness(new AzureServiceBusManagementLiveness(clientID, clientSecret, tenantID));
     }));
 }
示例#19
0
 public static BeatPulseContext AddNpgSql(this BeatPulseContext context, string npgsqlConnectionString, string name = nameof(NpgSqlLiveness), string defaultPath = "npgsql")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseLiveness(new NpgSqlLiveness(npgsqlConnectionString));
     }));
 }
 public static BeatPulseContext AddRedis(this BeatPulseContext context, string redisConnectionString, string name = nameof(RedisLiveness), string defaultPath = "redis")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseLiveness(new RedisLiveness(redisConnectionString));
     }));
 }
 public static BeatPulseContext AddMySql(this BeatPulseContext context, string connectionString, string name = nameof(MySqlLiveness), string defaultPath = "mysql")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseFactory(sp => new MySqlLiveness(connectionString, sp.GetService <ILogger <MySqlLiveness> >()));
     }));
 }
示例#22
0
 public static BeatPulseContext AddAzureServiceBusTopic(this BeatPulseContext context, string connectionString, string topicName, string name = nameof(AzureServiceBusTopicLiveness), string defaultPath = "azureservicebustopic")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UseLiveness(new AzureServiceBusTopicLiveness(connectionString, topicName));
         setup.UsePath(defaultPath);
     }));
 }
 public static BeatPulseContext AddAzureBlobStorage(this BeatPulseContext context, string connectionString, string name = nameof(AzureBlobStorageLiveness), string defaultPath = "azureblobstorage")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UseLiveness(new AzureBlobStorageLiveness(connectionString));
         setup.UsePath(defaultPath);
     }));
 }
示例#24
0
 public static BeatPulseContext AddAzureEventHub(this BeatPulseContext context, string connectionString, string eventHubName, string name = nameof(AzureEventHubLiveness), string defaultPath = "azureeventhub")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UseLiveness(new AzureEventHubLiveness(connectionString, eventHubName));
         setup.UsePath(defaultPath);
     }));
 }
 public static BeatPulseContext AddOracle(this BeatPulseContext context, string connectionString, string healthQuery = "select * from v$version", string name = nameof(OracleLiveness), string defaultPath = "oracle")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseFactory(sp => new OracleLiveness(connectionString, healthQuery, sp.GetService <ILogger <OracleLiveness> >()));
     }));
 }
示例#26
0
 public static BeatPulseContext AddNpgSql(this BeatPulseContext context, string npgsqlConnectionString, string healthQuery = "SELECT 1;", string name = nameof(NpgSqlLiveness), string defaultPath = "npgsql")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseFactory(sp => new NpgSqlLiveness(npgsqlConnectionString, healthQuery, sp.GetService <ILogger <NpgSqlLiveness> >()));
     }));
 }
示例#27
0
 public static BeatPulseContext AddRabbitMQ(this BeatPulseContext context, string rabbitMQConnectionString, string name = nameof(RabbitMQLiveness), string defaultPath = "rabbitmq")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseLiveness(new RabbitMQLiveness(rabbitMQConnectionString));
     }));
 }
示例#28
0
 public static BeatPulseContext AddKafka(this BeatPulseContext context, Dictionary <string, object> config, string name = nameof(KafkaLiveness), string defaultPath = "kafka")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UseLiveness(new KafkaLiveness(config));
         setup.UsePath(defaultPath);
     }));
 }
示例#29
0
 public static BeatPulseContext AddEventStore(this BeatPulseContext context, string connectionString, string login = null, string password = null, string name = nameof(EventStoreLiveness), string defaultPath = "eventstore")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseFactory(sp => new EventStoreLiveness(connectionString, login, password));
     }));
 }
示例#30
0
 public static BeatPulseContext AddIdentityServer(this BeatPulseContext context, Uri idSvrUri, string name = nameof(IdSvrLiveness), string defaultPath = "idsvr")
 {
     return(context.AddLiveness(name, setup =>
     {
         setup.UsePath(defaultPath);
         setup.UseFactory(sp => new IdSvrLiveness(idSvrUri, sp.GetService <ILogger <IdSvrLiveness> >()));
     }));
 }