Skip to content
This repository has been archived by the owner on Mar 26, 2019. It is now read-only.

Commit

Permalink
Merge pull request #43 from AppMetrics/dev
Browse files Browse the repository at this point in the history
3.0.0 release
  • Loading branch information
alhardy authored Dec 2, 2018
2 parents ad0232e + 1091bec commit ff3ad64
Show file tree
Hide file tree
Showing 66 changed files with 3,637 additions and 3,079 deletions.
3 changes: 3 additions & 0 deletions InfluxDB.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{DD2E4647-7125-4CE3-9BA5-B45A26113A31}"
ProjectSection(SolutionItems) = preProject
test\Directory.Build.props = test\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cake", "Cake", "{E1A943F7-5493-4B64-A448-3E9EEA582E20}"
ProjectSection(SolutionItems) = preProject
Expand Down
3 changes: 0 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ deploy:
secure: gIAiACgNj+JzXyLLTe3rLxZyrAB9RpC8Lw81xEjdOLXqotprqEwGiFWRipEqkpps
skip_symbols: true
symbol_server: https://www.myget.org/F/appmetrics/symbol
install:
- cmd: curl -O https://download.microsoft.com/download/0/F/D/0FD852A4-7EA1-4E2A-983A-0484AC19B92C/dotnet-sdk-2.0.0-win-x64.exe
- cmd: dotnet-sdk-2.0.0-win-x64.exe /install /quiet /norestart /log install.log
skip_commits:
files:
- '**/*.md'
26 changes: 20 additions & 6 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,34 @@ var coverExcludeFilter = "-:*.Facts";
var excludeFromCoverage = "*.ExcludeFromCodeCoverage*";
string versionSuffix = null;

if (!string.IsNullOrEmpty(preReleaseSuffix))
if (AppVeyor.IsRunningOnAppVeyor)
{
if (packageRelease && AppVeyor.IsRunningOnAppVeyor && AppVeyor.Environment.Repository.Tag.IsTag)
if (AppVeyor.Environment.Repository.Tag.IsTag)
{
versionSuffix = preReleaseSuffix;
// Stable release package, pushed to nuget
}
else if (string.IsNullOrEmpty(preReleaseSuffix))
{
// Next stable release development package, not pushed to nuget
versionSuffix = buildNumber.ToString("D4");
}
else
{
versionSuffix = preReleaseSuffix + "-" + buildNumber.ToString("D4");
if (packageRelease)
{
// Pre-release package, set version suffix without build number, not tagged until stable release but pushed to nuget
versionSuffix = preReleaseSuffix;
}
else
{
// Pre-release development package, set version suffix with build number, not pushed to nuget
versionSuffix = preReleaseSuffix + "-" + buildNumber.ToString("D4");
}
}
}
else if (AppVeyor.IsRunningOnAppVeyor && !AppVeyor.Environment.Repository.Tag.IsTag && !packageRelease)
else
{
versionSuffix = buildNumber.ToString("D4");
versionSuffix = preReleaseSuffix + "-" + buildNumber.ToString("D4");
}


