Meter.CreateCounter Metoda

Definice

Přetížení

CreateCounter<T>(String, String, String)

Create objektu Counter metrik.

CreateCounter<T>(String, String, String, IEnumerable<KeyValuePair<String,Object>>)

Vytvoří objekt čítače metrik.

CreateCounter<T>(String, String, String)

Zdroj:
Meter.cs
Zdroj:
Meter.cs
Zdroj:
Meter.cs

Create objektu Counter metrik.

public System.Diagnostics.Metrics.Counter<T> CreateCounter<T> (string name, string? unit = default, string? description = default) where T : struct;
member this.CreateCounter : string * string * string -> System.Diagnostics.Metrics.Counter<'T (requires 'T : struct)> (requires 'T : struct)
Public Function CreateCounter(Of T As Structure) (name As String, Optional unit As String = Nothing, Optional description As String = Nothing) As Counter(Of T)

Parametry typu

T

Číselný typ měření.

Parametry

name
String

Název nástroje. Nemůže být null.

unit
String

Volitelná přístrojová jednotka měření.

description
String

Volitelný popis nástroje.

Návraty

Nový čítač.

Poznámky

Čítač je nástroj, který podporuje nezáporné přírůstky. Příklad použití pro čítač:

  • Spočítejte počet přijatých bajtů.
  • Spočítejte počet dokončených žádostí.
  • Spočítejte počet vytvořených účtů.
  • Spočítejte počet spuštěných kontrolních bodů.
  • Spočítejte počet chyb HTTP 5xx.

Platí pro

CreateCounter<T>(String, String, String, IEnumerable<KeyValuePair<String,Object>>)

Zdroj:
Meter.cs
Zdroj:
Meter.cs

Vytvoří objekt čítače metrik.

public:
generic <typename T>
 where T : value class System::Diagnostics::Metrics::Counter<T> ^ CreateCounter(System::String ^ name, System::String ^ unit, System::String ^ description, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>> ^ tags);
public System.Diagnostics.Metrics.Counter<T> CreateCounter<T> (string name, string? unit, string? description, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object?>> tags) where T : struct;
member this.CreateCounter : string * string * string * seq<System.Collections.Generic.KeyValuePair<string, obj>> -> System.Diagnostics.Metrics.Counter<'T (requires 'T : struct)> (requires 'T : struct)
Public Function CreateCounter(Of T As Structure) (name As String, unit As String, description As String, tags As IEnumerable(Of KeyValuePair(Of String, Object))) As Counter(Of T)

Parametry typu

T

Číselný typ měření.

Parametry

name
String

Název nástroje. Nemůže to být null.

unit
String

Volitelná přístrojová jednotka měření.

description
String

Volitelný popis nástroje.

tags
IEnumerable<KeyValuePair<String,Object>>

Značky, které se mají připojit k čítači.

Návraty

Nový čítač.

Poznámky

Čítač je nástroj, který podporuje nezáporné přírůstky.

Příklad použití pro čítač:

  • Spočítejte počet přijatých bajtů.
  • Spočítejte počet dokončených žádostí.
  • Spočítejte počet vytvořených účtů.
  • Spočítejte počet spuštěných kontrolních bodů.
  • Spočítejte počet chyb HTTP 5xx.

Platí pro