本文整理汇总了C#中TimeUnit.Name方法的典型用法代码示例。如果您正苦于以下问题:C# TimeUnit.Name方法的具体用法?C# TimeUnit.Name怎么用?C# TimeUnit.Name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TimeUnit
的用法示例。
在下文中一共展示了TimeUnit.Name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StepCounter
/// <summary>
/// Initializes a new instance of the <see cref="StepCounter"/> class
/// by using the given <see cref="MetricConfig"/>, initial value and
/// <see cref="MetricContext"/>.
/// </summary>
/// <param name="config">
/// A <see cref="MetricConfig"/> object containing the configuration
/// that should be used by the <see cref="StepCounter"/> object.
/// </param>
/// <param name="initial">
/// The initial value of the counter.
/// </param>
/// <param name="unit">
/// The unit to be used to report the computed rate.
/// </param>
/// <param name="context">
/// The <see cref="MetricContext"/> to be used by the counter.
/// </param>
public StepCounter(MetricConfig config, long initial, TimeUnit unit,
MetricContext context)
: base(
config
.WithAdditionalTag(MetricType.Normalized.AsTag())
.WithAdditionalTag("unit", unit.Name()), context) {
prev_count_ = initial;
curr_count_ = initial;
prev_tick_ = curr_tick_ = context.Tick;
unit_ = unit;
}