时间:2016年06月16日 | 作者 : aaronyang | 分类 : 综合 | 浏览: 1417次 | 评论 0 人
整体架构:
Result (bool)
ResultCount (double)
Tags (string) 逗号分隔 的一组字符串,方便识别结果Result
Properties (name/value string pair collection),允许你去捆绑任何额外的信息到结果Result上
异常处理
健康检查是它自己调度自己,以沙箱方式运行。在wolfpack中,Execute()执行被放在try catch中的。发生异常后,Result为null,详细信息在CriticalFailureDetail属性中,CriticalFailure会被设置true,标记CriticalFailure发生了。也会生成个GUID,在wolfpack中的Wolfpack.log文件中使用。也会让Result Message和堆栈中的错误,还有异常详情中出现。
wolfpack发生错误后还是会继续工作的,你不必去处理异常,如果确实需要,你可以自定义个HealthCheck,自己try Catch,自己再重新抛出异常处理吧。
下面是目前版本监视的健康检查,如果下面没有,你可以去讨论区去讨论。
CPU % - checks the overall processor load and can optionally provide alerts based on utilisation level %
Disk Space Used - checks the amount of disk space used on the specified drive and can optionally provide alerts based on space used %
MSMQ Queue Info - checks a specific queue exists and returns additional information about it.
WMI Process Not Running - counts the number of instances of the specified process and raises a failure if there are zero running.
SqlServer Query - allows you to build health check results from custom SqlServer queries.
Windows Service State - checks the service is in the state expected.
Windows Service Startup - checks the service has the expected Startup Type set (eg: Auto, Manual, Disabled).
Host Ping - (new in v2.3) ICMP ping a server, optional roundtrip response time alert threshold and only alert if slow/no response.
Url Ping - pings a set of urls and checks they respond (Http 200 OK) and within an optional response time.
File Info - checks a specific file exists and returns additional information about it.
Folder Info - checks a specific folder exists and returns additional information about it.
DEMO测试:
(网上没代码。。。。)自己瞎折腾
引入
第一个Hello World的Check:
public class HelloWorldCheckConfig : PluginConfigBase { public string MyCustomSetting { get; set; } } public class HelloWorldCheck : HealthCheckBase<HelloWorldCheckConfig> { public HelloWorldCheck(HelloWorldCheckConfig config) : base(config) { } public override void Execute() { Messenger.Publish(NotificationRequestBuilder.AlwaysPublish(new HealthCheckData { Identity = Identity, Result = true, Info = string.Format("MyCustomSetting:={0}", _config.MyCustomSetting) }).Build()); } protected override PluginDescriptor BuildIdentity() { return new PluginDescriptor { Description = "My first custom HealthCheck!", Name = _config.FriendlyId, TypeId = new Guid("218087BB-3605-4fa5-9157-0C133674F51F") }; } } public class HelloWorldCheckConfigDiscovery : HealthCheckDiscoveryBase<HelloWorldCheckConfig, HelloWorldCheck> { protected override HelloWorldCheckConfig GetConfiguration() { return new HelloWorldCheckConfig { Enabled = true, FriendlyId = "CHANGEME!", MyCustomSetting = "HelloWorld was ere!" }; } protected override void Configure(ConfigurationEntry entry) { entry.Name = "HelloWorld"; entry.Description = "My first custom Wolfpack plugin!"; entry.Tags.AddIfMissing("HelloWorld"); } }
====================www.ayjs.net 杨洋 wpfui.com ayui ay aaronyang=======请不要转载谢谢了。=========
吐血了,别拉我,不看了,我操,codeplex全是假链接,点进去全是空的,谁有时间,谁去研究吧,坑死我了
抖音:wpfui 工作wpf,目前主maui
招聘合肥一枚WPF工程师,跟我一个开发组,10-15K,欢迎打扰
目前在合肥市企迈科技就职
AYUI8全源码 Github地址:前往获取
杨洋(AaronYang简称AY,安徽六安人)和AY交流
高中学历,2010年开始web开发,2015年1月17日开始学习WPF
声明:AYUI7个人与商用免费,源码可购买。部分DEMO不免费
不是从我处购买的ayui7源码,我不提供任何技术服务,如果你举报从哪里买的,我可以帮你转正为我的客户,并送demo
查看捐赠AYUI7.X MVC教程 更新如下:
第一课 第二课 程序加密教程
额 本文暂时没人评论 来添加一个吧
发表评论