当前位置: 首页 > news >正文

263企业邮箱修改密码小程序seo推广技巧

263企业邮箱修改密码,小程序seo推广技巧,怎么做网站关键词优化,网络规划设计师视频百度云在自定义EventSource时#xff0c;可以使用四种EventCounter#xff1a;EventCounter#xff1a;统计指标收集器#xff0c;比如平均值#xff0c;最大值#xff0c;最小值PollingCounter#xff1a;自定义统计指标收集器#xff0c;通过自定义统计方法的方式实现对指标… 在自定义EventSource时可以使用四种EventCounterEventCounter统计指标收集器比如平均值最大值最小值PollingCounter自定义统计指标收集器通过自定义统计方法的方式实现对指标的统计IncrementingEventCounter累加指标收集器采集一定时间段内的指标汇总IncrementingPollingCounter自定义累加指标收集器通过自定义累函数实现指标收集本例先说一下用IncrementingEventCounter实现自定义EventSource。本例是定义了一个WorkingEventSouce事件源定义了WorkingEventListener监听器和发送指标采集指标的类型IncrementingEventCounterDemo。WorkingEventSouce事件源[EventSource(Name WorkingEventSource)] public sealed class WorkingEventSource : EventSource {public static readonly WorkingEventSource Instance new WorkingEventSource();private IncrementingEventCounter _requestCounter;/// summary/// working-time 是dotnet-counters --counters的参数/// /summaryprivate WorkingEventSource() _requestCounter new IncrementingEventCounter(working-time, this){DisplayName Request Processing Time,DisplayUnits ms};/// summary/// Working发送业务指标/// /summary/// param nameelapsedMilliseconds/parampublic void Working(long elapsedMilliseconds){_requestCounter.Increment(elapsedMilliseconds);}protected override void Dispose(bool disposing){_requestCounter?.Dispose();_requestCounter null;base.Dispose(disposing);} } WorkingEventListener监听器/// summary /// 指标输出委托 /// /summary /// param namekey/param /// param namevalue/param public delegate void WriteContent(string key, string value); /// summary /// 指标监听器 /// /summary public class CustomEventListener : EventListener {protected readonly string[] _countersName new string[] { WorkingEventSource };public event WriteContent WriteEvent;protected override void OnEventSourceCreated(EventSource source){if (_countersName.Contains(source.Name)){EnableEvents(source, EventLevel.Verbose, EventKeywords.All, new Dictionarystring, string(){[EventCounterIntervalSec] 1});}}protected override void OnEventWritten(EventWrittenEventArgs eventData){if (!eventData.EventName.Equals(EventCounters)){return;}for (int i 0; i eventData.Payload.Count; i){if (eventData.Payload[i] is IDictionarystring, object eventPayload){var counterName ;var counterValue ;if (eventPayload.TryGetValue(DisplayName, out object displayValue)){counterName displayValue.ToString();}if (eventPayload.TryGetValue(Mean, out object value) ||eventPayload.TryGetValue(Increment, out value)){counterValue value.ToString();}WriteEvent(counterName, counterValue);}}} } 发送指标采集指标的类型IncrementingEventCounterDemo public class IncrementingEventCounterDemo{public static void Run(){var listener new CustomEventListener();listener.WriteEvent Listener_WriteEvent;new Thread(Working).Start();}/// summary/// 以控制台方式展示采集到的指标/// /summary/// param namekey/param/// param namevalue/paramprivate static void Listener_WriteEvent(string key, string value){Console.WriteLine(${key}{value});}/// summary/// 模拟写业务指标每秒写两次i递增/// /summarystatic void Working(){int i 0;while (true){var count i;Console.WriteLine(count);WorkingEventSource.Instance.Working(count);System.Threading.Thread.Sleep(500);i 1;}} } 结果可以看到每次都是时间段里数值之和下图是跟踪EventListener的OnEventWritten的Payload有效载荷时的数据可以看到有时间段内总和—Increment次数时间间隔等信息这是因为当前计数据类型是IncrementingEventCounter。
http://www.pierceye.com/news/838645/

相关文章:

  • 深圳市住房和建设局网站登录怎样在百度建网站
  • 外国做视频在线观看网站asp简单网站开发
  • 介绍移动互联网的网站有哪些做网站时怎么选择数据库类型
  • 工厂的网站在哪里做的免费建站的软件
  • 中国电子系统建设三公司网站网站建设上如何提高市场竞争力
  • 青海住房和建设厅网站电子商务网站建设与管理教案
  • 免费在线自助建站搬瓦工可以长期做网站
  • 建设外贸网站报价外贸网站制作推广公司
  • 网站开发人员工作内容白沟做网站
  • 产品展示网站模板源码产品宣传
  • 国内wordpress有名的网站河南住房和城乡建设厅网站资质
  • 湛江seo建站wordpress5.1更新
  • 泊头公司做网站做网站价格差异很大
  • 网站开发啊wordpress 图片本地化
  • 尚品中国多年专注于高端网站建设免费加盟无需店面
  • 游标卡尺 东莞网站建设wordpress 域名解析
  • 站长工具视频怎么开免费网站
  • 网站地址怎么申请注册最近新闻大事
  • interidea 做网站网站域名备案 更改
  • 哈尔滨公司做网站动画设计的大学排名
  • 网站建设与网页制作试卷网站搜索引擎优化推广
  • 网站子目录设计网站开发数据库技术
  • 可以做音基题的音乐网站上海网站设计公司有哪些
  • 昆明做网站公司做家居的网站
  • 网站建设首选易网宣软文代发
  • 手机版网站开发用什么语言自己建设的网站怎么赚钱
  • 宁波建设监理协会网站软件开发文档的作用
  • 兰州电商平台网站建设网路神做网站怎么样
  • 诸城易讯网站建设服务中心网址的域名
  • 制作商务网站应用公园制作app软件下载