本文整理汇总了C#中Unit.FormatCount方法的典型用法代码示例。如果您正苦于以下问题:C# Unit.FormatCount方法的具体用法?C# Unit.FormatCount怎么用?C# Unit.FormatCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Unit
的用法示例。
在下文中一共展示了Unit.FormatCount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReportCounter
protected override void ReportCounter(string name, CounterValue value, Unit unit, MetricTags tags)
{
this.WriteMetricName(name);
WriteValue("Count", unit.FormatCount(value.Count));
if (value.Items.Length > 0)
{
WriteValue("Total Items", value.Items.Length.ToString());
}
for (int i = 0; i < value.Items.Length; i++)
{
var key = "Item " + i.ToString();
var item = value.Items[i];
var val = string.Format("{0:00.00}% {1,5} {2} [{3}]", item.Percent, item.Count, unit.Name, item.Item);
WriteValue(key, val);
}
}
示例2: WriteMeter
private void WriteMeter(MeterValue value, Unit unit, TimeUnit rateUnit)
{
WriteValue("Count", unit.FormatCount(value.Count));
WriteValue("Mean Value", unit.FormatRate(value.MeanRate, rateUnit));
WriteValue("1 Minute Rate", unit.FormatRate(value.OneMinuteRate, rateUnit));
WriteValue("5 Minute Rate", unit.FormatRate(value.FiveMinuteRate, rateUnit));
WriteValue("15 Minute Rate", unit.FormatRate(value.FifteenMinuteRate, rateUnit));
}
示例3: WriteHistogram
private void WriteHistogram(HistogramValue value, Unit unit, TimeUnit? durationUnit = null)
{
WriteValue("Count", unit.FormatCount(value.Count));
WriteValue("Last", unit.FormatDuration(value.LastValue, durationUnit));
if (!string.IsNullOrWhiteSpace(value.LastUserValue))
{
WriteValue("Last User Value", value.LastUserValue);
}
WriteValue("Min", unit.FormatDuration(value.Min, durationUnit));
if (!string.IsNullOrWhiteSpace(value.MinUserValue))
{
WriteValue("Min User Value", value.MinUserValue);
}
WriteValue("Max", unit.FormatDuration(value.Max, durationUnit));
if (!string.IsNullOrWhiteSpace(value.MaxUserValue))
{
WriteValue("Max User Value", value.MaxUserValue);
}
WriteValue("Mean", unit.FormatDuration(value.Mean, durationUnit));
WriteValue("StdDev", unit.FormatDuration(value.StdDev, durationUnit));
WriteValue("Median", unit.FormatDuration(value.Median, durationUnit));
WriteValue("75%", unit.FormatDuration(value.Percentile75, durationUnit), sign: "<=");
WriteValue("95%", unit.FormatDuration(value.Percentile95, durationUnit), sign: "<=");
WriteValue("98%", unit.FormatDuration(value.Percentile98, durationUnit), sign: "<=");
WriteValue("99%", unit.FormatDuration(value.Percentile99, durationUnit), sign: "<=");
WriteValue("99.9%", unit.FormatDuration(value.Percentile999, durationUnit), sign: "<=");
}
示例4: ReportCounter
protected override void ReportCounter(string name, long value, Unit unit)
{
this.WriteMetricName(name);
WriteValue("Count", unit.FormatCount(value));
}