Your SlideShare is downloading. ×
0
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Automated self-testing and health check of live Sling instances
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Automated self-testing and health check of live Sling instances

1,565

Published on

Slides of my talk at adaptTop 2013, "Automated self-testing and health check of live Sling instances". The use cases are similar to my previous presentation at CQCon, but the tool has been almost …

Slides of my talk at adaptTop 2013, "Automated self-testing and health check of live Sling instances". The use cases are similar to my previous presentation at CQCon, but the tool has been almost completely rewritten in the meantime. See http://sling.apache.org/documentation/bundles/sling-health-check-tool.html for more info on the Sling health check tools.

Published in: Technology, Economy & Finance
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,565
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
31
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Automatedself-testingandhealthcheck ofliveSlinginstances BertrandDelacrétaz Slingcommitter,ASFMemberand(current)Director SeniorDeveloper,AdobeCQR&Dteam,Basel @bdelacretaz-grep.codeconsult.ch adaptTo()Berlin,September2013 slidesrevision2013-09-24
  • 2. Sling health check tools - adaptTo() 2013 - Bertrand Delacretaz How can you trust your current (fragile?) combination of OSGi bundles and configs? It needs live TESTING. 2 picture: anitapeppers on morguefile.com
  • 3. whatdowemeanby HealthChecks?
  • 4. Sling health check tools - adaptTo() 2013 - Bertrand Delacretaz HealthCheck APIs 4 public interface HealthCheck { Result execute(); } public class Result { public boolean isOk() ... public Status getStatus() ... public Iterator<ResultLog.Entry> iterator() ... } HealthCheck OSGi services Serviceprops: name,MBean,tags
  • 5. Webconsole,JMX
  • 6. Sling health check tools - adaptTo() 2013 - Bertrand Delacretaz Webconsole plugin /system/console/healthcheck 6
  • 7. Sling health check tools - adaptTo() 2013 - Bertrand Delacretaz Health Check MBeans 7 Serviceprops name,MBean,tags
  • 8. Sling health check tools - adaptTo() 2013 - Bertrand Delacretaz Health Checks as JMX processors 8 MBean MBean MBean HC HC HC using expressions like jmx.attribute('java.lang:type=ClassLoading', 'LoadedClassCount') > 10 && jmx.attribute('java.lang:type=Runtime', 'ManagementSpecVersion') > 1
  • 9. Usecases
  • 10. Sling health check tools - adaptTo() 2013 - Bertrand Delacretaz Use cases 10 System status Configuration Self-testPerformance Allbundlesup? Initialcontentready? Diskspaceok? Externalservicesok? Loadwithinbounds?(forjobs) Requestspersecondok? Requestdurationok? Freememoryok? Replicationqueuesok? Securitychecklistok? Defaultaccountsdisabled? Democontentremoved? Startupsmoketests? Keephistoryofresults?
  • 11. whatdoyouget Outofthebox?
  • 12. Sling health check tools - adaptTo() 2013 - Bertrand Delacretaz Out of the box - core 12 JmxAttributeHealthCheck ScriptableHealthCheck CompositeHealthCheck Single JMX attributes Script(let)s in any language using BindingValuesProviders Run other Health Checks based on their tags
  • 13. Sling health check tools - adaptTo() 2013 - Bertrand Delacretaz Out of the box - support bundle 13 SlingRequestStatusHC DefaultLoginsHealthCheck Is my resource there? Including its scripts? admin:admin -> fail? current HC bundles: org.apache.sling.hc.core org.apache.sling.hc.support org.apache.sling.hc.webconsole org.apache.sling.hc.jmx org.apache.sling.hc.samples
  • 14. howdoyouwrite YourownHealthChecks?
  • 15. Sling health check tools - adaptTo() 2013 - Bertrand Delacretaz Custom Health Checks 15 @Component(...policy=ConfigurationPolicy.REQUIRE, metatype=true) @Property(name=HealthCheck.NAME), @Property(name=HealthCheck.TAGS,unbounded=PropertyUnbounded.ARRAY), @Property(name=HealthCheck.MBEAN_NAME) @Service(value=HealthCheck.class) public class MyHealthCheck { public Result execute() { FormattingResultLog f = new FormattingResultLog(); ... if(badThings) f.warn(“Something happened with {}”, foo); return new Result(f); } } Execute “quickly”, cache...
  • 16. Sling health check tools - adaptTo() 2013 - Bertrand Delacretaz That’s it - have fun! 16 JmxAttributeHealthCheck ScriptableHealthCheck CompositeHealthCheck SlingRequestStatusHC DefaultLoginsHealthCheck @Service(value=HealthCheck.class) public class MyHealthCheck { ....generate a Result quickly } Docs at sling.apache.org : bundles : health check. Discuss on the Sling dev list. I’m @bdelacretaz - thanks! JMX processors Webconsole
  • 17. APACHE SLING & FRIENDS TECH MEETUP BERLIN, 23-25 SEPTEMBER 2013

×