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

Commit 8790f6c

Browse files
API comments (#62)
* API comments * stats APIs are documented * tags API documentation * 49 more files were modified. Build will fail as strict stylecop check is enabled * one more * few more comments * fixed unit tests * all done! =)
1 parent e14213a commit 8790f6c

File tree

137 files changed

+1906
-726
lines changed

Some content is hidden

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

137 files changed

+1906
-726
lines changed

src/OpenCensus.Abstractions/Common/IClock.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,19 @@
1616

1717
namespace OpenCensus.Common
1818
{
19+
/// <summary>
20+
/// Clock to get the current time with the nanoseconds precision.
21+
/// </summary>
1922
public interface IClock
2023
{
24+
/// <summary>
25+
/// Gets the current instant from this clock as a timestamp.
26+
/// </summary>
2127
ITimestamp Now { get; }
2228

29+
/// <summary>
30+
/// Gets a time measurement with nanosecond precision that can only be used to calculate elapsed time.
31+
/// </summary>
2332
long NowNanos { get; }
2433
}
2534
}

src/OpenCensus.Abstractions/Common/IDuration.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,19 @@ namespace OpenCensus.Common
1818
{
1919
using System;
2020

21+
/// <summary>
22+
/// Represents duration with the nanoseconds precition.
23+
/// </summary>
2124
public interface IDuration : IComparable<IDuration>
2225
{
26+
/// <summary>
27+
/// Gets the number of second in duration.
28+
/// </summary>
2329
long Seconds { get; }
2430

31+
/// <summary>
32+
/// Gets the number of nanoseconds in duration.
33+
/// </summary>
2534
int Nanos { get; }
2635
}
2736
}

src/OpenCensus.Abstractions/Common/IScope.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ namespace OpenCensus.Common
1818
{
1919
using System;
2020

21+
/// <summary>
22+
/// Scope marker. Used as a syntactic sugar in methods like StartScopedSpan so it can be
23+
/// wrapped in "using" block with automatic scope completion.
24+
/// </summary>
2125
public interface IScope : IDisposable
2226
{
2327
}

src/OpenCensus.Abstractions/Common/ITimestamp.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,41 @@ namespace OpenCensus.Common
1818
{
1919
using System;
2020

21+
/// <summary>
22+
/// Timestamp with the nanoseconds precision.
23+
/// </summary>
2124
public interface ITimestamp : IComparable<ITimestamp>
2225
{
26+
/// <summary>
27+
/// Gets the number of seconds since the Unix Epoch represented by this timestamp.
28+
/// </summary>
2329
long Seconds { get; }
2430

31+
/// <summary>
32+
/// Gets the the number of nanoseconds after the number of seconds since the Unix Epoch represented
33+
/// by this timestamp.
34+
/// </summary>
2535
int Nanos { get; }
2636

37+
/// <summary>
38+
/// Adds nanosToAdd nanosecond to the current timestamp.
39+
/// </summary>
40+
/// <param name="nanosToAdd">Number of nanoseconds to add.</param>
41+
/// <returns>Returns the timstemp with added nanoseconds.</returns>
2742
ITimestamp AddNanos(long nanosToAdd);
2843

44+
/// <summary>
45+
/// Adds duration to the timestamp.
46+
/// </summary>
47+
/// <param name="duration">Duration to add to the timestamp.</param>
48+
/// <returns>Returns the timestamp with added duration.</returns>
2949
ITimestamp AddDuration(IDuration duration);
3050

51+
/// <summary>
52+
/// Substructs timestamp from the current timestamp. Typically to calculate duration.
53+
/// </summary>
54+
/// <param name="timestamp">Timestamp to substruct.</param>
55+
/// <returns>Returns the timestamp with the substructed duration.</returns>
3156
IDuration SubtractTimestamp(ITimestamp timestamp);
3257
}
3358
}

src/OpenCensus.Abstractions/Internal/IEventQueue.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@
1616

1717
namespace OpenCensus.Internal
1818
{
19+
/// <summary>
20+
/// Event queue abstraction.
21+
/// </summary>
1922
public interface IEventQueue
2023
{
24+
/// <summary>
25+
/// Queues a single entry.
26+
/// </summary>
27+
/// <param name="entry">Entry to be queued.</param>
2128
void Enqueue(IEventQueueEntry entry);
2229
}
2330
}

src/OpenCensus.Abstractions/Internal/IEventQueueEntry.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@
1616

1717
namespace OpenCensus.Internal
1818
{
19+
/// <summary>
20+
/// Queue entry abstraction.
21+
/// </summary>
1922
public interface IEventQueueEntry
2023
{
24+
/// <summary>
25+
/// Method process will be called when queue entry needs to be processed.
26+
/// </summary>
2127
void Process();
2228
}
2329
}

src/OpenCensus.Abstractions/Internal/ITimestampConverter.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,16 @@ namespace OpenCensus.Internal
1818
{
1919
using OpenCensus.Common;
2020

21+
/// <summary>
22+
/// Converts nanoseconds into timestamp.
23+
/// </summary>
2124
public interface ITimestampConverter
2225
{
26+
/// <summary>
27+
/// Converts nanoseconds to the timestamp.
28+
/// </summary>
29+
/// <param name="nanoTime">Nanoseconds time.</param>
30+
/// <returns>Timestamp from the nanoseconds.</returns>
2331
ITimestamp ConvertNanoTime(long nanoTime);
2432
}
2533
}

src/OpenCensus.Abstractions/OpenCensus.Abstractions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<RootNamespace>OpenCensus</RootNamespace>
1515
</PropertyGroup>
1616
<PropertyGroup>
17-
<CodeAnalysisRuleSet>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenCensus.sln'))/build/OpenCensus.prod.loose.ruleset</CodeAnalysisRuleSet>
17+
<CodeAnalysisRuleSet>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenCensus.sln'))/build/OpenCensus.prod.ruleset</CodeAnalysisRuleSet>
1818
</PropertyGroup>
1919
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
2020
<DebugType>full</DebugType>

src/OpenCensus.Abstractions/Stats/Aggregations/ICount.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
namespace OpenCensus.Stats.Aggregations
1818
{
19+
/// <summary>
20+
/// Count aggregation.
21+
/// </summary>
1922
public interface ICount : IAggregation
2023
{
2124
}

src/OpenCensus.Abstractions/Stats/Aggregations/ICountData.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@
1616

1717
namespace OpenCensus.Stats.Aggregations
1818
{
19+
/// <summary>
20+
/// Data accumulated by Count aggregation.
21+
/// </summary>
1922
public interface ICountData : IAggregationData
2023
{
24+
/// <summary>
25+
/// Gets the counter representing the result of an aggregation.
26+
/// </summary>
2127
long Count { get; }
2228
}
2329
}

0 commit comments

Comments
 (0)