Skip to content

Commit

Permalink
Merge pull request #3 from AdysTech/mvadu-patch-1
Browse files Browse the repository at this point in the history
Updated Influx connection and exception handling
  • Loading branch information
mvadu committed Oct 26, 2015
2 parents 699e475 + 71f3560 commit 0c0dcfe
Show file tree
Hide file tree
Showing 5 changed files with 194 additions and 315 deletions.
18 changes: 1 addition & 17 deletions Influxer/ExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,7 @@

namespace AdysTech.Influxer
{
internal static class EpochHelper
{
private static readonly DateTime Origin = new DateTime (1970, 1, 1);

public static long ToEpochMs(this DateTime time)
{
TimeSpan t = time - Origin;
return (long) ( t.TotalSeconds * 1000 );
}

public static long ToEpoch(this DateTime time)
{
TimeSpan t = time - Origin;
return (long) ( t.TotalSeconds );
}
}


public static class StringExtensionMethods
{
public static string Replace(this string s, char[] separators, string newValue)
Expand Down
15 changes: 15 additions & 0 deletions Influxer/FailureTracker.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AdysTech.Influxer
{
class FailureTracker
{
public Type ExceptionType { get; set; }
public int Count { get; set; }
public string Message { get; set; }
}
}
5 changes: 5 additions & 0 deletions Influxer/Influxer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
</PropertyGroup>
<PropertyGroup />
<ItemGroup>
<Reference Include="AdysTech.InfluxDB.Client.Net, Version=0.0.0.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\AdysTech.InfluxDB.Client.Net.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
Expand All @@ -59,6 +63,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="ExtensionMethods.cs" />
<Compile Include="FailureTracker.cs" />
<Compile Include="GenericColumn.cs" />
<Compile Include="PerfmonCounter.cs" />
<Compile Include="Program.cs" />
Expand Down
Loading

0 comments on commit 0c0dcfe

Please sign in to comment.