Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use auto-property instead of expression-bodied syntax #74

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions content/getting-started/fundamentals/recording-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ Each metric being measured is defined via one the available [metric types]({{< r
```csharp
public static class MyMetricsRegistry
{
public static GaugeOptions Errors => new GaugeOptions
public static GaugeOptions Errors { get; } = new GaugeOptions
{
Name = "Errors"
};

public static CounterOptions SampleCounter => new CounterOptions
public static CounterOptions SampleCounter { get; } = new CounterOptions
{
Name = "Sample Counter",
MeasurementUnit = Unit.Calls,
};

public static HistogramOptions SampleHistogram => new HistogramOptions
public static HistogramOptions SampleHistogram { get; } = new HistogramOptions
{
Name = "Sample Histogram",
Reservoir = () => new DefaultAlgorithmRReservoir(),
MeasurementUnit = Unit.MegaBytes
};

public static MeterOptions SampleMeter => new MeterOptions
public static MeterOptions SampleMeter { get; } = new MeterOptions
{
Name = "Sample Meter",
MeasurementUnit = Unit.Calls
};

public static TimerOptions SampleTimer => new TimerOptions
public static TimerOptions SampleTimer { get; } = new TimerOptions
{
Name = "Sample Timer",
MeasurementUnit = Unit.Items,
Expand All @@ -49,7 +49,7 @@ public static class MyMetricsRegistry
Reservoir = () => new DefaultForwardDecayingReservoir(sampleSize: 1028, alpha: 0.015)
};

public static ApdexOptions SampleApdex => new ApdexOptions
public static ApdexOptions SampleApdex { get; } = new ApdexOptions
{
Name = "Sample Apdex"
};
Expand Down Expand Up @@ -93,4 +93,4 @@ using (metrics.Measure.Apdex.Track(MyMetricsRegistry.SampleApdex))
## Next Steps

- [Metric Types]({{< ref "getting-started/metric-types/_index.md" >}})
- [Configuration Options]({{< ref "getting-started/fundamentals/configuration.md" >}})
- [Configuration Options]({{< ref "getting-started/fundamentals/configuration.md" >}})