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

Commit 8802125

Browse files
Sergey KanzhelevSergey Kanzhelev
authored andcommitted
whitespaces
1 parent 0e587c4 commit 8802125

135 files changed

Lines changed: 440 additions & 84 deletions

File tree

Some content is hidden

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

src/OpenCensus/Api/Stats/IMeasureMap.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,10 @@ public interface IMeasureMap
1010
{
1111
IMeasureMap Put(IMeasureDouble measure, double value);
1212

13-
1413
IMeasureMap Put(IMeasureLong measure, long value);
1514

16-
1715
void Record();
1816

19-
2017
void Record(ITagContext tags);
2118
}
2219
}

src/OpenCensus/Api/Trace/IAttributeValue.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ T Match<T>(
1212
Func<long, T> longFunction,
1313
Func<object, T> defaultFunction);
1414
}
15+
1516
public interface IAttributeValue<T> : IAttributeValue
1617
{
1718
T Value { get; }

src/OpenCensus/Impl/Common/DateTimeOffsetClock.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,5 @@ public long NowNanos
3939
}
4040
}
4141

42-
4342
}
4443
}

src/OpenCensus/Impl/Common/Duration.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,29 @@ public class Duration : IDuration
1010
const int MAX_NANOS = 999999999;
1111
private static readonly IDuration ZERO = new Duration(0, 0);
1212

13-
1413
public Duration(long seconds, int nanos)
1514
{
1615
Seconds = seconds;
1716
Nanos = nanos;
1817
}
18+
1919
public static IDuration Create(long seconds, int nanos)
2020
{
2121
if (seconds < -MAX_SECONDS || seconds > MAX_SECONDS)
2222
{
2323
return ZERO;
2424
}
25+
2526
if (nanos < -MAX_NANOS || nanos > MAX_NANOS)
2627
{
2728
return ZERO;
2829
}
30+
2931
if ((seconds < 0 && nanos > 0) || (seconds > 0 && nanos < 0))
3032
{
3133
return ZERO;
3234
}
35+
3336
return new Duration(seconds, nanos);
3437
}
3538

@@ -41,6 +44,7 @@ public int CompareTo(IDuration other)
4144
{
4245
return cmp;
4346
}
47+
4448
return (Nanos < other.Nanos) ? -1 : ((Nanos > other.Nanos) ? 1 : 0);
4549
}
4650

@@ -62,11 +66,13 @@ public override bool Equals(object o)
6266
{
6367
return true;
6468
}
69+
6570
if (o is Duration) {
6671
Duration that = (Duration)o;
6772
return (this.Seconds == that.Seconds)
6873
&& (this.Nanos == that.Nanos);
6974
}
75+
7076
return false;
7177
}
7278

src/OpenCensus/Impl/Common/Timestamp.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@ public class Timestamp : ITimestamp
1313
const long NANOS_PER_MILLI = 1000 * 1000;
1414
const long NANOS_PER_SECOND = NANOS_PER_MILLI * MILLIS_PER_SECOND;
1515

16-
1716
public static ITimestamp Create(long seconds, int nanos)
1817
{
1918
// TODO:
2019
if (seconds < -MAX_SECONDS || seconds > MAX_SECONDS)
2120
{
2221
return new Timestamp(0, 0);
2322
}
23+
2424
if (nanos < 0 || nanos > MAX_NANOS)
2525
{
2626
return new Timestamp(0, 0);
2727
}
28+
2829
return new Timestamp(seconds, nanos);
2930
}
3031

@@ -42,11 +43,9 @@ internal Timestamp(long seconds, int nanos)
4243
}
4344

4445
public long Seconds { get; }
45-
4646

4747
public int Nanos { get; }
4848

49-
5049
public ITimestamp AddDuration(IDuration duration)
5150
{
5251
return Plus(duration.Seconds, duration.Nanos);
@@ -57,7 +56,6 @@ public ITimestamp AddNanos(long nanosToAdd)
5756
return Plus(0, nanosToAdd);
5857
}
5958

60-
6159
public IDuration SubtractTimestamp(ITimestamp timestamp)
6260
{
6361

@@ -73,6 +71,7 @@ public IDuration SubtractTimestamp(ITimestamp timestamp)
7371
durationSeconds -= 1;
7472
durationNanos = (int)(durationNanos + NANOS_PER_SECOND);
7573
}
74+
7675
return Duration.Create(durationSeconds, durationNanos);
7776
}
7877

@@ -83,6 +82,7 @@ public int CompareTo(ITimestamp other)
8382
{
8483
return cmp;
8584
}
85+
8686
return (Nanos < other.Nanos) ? -1 : ((Nanos > other.Nanos) ? 1 : 0);
8787
}
8888

