Skip to content

Commit

Permalink
Sync .NET API with updates
Browse files Browse the repository at this point in the history
  • Loading branch information
victlu committed May 10, 2021
1 parent a323e73 commit d64cb4a
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 105 deletions.
30 changes: 15 additions & 15 deletions src/System.Diagnostics.Metrics.Temp/Counter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,73 +26,73 @@ namespace System.Diagnostics.Metrics
/// </summary>
/// <typeparam name="T">TBD.</typeparam>
public sealed class Counter<T> : Instrument<T>
where T : unmanaged
where T : struct
{
internal Counter(Meter meter, string name, string? description, string? unit)
: base(meter, name, description, unit)
internal Counter(Meter meter, string name, string? unit, string? description)
: base(meter, name, unit, description)
{
this.Publish();
}

/// <summary>
/// TBD.
/// </summary>
public void Add(T measurement)
public void Add(T delta)
{
this.RecordMeasurement(measurement);
this.RecordMeasurement(delta);
}

/// <summary>
/// TBD.
/// </summary>
public void Add(
T measurement,
T delta,
KeyValuePair<string, object?> tag1)
{
this.RecordMeasurement(measurement, tag1);
this.RecordMeasurement(delta, tag1);
}

/// <summary>
/// TBD.
/// </summary>
public void Add(
T measurement,
T delta,
KeyValuePair<string, object?> tag1,
KeyValuePair<string, object?> tag2)
{
this.RecordMeasurement(measurement, tag1, tag2);
this.RecordMeasurement(delta, tag1, tag2);
}

/// <summary>
/// TBD.
/// </summary>
public void Add(
T measurement,
T delta,
KeyValuePair<string, object?> tag1,
KeyValuePair<string, object?> tag2,
KeyValuePair<string, object?> tag3)
{
this.RecordMeasurement(measurement, tag1, tag2, tag3);
this.RecordMeasurement(delta, tag1, tag2, tag3);
}

/// <summary>
/// TBD.
/// </summary>
public void Add(
T measurement,
T delta,
ReadOnlySpan<KeyValuePair<string, object?>> tags)
{
this.RecordMeasurement(measurement, tags);
this.RecordMeasurement(delta, tags);
}

/// <summary>
/// TBD.
/// </summary>
public void Add(
T measurement,
T delta,
params KeyValuePair<string, object?>[] tags)
{
this.RecordMeasurement(measurement, tags);
this.RecordMeasurement(delta, tags);
}
}
}
30 changes: 15 additions & 15 deletions src/System.Diagnostics.Metrics.Temp/Histogram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,73 +27,73 @@ namespace System.Diagnostics.Metrics
/// </summary>
/// <typeparam name="T">TBD.</typeparam>
public sealed class Histogram<T> : Instrument<T>
where T : unmanaged
where T : struct
{
internal Histogram(Meter meter, string name, string? description, string? unit)
: base(meter, name, description, unit)
internal Histogram(Meter meter, string name, string? unit, string? description)
: base(meter, name, unit, description)
{
this.Publish();
}

/// <summary>
/// TBD.
/// </summary>
public void Record(T measurement)
public void Record(T value)
{
this.RecordMeasurement(measurement);
this.RecordMeasurement(value);
}

/// <summary>
/// TBD.
/// </summary>
public void Record(
T measurement,
T value,
KeyValuePair<string, object?> tag1)
{
this.RecordMeasurement(measurement, tag1);
this.RecordMeasurement(value, tag1);
}

/// <summary>
/// TBD.
/// </summary>
public void Record(
T measurement,
T value,
KeyValuePair<string, object?> tag1,
KeyValuePair<string, object?> tag2)
{
this.RecordMeasurement(measurement, tag1, tag2);
this.RecordMeasurement(value, tag1, tag2);
}

/// <summary>
/// TBD.
/// </summary>
public void Record(
T measurement,
T value,
KeyValuePair<string, object?> tag1,
KeyValuePair<string, object?> tag2,
KeyValuePair<string, object?> tag3)
{
this.RecordMeasurement(measurement, tag1, tag2, tag3);
this.RecordMeasurement(value, tag1, tag2, tag3);
}

/// <summary>
/// TBD.
/// </summary>
public void Record(
T measurement,
T value,
ReadOnlySpan<KeyValuePair<string, object?>> tags)
{
this.RecordMeasurement(measurement, tags);
this.RecordMeasurement(value, tags);
}

/// <summary>
/// TBD.
/// </summary>
public void Record(
T measurement,
T value,
params KeyValuePair<string, object?>[] tags)
{
this.RecordMeasurement(measurement, tags);
this.RecordMeasurement(value, tags);
}
}
}
4 changes: 2 additions & 2 deletions src/System.Diagnostics.Metrics.Temp/Instrument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public abstract class Instrument
/// Initializes a new instance of the <see cref="Instrument"/> class.
/// Protected constructor to initialize the common instrument properties.
/// </summary>
protected Instrument(Meter meter, string name, string? description, string? unit)
protected Instrument(Meter meter, string name, string? unit, string? description)
{
this.Meter = meter;
this.Name = name;
this.Description = description;
this.Unit = unit;
this.Description = description;
}

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions src/System.Diagnostics.Metrics.Temp/InstrumentT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ namespace System.Diagnostics.Metrics
/// </summary>
/// <typeparam name="T">TBD.</typeparam>
public abstract class Instrument<T> : Instrument
where T : unmanaged
where T : struct
{
/// <summary>
/// Initializes a new instance of the <see cref="Instrument{T}"/> class.
/// Protected constructor to create the instrument with the common properties.
/// </summary>
protected Instrument(Meter meter, string name, string? description, string? unit)
: base(meter, name, description, unit)
protected Instrument(Meter meter, string name, string? unit, string? description)
: base(meter, name, unit, description)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/System.Diagnostics.Metrics.Temp/Measurement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace System.Diagnostics.Metrics
/// </summary>
/// <typeparam name="T">TBD.</typeparam>
public struct Measurement<T>
where T : unmanaged
where T : struct
{
/// <summary>
/// Initializes a new instance of the <see cref="Measurement{T}"/> struct.
Expand Down
Loading

0 comments on commit d64cb4a

Please sign in to comment.