-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allowed the stats OWIN API to work with any implementation of IProjec…
…torState (#106)
- Loading branch information
1 parent
146c5b1
commit 2bef488
Showing
8 changed files
with
97 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,29 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard1.1</TargetFramework> | ||
<PackageId /> | ||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<DefineConstants>TRACE;DEBUG;NETSTANDARD1_1;LIBLOG_PORTABLE</DefineConstants> | ||
<DocumentationFile>bin\Debug\netstandard1.1\LiquidProjections.xml</DocumentationFile> | ||
<NoWarn>1701;1702;1705;1591</NoWarn> | ||
<TreatWarningsAsErrors>True</TreatWarningsAsErrors> | ||
<TreatSpecificWarningsAsErrors /> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | ||
<DefineConstants>TRACE;RELEASE;LIBLOG_PORTABLE;NETSTANDARD1_1</DefineConstants> | ||
<DocumentationFile>bin\Release\netstandard1.1\LiquidProjections.xml</DocumentationFile> | ||
<NoWarn>1701;1702;1705;1591</NoWarn> | ||
<TreatWarningsAsErrors>True</TreatWarningsAsErrors> | ||
<TreatSpecificWarningsAsErrors /> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="LibLog" Version="4.2.6" /> | ||
<PackageReference Include="Microsoft.CSharp" Version="4.3.0" /> | ||
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\LiquidProjections.Abstractions\LiquidProjections.Abstractions.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace LiquidProjections.Statistics | ||
{ | ||
public interface IProjectionStats : IEnumerable<IProjectorStats> | ||
{ | ||
/// <summary> | ||
/// Should be called to track the progress of a projector and use that to calculate an ETA. | ||
/// </summary> | ||
void TrackProgress(string projectorId, long checkpoint); | ||
|
||
/// <summary> | ||
/// Can be used to store projector-specific properties that characterize the projector's configuration or state. | ||
/// </summary> | ||
/// <remarks> | ||
/// Each property is identified by a <paramref name="name"/>. This class only keeps the latest value | ||
/// for each property. | ||
/// </remarks> | ||
void StoreProperty(string projectorId, string name, string value); | ||
|
||
/// <summary> | ||
/// Can be used to store information that happened that can help diagnose the state or failure of a projector. | ||
/// </summary> | ||
void LogEvent(string projectorId, string body); | ||
|
||
/// <summary> | ||
/// Gets the speed in transactions per minute based on a weighted average over the last | ||
/// ten minutes, or <c>null</c> if there is not enough information yet. | ||
/// </summary> | ||
/// <param name="projectorId"></param> | ||
float? GetSpeed(string projectorId); | ||
|
||
/// <summary> | ||
/// Calculates the expected time for the projector identified by <paramref name="projectorId"/> to reach a | ||
/// certain <paramref name="targetCheckpoint"/> based on a weighted average over the last | ||
/// ten minutes, or <c>null</c> if there is not enough information yet. Use <see cref="ProjectionStats.TrackProgress"/> to report | ||
/// progress. | ||
/// </summary> | ||
TimeSpan? GetTimeToReach(string projectorId, long targetCheckpoint); | ||
|
||
/// <summary> | ||
/// Gets the stats for an individual projector. | ||
/// </summary> | ||
IProjectorStats Get(string projectorId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters