protected void WriteMetered(StringBuilder sb, IMetered meter) { var unit = Abbreviate(meter.RateUnit); sb.AppendFormat(" count = {0}\n", meter.Count); sb.AppendFormat(" mean rate = {0} {1}/{2}\n", meter.MeanRate, meter.EventType, unit); sb.AppendFormat(" 1-minute rate = {0} {1}/{2}\n", meter.OneMinuteRate, meter.EventType, unit); sb.AppendFormat(" 5-minute rate = {0} {1}/{2}\n", meter.FiveMinuteRate, meter.EventType, unit); sb.AppendFormat(" 15-minute rate = {0} {1}/{2}\n", meter.FifteenMinuteRate, meter.EventType, unit); }
private static void AppendMeter(StringBuilder sb, IMetered meter) { sb.Append("{\"count\":").Append(meter.Count) .Append(",\"rate_unit\":\"").Append(meter.RateUnit).Append("\"") .Append(",\"fifteen_minute_rate\":").Append(meter.FifteenMinuteRate) .Append(",\"five_minute_rate\":").Append(meter.FiveMinuteRate) .Append(",\"one_minute_rate\":").Append(meter.OneMinuteRate) .Append(",\"mean_rate\":").Append(meter.MeanRate).Append("}"); }
private static void WriteMetered(StringBuilder sb, IMetered meter) { var unit = Abbreviate(meter.RateUnit); sb.AppendFormat(" count = {0}\n", meter.Count); sb.AppendFormat(" mean rate = {0} {1}/{2}\n", meter.MeanRate, meter.EventType, unit); sb.AppendFormat(" 1-minute rate = {0} {1}/{2}\n", meter.OneMinuteRate, meter.EventType, unit); sb.AppendFormat(" 5-minute rate = {0} {1}/{2}\n", meter.FiveMinuteRate, meter.EventType, unit); sb.AppendFormat(" 15-minute rate = {0} {1}/{2}\n", meter.FifteenMinuteRate, meter.EventType, unit); }
private static void WriteMetered(TextWriter writer, IMetered meter) { var unit = meter.RateUnit.Abbreviate(); writer.Write(" count = {0}\n", meter.Count); writer.Write(" mean rate = {0} {1}/{2}\n", meter.MeanRate, meter.EventType, unit); writer.Write(" 1-minute rate = {0} {1}/{2}\n", meter.OneMinuteRate, meter.EventType, unit); writer.Write(" 5-minute rate = {0} {1}/{2}\n", meter.FiveMinuteRate, meter.EventType, unit); writer.Write(" 15-minute rate = {0} {1}/{2}\n", meter.FifteenMinuteRate, meter.EventType, unit); }
private static void WriteMetered(IMetered x, string key, HttpContext context) { var per = $"{x.EventType}/{x.RateUnit.Abbreviate()}"; var count = $"{key}.count;dur={x.Count};desc=\"{per}\""; var meanRate = $"{key}.meanRate;dur={x.MeanRate};desc=\"{per}\""; var one = $"{key};dur={x.OneMinuteRate};desc=\"{per}\""; var five = $"{key};dur={x.FiveMinuteRate};desc=\"{per}\""; var fifteen = $"{key};dur={x.FifteenMinuteRate};desc=\"{per}\""; AddServerTimingEntry(context, count); AddServerTimingEntry(context, meanRate); AddServerTimingEntry(context, one); AddServerTimingEntry(context, five); AddServerTimingEntry(context, fifteen); }
private void reportMetered(MetricName name, IMetered meter, long timestamp) { graphite.Send(Prefix(name, "count"), format(meter.Count), timestamp); graphite.Send(Prefix(name, "m1_rate"), format(convertRate(meter.OneMinuteRate)), timestamp); graphite.Send(Prefix(name, "m5_rate"), format(convertRate(meter.FiveMinuteRate)), timestamp); graphite.Send(Prefix(name, "m15_rate"), format(convertRate(meter.FifteenMinuteRate)), timestamp); graphite.Send(Prefix(name, "mean_rate"), format(convertRate(meter.MeanRate)), timestamp); }
private void WriteMetered(IMetered meter) { var unit = Abbreviate(meter.RateUnit); _out.Write(" count = {0}\n", meter.Count); _out.Write(" mean rate = {0} {1}/{2}\n", meter.MeanRate, meter.EventType, unit); _out.Write(" 1-minute rate = {0} {1}/{2}\n", meter.OneMinuteRate, meter.EventType, unit); _out.Write(" 5-minute rate = {0} {1}/{2}\n", meter.FiveMinuteRate, meter.EventType, unit); _out.Write(" 15-minute rate = {0} {1}/{2}\n", meter.FifteenMinuteRate, meter.EventType, unit); }