Skip to content
This repository has been archived by the owner on Jun 29, 2020. It is now read-only.

update nuget setting #66

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion HealthChecks.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.9
VisualStudioVersion = 15.0.26730.12
MinimumVisualStudioVersion = 15.0.26228.4
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{E05DCF88-F916-4B61-A5DC-A8344C9E2429}"
EndProject
Expand All @@ -25,6 +25,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNet.HealthChec
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleHealthChecker.AspNet", "samples\SampleHealthChecker.AspNet\SampleHealthChecker.AspNet.csproj", "{33FB5967-62C7-4230-B515-780EF63F748E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2F673725-6CD2-4658-9C33-818A61AF3D3A}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -77,4 +82,7 @@ Global
{2AE82E1C-6CE1-4755-A332-FA359B7CCE72} = {F9BA869A-7D5F-420F-9505-2D881F7934A7}
{33FB5967-62C7-4230-B515-780EF63F748E} = {E05DCF88-F916-4B61-A5DC-A8344C9E2429}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0B66142C-A3CB-48DF-AC49-C8C1656F84CA}
EndGlobalSection
EndGlobal
120 changes: 118 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,121 @@
Health checks for building services
Health checks for building services [![Build status](https://ci.appveyor.com/api/projects/status/nyvfn5yb8g623rt3?svg=true)](https://ci.appveyor.com/project/seven1986/healthchecks)
===


This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo.

Project | NuGet | Used For
--------------- | --------------- | ---------------
Microsoft.AspNet.HealthChecks|[![NuGet downloads Microsoft.AspNet.HealthChecks](https://img.shields.io/nuget/dt/Microsoft.AspNet.HealthChecks.svg)](https://www.nuget.org/packages/Microsoft.AspNet.HealthChecks)|AspNet
Microsoft.AspNetCore.HealthChecks|[![NuGet downloads Microsoft.AspNetCore.HealthChecks](https://img.shields.io/nuget/dt/Microsoft.AspNetCore.HealthChecks.svg)](https://www.nuget.org/packages/Microsoft.AspNetCore.HealthChecks)|AspNetCore
Microsoft.Extensions.HealthChecks.AzureStorage|[![NuGet downloads Microsoft.Extensions.HealthChecks.AzureStorage](https://img.shields.io/nuget/dt/Microsoft.Extensions.HealthChecks.AzureStorage.svg)](https://www.nuget.org/packages/Microsoft.Extensions.HealthChecks.AzureStorage)|AspNetCore
Microsoft.Extensions.HealthChecks.SqlServer|[![NuGet downloads Microsoft.Extensions.HealthChecks.SqlServer](https://img.shields.io/nuget/dt/Microsoft.Extensions.HealthChecks.SqlServer.svg)](https://www.nuget.org/packages/Microsoft.Extensions.HealthChecks.SqlServer)|AspNetCore

#### for your AspNet Project
```
Install-Package Microsoft.AspNet.HealthChecks
```

```csharp
//Global.cs
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
HealthCheckHandler.Timeout = TimeSpan.FromSeconds(3);

GlobalHealthChecks.Build(builder =>
builder.WithDefaultCacheDuration(TimeSpan.FromMinutes(1))
.AddUrlCheck("https://github.com")
.AddHealthCheckGroup(
"servers",
group => group.AddUrlCheck("https://google.com")
.AddUrlCheck("https://twitddter.com")
)
.AddHealthCheckGroup(
"memory",
group => group.AddPrivateMemorySizeCheck(1)
.AddVirtualMemorySizeCheck(2)
.AddWorkingSetCheck(1)
)
.AddCheck("thrower", (Func<IHealthCheckResult>)(() => { throw new DivideByZeroException(); }))
.AddCheck("long-running", async cancellationToken => { await Task.Delay(10000, cancellationToken); return HealthCheckResult.Healthy("I ran too long"); })
);
}
}
```



### for your AspNetCore Project
```
Install-Package Microsoft.AspNetCore.HealthChecks
```

```csharp
//Program.cs
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseHealthChecks("/health", TimeSpan.FromSeconds(3)) // Or to host on a separate port: .UseHealthChecks(port)
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();

host.Run();
}
}
```



```csharp
// Startup.cs
public void ConfigureServices(IServiceCollection services)
{
// When doing DI'd health checks, you must register them as services of their concrete type
services.AddSingleton<CustomHealthCheck>();

services.AddHealthChecks(checks =>
{
checks.AddUrlCheck("https://github.com")
.AddHealthCheckGroup(
"servers",
group => group.AddUrlCheck("https://google.com")
.AddUrlCheck("https://twitddter.com")
)
.AddHealthCheckGroup(
"memory",
group => group.AddPrivateMemorySizeCheck(1)
.AddVirtualMemorySizeCheck(2)
.AddWorkingSetCheck(1),
CheckStatus.Unhealthy
)
.AddCheck("thrower", (Func<IHealthCheckResult>)(() => { throw new DivideByZeroException(); }))
.AddCheck("long-running", async cancellationToken => { await Task.Delay(10000, cancellationToken); return HealthCheckResult.Healthy("I ran too long"); })
.AddCheck<CustomHealthCheck>("custom");

// Install-Package Microsoft.Extensions.HealthChecks.AzureStorage
// Install-Package Microsoft.Extensions.HealthChecks.SqlServer
// add valid storage account credentials first
checks.AddAzureBlobStorageCheck("accountName", "accountKey");
checks.AddAzureBlobStorageCheck("accountName", "accountKey", "containerName");

checks.AddAzureTableStorageCheck("accountName", "accountKey");
checks.AddAzureTableStorageCheck("accountName", "accountKey", "tableName");

checks.AddAzureFileStorageCheck("accountName", "accountKey");
checks.AddAzureFileStorageCheck("accountName", "accountKey", "shareName");

checks.AddAzureQueueStorageCheck("accountName", "accountKey");
checks.AddAzureQueueStorageCheck("accountName", "accountKey", "queueName");
*/
});

services.AddMvc();
}

```
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
<PackageProjectUrl>https://github.com/seven1986/HealthChecks</PackageProjectUrl>
<RepositoryUrl>https://github.com/seven1986/HealthChecks</RepositoryUrl>
<Description>HealthChecks For AspNetCore WebApplication</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

<PropertyGroup>
<TargetFramework>netstandard1.3</TargetFramework>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageProjectUrl>https://github.com/seven1986/HealthChecks</PackageProjectUrl>
<RepositoryUrl>https://github.com/seven1986/HealthChecks</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
Expand Down