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

Commit 7548e09

Browse files
Sergey KanzhelevSergey Kanzhelev
authored andcommitted
few forgotten files
1 parent 92d3212 commit 7548e09

6 files changed

Lines changed: 31 additions & 30 deletions

File tree

src/OpenCensus/Impl/Common/Timestamp.cs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ public class Timestamp : ITimestamp
2626
private const long NANOS_PER_MILLI = 1000 * 1000;
2727
private const long NANOS_PER_SECOND = NANOS_PER_MILLI * MILLIS_PER_SECOND;
2828

29+
internal Timestamp(long seconds, int nanos)
30+
{
31+
this.Seconds = seconds;
32+
this.Nanos = nanos;
33+
}
34+
35+
public long Seconds { get; }
36+
37+
public int Nanos { get; }
38+
2939
public static ITimestamp Create(long seconds, int nanos)
3040
{
3141
// TODO:
@@ -49,24 +59,6 @@ public static ITimestamp FromMillis(long millis)
4959
return zero.Plus(0, nanos);
5060
}
5161

52-
internal Timestamp(long seconds, int nanos)
53-
{
54-
this.Seconds = seconds;
55-
this.Nanos = nanos;
56-
}
57-
58-
public long Seconds { get; }
59-
60-
public int Nanos { get; }
61-
62-
private static ITimestamp OfSecond(long seconds, long nanoAdjustment)
63-
{
64-
long floor = (long)Math.Floor((double)nanoAdjustment / NANOS_PER_SECOND);
65-
long secs = seconds + floor;
66-
long nos = nanoAdjustment - (floor * NANOS_PER_SECOND);
67-
return Create(secs, (int)nos);
68-
}
69-
7062
public ITimestamp AddDuration(IDuration duration)
7163
{
7264
return this.Plus(duration.Seconds, duration.Nanos);
@@ -140,6 +132,14 @@ public override int GetHashCode()
140132
return (int)h;
141133
}
142134

135+
private static ITimestamp OfSecond(long seconds, long nanoAdjustment)
136+
{
137+
long floor = (long)Math.Floor((double)nanoAdjustment / NANOS_PER_SECOND);
138+
long secs = seconds + floor;
139+
long nos = nanoAdjustment - (floor * NANOS_PER_SECOND);
140+
return Create(secs, (int)nos);
141+
}
142+
143143
private ITimestamp Plus(long secondsToAdd, long nanosToAdd)
144144
{
145145
if ((secondsToAdd | nanosToAdd) == 0)

src/OpenCensus/Impl/Stats/Aggregations/CountData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ namespace OpenCensus.Stats.Aggregations
2020

2121
public class CountData : AggregationData, ICountData
2222
{
23-
public long Count { get; }
24-
2523
internal CountData(long count)
2624
{
2725
this.Count = count;
2826
}
2927

28+
public long Count { get; }
29+
3030
public static ICountData Create(long count)
3131
{
3232
return new CountData(count);

src/OpenCensus/Impl/Stats/Aggregations/Distribution.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ private Distribution()
2424
{
2525
}
2626

27-
public IBucketBoundaries BucketBoundaries { get; }
28-
2927
private Distribution(IBucketBoundaries bucketBoundaries)
3028
{
3129
this.BucketBoundaries = bucketBoundaries ?? throw new ArgumentNullException("Null bucketBoundaries");
3230
}
3331

32+
public IBucketBoundaries BucketBoundaries { get; }
33+
3434
public static IDistribution Create(IBucketBoundaries bucketBoundaries)
3535
{
3636
if (bucketBoundaries == null)

src/OpenCensus/Impl/Stats/ViewData.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ internal ViewData(IView view, IDictionary<TagValues, IAggregationData> aggregati
3434
this.Start = start ?? throw new ArgumentNullException(nameof(start));
3535
this.End = end ?? throw new ArgumentNullException(nameof(end));
3636
}
37+
3738
public IView View { get; }
3839

3940
public IDictionary<TagValues, IAggregationData> AggregationMap { get; }

src/OpenCensus/Impl/Trace/EndSpanOptions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ internal EndSpanOptions()
2424
{
2525
}
2626

27-
public bool SampleToLocalSpanStore { get; }
28-
29-
public Status Status { get; }
30-
3127
internal EndSpanOptions(bool sampleToLocalSpanStore, Status status = null)
3228
{
3329
this.SampleToLocalSpanStore = sampleToLocalSpanStore;
3430
this.Status = status;
3531
}
3632

33+
public bool SampleToLocalSpanStore { get; }
34+
35+
public Status Status { get; }
36+
3737
public static EndSpanOptionsBuilder Builder()
3838
{
3939
return new EndSpanOptionsBuilder().SetSampleToLocalSpanStore(false);

src/OpenCensus/Impl/Trace/Export/Attributes.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ namespace OpenCensus.Trace.Export
2323

2424
public sealed class Attributes : IAttributes
2525
{
26-
public IDictionary<string, IAttributeValue> AttributeMap { get; }
27-
28-
public int DroppedAttributesCount { get; }
29-
3026
internal Attributes(IDictionary<string, IAttributeValue> attributeMap, int droppedAttributesCount)
3127
{
3228
this.AttributeMap = attributeMap ?? throw new ArgumentNullException("Null attributeMap");
3329
this.DroppedAttributesCount = droppedAttributesCount;
3430
}
3531

32+
public IDictionary<string, IAttributeValue> AttributeMap { get; }
33+
34+
public int DroppedAttributesCount { get; }
35+
3636
public static Attributes Create(IDictionary<string, IAttributeValue> attributeMap, int droppedAttributesCount)
3737
{
3838
if (attributeMap == null)

0 commit comments

Comments
 (0)