Skip to content

Commit 87c8b78

Browse files
authored
Fix typos (#45430)
1 parent a0244b2 commit 87c8b78

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/EventSourceAndCounters.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ In general, events should follow a pattern like this:
4848
```csharp
4949
// This needs to have the NonEventAttribute because otherwise EventSource will try to auto-generate a manifest for it!
5050
[NonEvent]
51-
public void SomethingHappened(ObjectNeededToCalulateThePayload p, AnotherObjectNeededToCalculateThePayload p2)
51+
public void SomethingHappened(ObjectNeededToCalculateThePayload p, AnotherObjectNeededToCalculateThePayload p2)
5252
{
5353
// Check that the source is enabled (regardless of level)
5454
if (IsEnabled())
@@ -57,7 +57,7 @@ public void SomethingHappened(ObjectNeededToCalulateThePayload p, AnotherObjectN
5757
_somethingsHappenedCounter.WriteMetric(1.0f);
5858

5959
// Check that this specific event is actually enabled (by level and optionally keywords).
60-
if (IsEnabled(EventLevel.Informational, EventKeyords.None))
60+
if (IsEnabled(EventLevel.Informational, EventKeywords.None))
6161
{
6262
// Do any complex calculation needed to determine the payload values.
6363
var payloadValue = CalculateThePayload(p);
@@ -74,7 +74,7 @@ public void SomethingHappened(ObjectNeededToCalulateThePayload p, AnotherObjectN
7474
private void SomethingHappened(string payloadValue, int anotherPayloadValue, double morePayload) => WriteEvent(42, payloadValue, anotherPayloadValue, morePayload);
7575
```
7676

77-
The above example is one that covers basically all the scenarios. However, many of the individual elements of that pattern can be elided when not needed. For example, when there isn't any complex payload calcuation, everything can be done in a single method with the `Event` attribute. We generally write EventCounters regardless of the level that the provider is activated at (see the section on counters), hence why we check `IsEnabled()` (no parameters) in the above example. However, if there is no counter associated with the event, the `IsEnabled(EventLevel, EventKeyword)` overload can be used directly. So, below is an example of an event with a simple payload and no event counter:
77+
The above example is one that covers basically all the scenarios. However, many of the individual elements of that pattern can be elided when not needed. For example, when there isn't any complex payload calculation, everything can be done in a single method with the `Event` attribute. We generally write EventCounters regardless of the level that the provider is activated at (see the section on counters), hence why we check `IsEnabled()` (no parameters) in the above example. However, if there is no counter associated with the event, the `IsEnabled(EventLevel, EventKeyword)` overload can be used directly. So, below is an example of an event with a simple payload and no event counter:
7878

7979
```csharp
8080
[Event(eventId: 42, Level = EventLevel.Informational)]
@@ -95,7 +95,7 @@ When we have places where we want to enable events but only when explicitly requ
9595

9696
Since Event Counters are only actually enabled when the `EventCounterIntervalSec` parameter is provided to the event source when a listener attaches, we don't really need a level or keyword to control them. As a result, we always write to them, when the EventSource itself is enabled.
9797

98-
There are a number of different "kinds" of event counters in our system. They are characterized by what kind of value is written in the `EventCounter.WriteMetric` call. Counters provide mulitple aggregations (Count, Mean, StdDev, Min, Max), and certain aggregations are appropriate for different kinds of counters.
98+
There are a number of different "kinds" of event counters in our system. They are characterized by what kind of value is written in the `EventCounter.WriteMetric` call. Counters provide multiple aggregations (Count, Mean, StdDev, Min, Max), and certain aggregations are appropriate for different kinds of counters.
9999

100100
* Counters track the number of times an event occurs. They are written by calling `.WriteMetric(1.0f)` to the counter. The consumer can determine the number of events that occurred over an interval by reading the "Count" aggregation. They should have names combining a plural noun and adjective, like "RequestsStarted"
101101
* Metrics track a value that changes over time or per "unit" (i.e. per request, per connection, etc.). They are written by calling `.WriteMetric` with the current value of the metric. The consumer can use the aggregates to get data about the metric over time. They should have names combining a singular nouns describing the metric, like "RequestBodySize"

0 commit comments

Comments
 (0)