@@ -123,11 +123,13 @@ public override bool Equals(object o)
123123
{
124124
return true;
125125
}
126+
126127
if (o is Timestamp) {
127128
Timestamp that = (Timestamp)o;
128129
return (this.Seconds == that.Seconds)
129130
&& (this.Nanos == that.Nanos);
130131
}
132+
131133
return false;
132134
}
133135

src/OpenCensus/Impl/Internal/TimestampConverter.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using OpenCensus.Common;
22

3-
43
namespace OpenCensus.Internal
54
{
65
internal class TimestampConverter : ITimestampConverter
@@ -14,7 +13,6 @@ public static ITimestampConverter Now(IClock clock)
1413
return new TimestampConverter(clock.Now, clock.NowNanos);
1514
}
1615

17-
1816
public ITimestamp ConvertNanoTime(long nanoTime)
1917
{
2018
return timestamp.AddNanos(nanoTime - this.nanoTime);

src/OpenCensus/Impl/Internal/VarInt.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public static int VarIntSize(int i)
2424
return result;
2525
}
2626

27-
2827
public static int GetVarInt(byte[] src, int offset, int[] dst)
2928
{
3029
int result = 0;
@@ -37,6 +36,7 @@ public static int GetVarInt(byte[] src, int offset, int[] dst)
3736
// Out of range
3837
throw new ArgumentOutOfRangeException("varint too long");
3938
}
39+
4040
// Get 7 bits from next byte
4141
b = src[offset++];
4242
result |= (b & 0x7F) << shift;
@@ -46,7 +46,6 @@ public static int GetVarInt(byte[] src, int offset, int[] dst)
4646
return offset;
4747
}
4848

49-
5049
public static int PutVarInt(int v, byte[] sink, int offset)
5150
{
5251
uint uv = (uint)v;
@@ -61,7 +60,6 @@ public static int PutVarInt(int v, byte[] sink, int offset)
6160
return offset;
6261
}
6362

64-
6563
//public static int getVarInt(ByteBuffer src)
6664
//{
6765
// int tmp;
@@ -105,7 +103,6 @@ public static int PutVarInt(int v, byte[] sink, int offset)
105103
// return result;
106104
//}
107105

108-
109106
//public static void putVarInt(int v, ByteBuffer sink)
110107
//{
111108
// while (true)
@@ -138,6 +135,7 @@ public static int GetVarInt(Stream inputStream)
138135
// Out of range
139136
throw new ArgumentOutOfRangeException("varint too long");
140137
}
138+
141139
// Get 7 bits from next byte
142140
b = inputStream.ReadByte();
143141
result |= (b & 0x7F) << shift;
@@ -146,15 +144,13 @@ public static int GetVarInt(Stream inputStream)
146144
return result;
147145
}
148146

149-
150147
public static void PutVarInt(int v, Stream outputStream)
151148
{
152149
byte[] bytes = new byte[VarIntSize(v)];
153150
PutVarInt(v, bytes, 0);
154151
outputStream.Write(bytes, 0, bytes.Length);
155152
}
156153

157-
158154
public static int VarLongSize(long v)
159155
{
160156
int result = 0;
@@ -167,7 +163,6 @@ public static int VarLongSize(long v)
167163
return result;
168164
}
169165

170-
171166
//public static long GetVarLong(ByteBuffer src)
172167
//{
173168
// long tmp;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ public override bool Equals(object o)
3232
{
3333
return true;
3434
}
35+
3536
if (o is Count)
3637
{
3738
return true;
3839
}
40+
3941
return false;
4042
}
4143

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public override M Match<M>(
3030
{
3131
return p2.Invoke(this);
3232
}
33+
3334
public override string ToString()
3435
{
3536
return "CountData{"
@@ -43,11 +44,13 @@ public override bool Equals(Object o)
4344
{
4445
return true;
4546
}
47+
4648
if (o is CountData)
4749
{
4850
CountData that = (CountData)o;
4951
return (this.Count == that.Count);
5052
}
53+
5154
return false;
5255
}
5356

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public sealed class Distribution : Aggregation, IDistribution
1616
{
1717
throw new ArgumentNullException("Null bucketBoundaries");
1818
}
19+
1920
BucketBoundaries = bucketBoundaries;
2021
}
2122

@@ -25,6 +26,7 @@ public static IDistribution Create(IBucketBoundaries bucketBoundaries)
2526
{
2627
throw new ArgumentNullException(nameof(bucketBoundaries));
2728
}
29+
2830
return new Distribution(bucketBoundaries);
2931
}
3032

@@ -46,10 +48,12 @@ public override bool Equals(object o)
4648
{
4749
return true;
4850
}
51+
4952
if (o is Distribution) {
5053
Distribution that = (Distribution)o;
5154
return (this.BucketBoundaries.Equals(that.BucketBoundaries));
5255
}
56+
5357
return false;
5458
}
5559

0 commit comments

Comments
 (0)