Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.

Commit bf782f7

Browse files
Few more warning fix (#37)
* fix few more warnings * few more
1 parent 54fac6e commit bf782f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+211
-204
lines changed

.vsts/ci-myget-update.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CI build with the upload to MyGet
22

3+
trigger:
4+
branches:
5+
include:
6+
- master
7+
- develop
8+
39
queue: Hosted VS2017
410
steps:
511
- task: DotNetCoreInstaller@0

src/OpenCensus.Exporter.Zipkin/Implementation/TraceExporterHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ private ZipkinEndpoint GetLocalZipkinEndpoint()
274274
{
275275
var result = new ZipkinEndpoint()
276276
{
277-
ServiceName = this.options.ServiceName
277+
ServiceName = this.options.ServiceName,
278278
};
279279

280280
string hostName = this.ResolveHostName();

src/OpenCensus.Exporter.Zipkin/Implementation/ZipkinSpanKind.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ internal enum ZipkinSpanKind
3636
/// <summary>
3737
/// Consumer.
3838
/// </summary>
39-
CONSUMER
39+
CONSUMER,
4040
}
4141
}

src/OpenCensus.Exporter.Zipkin/OpenCensus.Exporter.Zipkin.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<ItemGroup>
2323
<ProjectReference Include="..\OpenCensus\OpenCensus.csproj" />
24-
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2">
24+
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta008">
2525
<PrivateAssets>All</PrivateAssets>
2626
</PackageReference>
2727
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />

src/OpenCensus.Exporter.Zipkin/ZipkinTraceExporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class ZipkinTraceExporter
4444
/// <param name="exportComponent">Exporter to get traces from.</param>
4545
/// <param name="client">Http client to use to upload telemetry.
4646
/// For local development with invalid certificates use code like this:
47-
/// new HttpClient(new HttpClientHandler() { ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator })
47+
/// new HttpClient(new HttpClientHandler() { ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator }).
4848
/// </param>
4949
public ZipkinTraceExporter(ZipkinTraceExporterOptions options, IExportComponent exportComponent, HttpClient client = null)
5050
{

src/OpenCensus/Api/Stats/IBucketBoundries.cs renamed to src/OpenCensus/Api/Stats/IBucketBoundaries.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="IBucketBoundries.cs" company="OpenCensus Authors">
1+
// <copyright file="IBucketBoundaries.cs" company="OpenCensus Authors">
22
// Copyright 2018, OpenCensus Authors
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");

src/OpenCensus/Api/Stats/StatsCollectionState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ namespace OpenCensus.Stats
1919
public enum StatsCollectionState
2020
{
2121
ENABLED,
22-
DISABLED
22+
DISABLED,
2323
}
2424
}

src/OpenCensus/Impl/Common/DateTimeOffsetClock.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,19 @@ namespace OpenCensus.Common
2020

2121
internal class DateTimeOffsetClock : IClock
2222
{
23-
internal const long MILLIS_PER_SECOND = 1000L;
24-
internal const long NANOS_PER_MILLI = 1000 * 1000;
25-
internal const long NANOS_PER_SECOND = NANOS_PER_MILLI * MILLIS_PER_SECOND;
23+
public static readonly DateTimeOffsetClock Instance = new DateTimeOffsetClock();
2624

27-
public static readonly DateTimeOffsetClock INSTANCE = new DateTimeOffsetClock();
28-
29-
public static IClock GetInstance()
30-
{
31-
return INSTANCE;
32-
}
25+
internal const long MillisPerSecond = 1000L;
26+
internal const long NanosPerMilli = 1000 * 1000;
27+
internal const long NanosPerSecond = NanosPerMilli * MillisPerSecond;
3328

3429
public ITimestamp Now
3530
{
3631
get
3732
{
3833
var nowNanoTicks = this.NowNanos;
39-
var nowSecTicks = nowNanoTicks / NANOS_PER_SECOND;
40-
var excessNanos = nowNanoTicks - (nowSecTicks * NANOS_PER_SECOND);
34+
var nowSecTicks = nowNanoTicks / NanosPerSecond;
35+
var excessNanos = nowNanoTicks - (nowSecTicks * NanosPerSecond);
4136
return new Timestamp(nowSecTicks, (int)excessNanos);
4237
}
4338
}
@@ -47,8 +42,13 @@ public long NowNanos
4742
get
4843
{
4944
var millis = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds();
50-
return millis * NANOS_PER_MILLI;
45+
return millis * NanosPerMilli;
5146
}
5247
}
48+
49+
public static IClock GetInstance()
50+
{
51+
return Instance;
52+
}
5353
}
5454
}

src/OpenCensus/Impl/Common/ZeroTimeClock.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ namespace OpenCensus.Common
1818
{
1919
internal sealed class ZeroTimeClock : IClock
2020
{
21-
public static readonly ZeroTimeClock INSTANCE = new ZeroTimeClock();
22-
private static readonly ITimestamp ZERO_TIMESTAMP = Timestamp.Create(0, 0);
21+
public static readonly ZeroTimeClock Instance = new ZeroTimeClock();
22+
private static readonly ITimestamp ZeroTimestamp = Timestamp.Create(0, 0);
2323

2424
public ITimestamp Now
2525
{
2626
get
2727
{
28-
return ZERO_TIMESTAMP;
28+
return ZeroTimestamp;
2929
}
3030
}
3131

src/OpenCensus/Impl/Internal/NoopScope.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ namespace OpenCensus.Internal
2020

2121
public sealed class NoopScope : IScope
2222
{
23-
public static readonly IScope INSTANCE = new NoopScope();
23+
public static readonly IScope NoopInstance = new NoopScope();
24+
25+
private NoopScope()
26+
{
27+
}
2428

2529
public static IScope Instance
2630
{
2731
get
2832
{
29-
return INSTANCE;
33+
return NoopInstance;
3034
}
3135
}
3236

33-
private NoopScope()
34-
{
35-
}
36-
3737
public void Dispose()
3838
{
3939
}

0 commit comments

Comments
 (0)