Expand Down
29 changes: 14 additions & 15 deletions build/dependencies.props
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<Project>
<PropertyGroup>
<AppMetricsCoreVersion>2.0.0-*</AppMetricsCoreVersion>
<AppMetricsAspNetCoreVersion>2.0.0-*</AppMetricsAspNetCoreVersion>
<AspNetCoreVersion>2.0.1</AspNetCoreVersion>
<AspNetCoreMvcVersion>2.0.2</AspNetCoreMvcVersion>
<MicrosoftExtensionsVersion>2.0.0</MicrosoftExtensionsVersion>
<BenchmarkDotNetVersion>0.10.12</BenchmarkDotNetVersion>
<CoreFxVersion>4.4.0</CoreFxVersion>
<DependencyModelVersion>2.0.4</DependencyModelVersion>
<MoqVersion>4.8.1</MoqVersion>
<NewtonsoftVersion>10.0.3</NewtonsoftVersion>
<NETStandardLibraryNETFrameworkVersion>2.0.0-*</NETStandardLibraryNETFrameworkVersion>
<RuntimeFrameworkVersion Condition="'$(TargetFramework)'=='netcoreapp2.0'">2.0.0-*</RuntimeFrameworkVersion>
<TestSdkVersion>15.5.0</TestSdkVersion>
<XunitVersion>2.3.1</XunitVersion>
<FluentAssertionsVersion>5.0.0</FluentAssertionsVersion>
<AppMetricsCoreVersion>3.0.0-*</AppMetricsCoreVersion>
<AppMetricsHealthCoreVersion>2.1.0-*</AppMetricsHealthCoreVersion>
<AppMetricsAspNetCoreVersion>3.0.0-*</AppMetricsAspNetCoreVersion>
<AppMetricsAspNetCoreHealthVersion>2.1.0-*</AppMetricsAspNetCoreHealthVersion>
<AspNetCoreVersion>2.1.6</AspNetCoreVersion>
<AspNetCoreMvcVersion>2.1.3</AspNetCoreMvcVersion>
<MicrosoftExtensionsVersion>2.1.1</MicrosoftExtensionsVersion>
<CoreFxVersion>4.5.0</CoreFxVersion>
<DependencyModelVersion>2.1.1</DependencyModelVersion>
<MoqVersion>4.10.0</MoqVersion>
<NewtonsoftVersion>11.0.2</NewtonsoftVersion>
<TestSdkVersion>15.9.0</TestSdkVersion>
<XunitVersion>2.4.1</XunitVersion>
<FluentAssertionsVersion>5.5.3</FluentAssertionsVersion>
<FluentAssertionsJsonVersion>5.0.0</FluentAssertionsJsonVersion>
<StyleCopAnalyzersVersion>1.0.0</StyleCopAnalyzersVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"projects": [ "src", "test", "sandbox" ],
"sdk": {
"version": "2.0.0"
"version": "2.1.301"
}
}
4 changes: 2 additions & 2 deletions sandbox/MetricsInfluxDBSandbox/ApplicationsMetricsRegistry.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="ApplicationsMetricsRegistry.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="ApplicationsMetricsRegistry.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using App.Metrics.Apdex;
Expand Down
21 changes: 17 additions & 4 deletions sandbox/MetricsInfluxDBSandbox/Host.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="Host.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="Host.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System;
Expand All @@ -19,7 +19,8 @@ namespace MetricsInfluxDBSandbox
public static class Host
{
private const string InfluxDbDatabase = "metricsinfluxdbsandboxconsole";
private const string InfluxDbUri = "http://127.0.0.1:8086";
private const string InfluxDbUri = "http://127.0.0.1:32768";
private static readonly bool FilterMetricFields = false;
private static readonly Random Rnd = new Random();

private static IConfigurationRoot Configuration { get; set; }
Expand Down Expand Up @@ -124,7 +125,19 @@ private static void Init()

Metrics = new MetricsBuilder()
.Configuration.Configure(metricsConfigSection.AsEnumerable())
// Adds LineProtocolFormatter with default options
.MetricFields.Configure(
fields =>
{
if (FilterMetricFields)
{
fields.Meter.OnlyInclude(MeterFields.Rate1M);
fields.Apdex.Exclude();
fields.Counter.OnlyInclude(CounterFields.Value);
fields.Gauge.Exclude();
fields.Histogram.Exclude();
}
})
// Adds LineProtocolFormatter with default options, can override fields reported to influx using fields => fields...
.Report.ToInfluxDb(InfluxDbUri, InfluxDbDatabase, TimeSpan.FromSeconds(5))
.Build();

Expand Down
20 changes: 10 additions & 10 deletions sandbox/MetricsInfluxDBSandbox/MetricsInfluxDBSandbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
<Import Project="..\..\build\common.props" />

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
<OutputType>exe</OutputType>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<Content Include="appsettings.json" />
<Content Include="appsettings.json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="App.Metrics" Version="$(AppMetricsCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="$(MicrosoftExtensionsVersion)" />
<PackageReference Include="Serilog.Sinks.Literate" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.Seq" Version="4.0.0" />
<PackageReference Include="App.Metrics" Version="$(AppMetricsCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="$(MicrosoftExtensionsVersion)" />
<PackageReference Include="Serilog.Sinks.Literate" Version="3.0.1-dev-00044" />
<PackageReference Include="Serilog.Sinks.Seq" Version="4.0.1-dev-00155" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\App.Metrics.Reporting.InfluxDB\App.Metrics.Reporting.InfluxDB.csproj" />
<ProjectReference Include="..\..\src\App.Metrics.Reporting.InfluxDB\App.Metrics.Reporting.InfluxDB.csproj" />
</ItemGroup>
<ItemGroup>
<Content Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="AppBuilderExtensions.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="AppBuilderExtensions.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="RandomBufferGenerator.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="RandomBufferGenerator.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="RandomClientIdForTesting.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="RandomClientIdForTesting.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="RandomValuesForTesting.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="RandomValuesForTesting.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="RequestDurationForApdexTesting.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="RequestDurationForApdexTesting.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="ServiceCollectionExtensions.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="ServiceCollectionExtensions.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="SimpleConsoleMetricsReporter.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="SimpleConsoleMetricsReporter.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System;
Expand Down
28 changes: 23 additions & 5 deletions sandbox/MetricsInfluxDBSandboxMvc/Host.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
// <copyright file="Host.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="Host.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System.IO;
using System.Threading.Tasks;
using App.Metrics;
using App.Metrics.AspNetCore;
using App.Metrics.AspNetCore.Health;
using App.Metrics.Extensions.Configuration;
using App.Metrics.Formatters.InfluxDB;
using App.Metrics.Health;
using App.Metrics.Reporting.InfluxDB;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
Expand All @@ -27,13 +32,26 @@ public static IWebHost BuildWebHost(string[] args)

var influxOptions = new MetricsReportingInfluxDbOptions();
configuration.GetSection(nameof(MetricsReportingInfluxDbOptions)).Bind(influxOptions);
influxOptions.MetricsOutputFormatter = new MetricsInfluxDbLineProtocolOutputFormatter();

var metrics = AppMetrics.CreateDefaultBuilder()
.Configuration.ReadFrom(configuration)
.Report.ToInfluxDb(influxOptions)
.Build();

return WebHost.CreateDefaultBuilder(args)
.ConfigureMetricsWithDefaults(
builder =>
.ConfigureMetrics(metrics)
.ConfigureHealthWithDefaults(
(context, builder) =>
{
builder.Report.ToInfluxDb(influxOptions);
builder.OutputHealth.AsPlainText()
.OutputHealth.AsJson()
.HealthChecks.AddCheck("check 1", () => new ValueTask<HealthCheckResult>(HealthCheckResult.Healthy()))
.HealthChecks.AddCheck("check 2", () => new ValueTask<HealthCheckResult>(HealthCheckResult.Degraded()))
.HealthChecks.AddCheck("check 3", () => new ValueTask<HealthCheckResult>(HealthCheckResult.Unhealthy()))
.Report.ToMetrics(metrics);
})
.UseHealth()
.UseMetrics()
.UseSerilog()
.UseStartup<Startup>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="FileController.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="FileController.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="FrustratingController.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="FrustratingController.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System.Threading.Tasks;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="RandomExceptionController.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="RandomExceptionController.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using MetricsInfluxDBSandboxMvc.Controllers;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="RandomStatusCodeController.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="RandomStatusCodeController.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using MetricsInfluxDBSandboxMvc.Controllers;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="SatisfyingController.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="SatisfyingController.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="SlaTestController.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="SlaTestController.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="TestController.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="TestController.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using Microsoft.AspNetCore.Mvc;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// <copyright file="ToleratingController.cs" company="Allan Hardy">
// Copyright (c) Allan Hardy. All rights reserved.
// <copyright file="ToleratingController.cs" company="App Metrics Contributors">
// Copyright (c) App Metrics Contributors. All rights reserved.
// </copyright>

using System.Threading.Tasks;
Expand Down
19 changes: 9 additions & 10 deletions sandbox/MetricsInfluxDBSandboxMvc/MetricsInfluxDBSandboxMvc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
<Import Project="..\..\build\common.props" />

<PropertyGroup>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<OutputType>exe</OutputType>
<TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
<LangVersion>latest</LangVersion>
</PropertyGroup>

<ItemGroup>
<ItemGroup>
<PackageReference Include="App.Metrics.AspNetCore.Health" Version="$(AppMetricsAspNetCoreHealthVersion)" />
<PackageReference Include="App.Metrics.AspNetCore.Mvc" Version="$(AppMetricsAspNetCoreVersion)" />
<PackageReference Include="App.Metrics.Health.Reporting.Metrics" Version="$(AppMetricsHealthCoreVersion)" />
<PackageReference Include="Microsoft.AspNetCore" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="$(AspNetCoreMvcVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="$(MicrosoftExtensionsVersion)" />
<PackageReference Include="Serilog.Sinks.Literate" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.Seq" Version="4.0.0" />
<PackageReference Include="Serilog.AspNetCore " Version="2.1.0" />
<PackageReference Include="Serilog.Sinks.Literate" Version="3.0.1-dev-00044" />
<PackageReference Include="Serilog.Sinks.Seq" Version="4.0.1-dev-00155" />
<PackageReference Include="Serilog.AspNetCore " Version="2.1.2-dev-00024" />
</ItemGroup>

<ItemGroup>
Expand All @@ -27,8 +30,4 @@
</Content>
</ItemGroup>

<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" />
</ItemGroup>

</Project>
Loading

0 comments on commit ff3ad64

Please sign in to comment.