├── gradle.properties ├── OSSMETADATA ├── settings.gradle ├── src └── main │ ├── webapp │ ├── css │ │ ├── simplegrid │ │ │ ├── README.txt │ │ │ ├── 1236_grid.css │ │ │ ├── LICENSE.txt │ │ │ ├── 986_grid.css │ │ │ ├── percentage_grid.css │ │ │ └── 720_grid.css │ │ ├── global.css │ │ └── resets.css │ ├── images │ │ ├── hystrix-logo.png │ │ └── hystrix-logo-tagline-tiny.png │ ├── components │ │ ├── hystrixCommand │ │ │ ├── magnifying-glass-icon.png │ │ │ ├── magnifying-glass-icon-20.png │ │ │ ├── templates │ │ │ │ ├── hystrixCircuitProperties.html │ │ │ │ ├── hystrixCircuitContainer.html │ │ │ │ └── hystrixCircuit.html │ │ │ ├── hystrixCommand.css │ │ │ └── hystrixCommand.js │ │ └── hystrixThreadPool │ │ │ ├── templates │ │ │ ├── hystrixThreadPool.html │ │ │ └── hystrixThreadPoolContainer.html │ │ │ ├── hystrixThreadPool.css │ │ │ └── hystrixThreadPool.js │ ├── index.css │ ├── WEB-INF │ │ ├── classes │ │ │ └── log4j.properties │ │ └── web.xml │ ├── js │ │ ├── LICENSE │ │ ├── tmpl.js │ │ ├── jquery.tinysort.min.js │ │ └── jquery.min.js │ ├── monitor │ │ ├── monitor.css │ │ └── monitor.html │ └── index.html │ ├── test │ └── com │ │ └── netflix │ │ └── hystrix │ │ └── dashboard │ │ └── stream │ │ └── UrlUtilsTest.java │ └── java │ └── com │ └── netflix │ └── hystrix │ └── dashboard │ └── stream │ ├── UrlUtils.java │ ├── EurekaInfoServlet.java │ ├── MockStreamServlet.java │ └── ProxyStreamServlet.java ├── gradle ├── wrapper │ └── gradle-wrapper.properties └── javadocStyleSheet.css ├── .gitignore ├── README.md ├── gradlew.bat ├── gradlew └── LICENSE-2.0.txt /gradle.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /OSSMETADATA: -------------------------------------------------------------------------------- 1 | osslifecycle=archived 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name='hystrix-dashboard' 2 | -------------------------------------------------------------------------------- /src/main/webapp/css/simplegrid/README.txt: -------------------------------------------------------------------------------- 1 | http://simplegrid.info/ -------------------------------------------------------------------------------- /src/main/webapp/images/hystrix-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netflix-Skunkworks/hystrix-dashboard/master/src/main/webapp/images/hystrix-logo.png -------------------------------------------------------------------------------- /src/main/webapp/images/hystrix-logo-tagline-tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netflix-Skunkworks/hystrix-dashboard/master/src/main/webapp/images/hystrix-logo-tagline-tiny.png -------------------------------------------------------------------------------- /src/main/webapp/components/hystrixCommand/magnifying-glass-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netflix-Skunkworks/hystrix-dashboard/master/src/main/webapp/components/hystrixCommand/magnifying-glass-icon.png -------------------------------------------------------------------------------- /src/main/webapp/components/hystrixCommand/magnifying-glass-icon-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Netflix-Skunkworks/hystrix-dashboard/master/src/main/webapp/components/hystrixCommand/magnifying-glass-icon-20.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Jun 19 21:27:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip 7 | -------------------------------------------------------------------------------- /src/main/webapp/index.css: -------------------------------------------------------------------------------- 1 | table { 2 | width: 100%; 3 | border-collapse: collapse; 4 | } 5 | 6 | table, td { 7 | border: 1px solid #DBDBDB; 8 | } 9 | 10 | table tr:nth-child(even) { 11 | background-color: #ECECEC; 12 | } 13 | 14 | table tr:nth-child(odd) { 15 | background-color: #FFFFFF; 16 | } 17 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/log4j.properties: -------------------------------------------------------------------------------- 1 | log4j.rootLogger=INFO, FILE 2 | log4j.appender.FILE=org.apache.log4j.ConsoleAppender 3 | log4j.appender.FILE.layout=org.apache.log4j.PatternLayout 4 | log4j.appender.FILE.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %p %C:%L [%C{1}] [%M]: %m%n 5 | 6 | log4j.appender.FILE.httpclient=ERROR 7 | -------------------------------------------------------------------------------- /src/main/webapp/components/hystrixCommand/templates/hystrixCircuitProperties.html: -------------------------------------------------------------------------------- 1 |
2 |
Median
3 |
<%= sla_medianLastMinute %>ms
4 |
99th
5 |
<%= sla_percentile99LastMinute %>ms
6 |
7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled source # 2 | ################### 3 | *.com 4 | *.class 5 | *.dll 6 | *.exe 7 | *.o 8 | *.so 9 | 10 | # Packages # 11 | ############ 12 | # it's better to unpack these files and commit the raw source 13 | # git has its own built in compression methods 14 | *.7z 15 | *.dmg 16 | *.gz 17 | *.iso 18 | *.jar 19 | *.rar 20 | *.tar 21 | *.zip 22 | 23 | # Logs and databases # 24 | ###################### 25 | *.log 26 | 27 | # OS generated files # 28 | ###################### 29 | .DS_Store* 30 | ehthumbs.db 31 | Icon? 32 | Thumbs.db 33 | 34 | # Editor Files # 35 | ################ 36 | *~ 37 | *.swp 38 | 39 | # Gradle Files # 40 | ################ 41 | .gradle 42 | .m2 43 | 44 | # Build output directies 45 | target/ 46 | build/ 47 | 48 | # IntelliJ specific files/directories 49 | out 50 | .idea 51 | *.ipr 52 | *.iws 53 | *.iml 54 | atlassian-ide-plugin.xml 55 | 56 | # Eclipse specific files/directories 57 | .classpath 58 | .project 59 | .settings 60 | .metadata 61 | bin/ 62 | 63 | # NetBeans specific files/directories 64 | .nbattrs 65 | 66 | -------------------------------------------------------------------------------- /src/main/webapp/css/simplegrid/1236_grid.css: -------------------------------------------------------------------------------- 1 | /* SimpleGrid - a fork of CSSGrid by Crowd Favorite (https://github.com/crowdfavorite/css-grid) 2 | * http://simplegrid.info 3 | * by Conor Muirhead (http://conor.cc) of Early LLC (http://earlymade.com) 4 | * License: http://creativecommons.org/licenses/MIT/ */ 5 | 6 | /* Containers */ 7 | body { font-size: 1.125em; } 8 | .grid{ width:1206px; } 9 | 10 | /* 6-Col Grid Sizes */ 11 | .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5{ width:176px; } /* Sixths */ 12 | .slot-0-1,.slot-1-2,.slot-2-3,.slot-3-4,.slot-4-5{ width:382px; } /* Thirds */ 13 | .slot-0-1-2-3,.slot-1-2-3-4,.slot-2-3-4-5{ width:794px; } /* Two-Thirds */ 14 | .slot-0-1-2-3-4,.slot-1-2-3-4-5{ width:1000px; } /* Five-Sixths */ 15 | 16 | /* 4-Col Grid Sizes */ 17 | .slot-6,.slot-7,.slot-8,.slot-9{ width:279px; } /* Quarters */ 18 | .slot-6-7-8,.slot-7-8-9{ width:897px; } /* Three-Quarters */ 19 | 20 | /* 6-Col/4-Col Shared Grid Sizes */ 21 | .slot-0-1-2,.slot-1-2-3,.slot-2-3-4,.slot-3-4-5, .slot-6-7,.slot-7-8,.slot-8-9{ width:588px; } /* Halves */ -------------------------------------------------------------------------------- /src/main/webapp/css/simplegrid/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Crowd Favorite, Ltd. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /src/main/test/com/netflix/hystrix/dashboard/stream/UrlUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.netflix.hystrix.dashboard.stream; 2 | 3 | import org.junit.Test; 4 | 5 | /** 6 | * Copyright 2013 Netflix, Inc. 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | /** 21 | * UrlUtilsTest unit tests 22 | * 23 | * @author diegopacheco 24 | * 25 | */ 26 | public class UrlUtilsTest { 27 | 28 | @Test(expected=IllegalArgumentException.class) 29 | public void testReadXmlInputStreamWithNull() { 30 | UrlUtils.readXmlInputStream(null); 31 | } 32 | 33 | @Test(expected=IllegalArgumentException.class) 34 | public void testReadXmlInputStreamWithBlank() { 35 | UrlUtils.readXmlInputStream(""); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/webapp/css/simplegrid/986_grid.css: -------------------------------------------------------------------------------- 1 | /* SimpleGrid - a fork of CSSGrid by Crowd Favorite (https://github.com/crowdfavorite/css-grid) 2 | * http://simplegrid.info 3 | * by Conor Muirhead (http://conor.cc) of Early LLC (http://earlymade.com) 4 | * License: http://creativecommons.org/licenses/MIT/ */ 5 | 6 | /* Containers */ 7 | body { font-size: 100%; } 8 | .grid{ width:966px; } 9 | 10 | /* Slots Setup */ 11 | .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5,.slot-0-1,.slot-0-1-2,.slot-0-1-2-3,.slot-0-1-2-3-4,.slot-0-1-2-3-4-5,.slot-1-2,.slot-1-2-3,.slot-1-2-3-4,.slot-1-2-3-4-5,.slot-2-3,.slot-2-3-4,.slot-2-3-4-5,.slot-3-4,.slot-3-4-5,.slot-4-5,.slot-6,.slot-7,.slot-8,.slot-9,.slot-6-7,.slot-6-7-8,.slot-6-7-8-9,.slot-7-8,.slot-7-8-9,.slot-8-9{ display:inline; float:left; margin-left:30px; } 12 | 13 | /* 6-Col Grid Sizes */ 14 | .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5{ width:136px; } /* Sixths */ 15 | .slot-0-1,.slot-1-2,.slot-2-3,.slot-3-4,.slot-4-5{ width:302px; } /* Thirds */ 16 | .slot-0-1-2-3,.slot-1-2-3-4,.slot-2-3-4-5{ width:634px; } /* Two-Thirds */ 17 | .slot-0-1-2-3-4,.slot-1-2-3-4-5{ width:800px; } /* Five-Sixths */ 18 | 19 | /* 4-Col Grid Sizes */ 20 | .slot-6,.slot-7,.slot-8,.slot-9{ width:219px; } /* Quarters */ 21 | .slot-6-7-8,.slot-7-8-9{ width:717px; } /* Three-Quarters */ 22 | 23 | /* 6-Col/4-Col Shared Grid Sizes */ 24 | .slot-0-1-2,.slot-1-2-3,.slot-2-3-4,.slot-3-4-5, .slot-6-7,.slot-7-8,.slot-8-9{ width:468px; } /* Halves */ -------------------------------------------------------------------------------- /src/main/webapp/js/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Michael Bostock 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * The name Michael Bostock may not be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, 21 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 22 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /src/main/webapp/css/simplegrid/percentage_grid.css: -------------------------------------------------------------------------------- 1 | /* Extension of SimpleGrid by benjchristensen to allow percentage based sizing on very large displays 2 | * 3 | * SimpleGrid - a fork of CSSGrid by Crowd Favorite (https://github.com/crowdfavorite/css-grid) 4 | * http://simplegrid.info 5 | * by Conor Muirhead (http://conor.cc) of Early LLC (http://earlymade.com) 6 | * License: http://creativecommons.org/licenses/MIT/ */ 7 | 8 | /* Containers */ 9 | body { font-size: 1.125em; } 10 | .grid{ width:100%; } 11 | 12 | /* Slots Setup */ 13 | .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5,.slot-0-1,.slot-0-1-2,.slot-0-1-2-3,.slot-0-1-2-3-4,.slot-0-1-2-3-4-5,.slot-1-2,.slot-1-2-3,.slot-1-2-3-4,.slot-1-2-3-4-5,.slot-2-3,.slot-2-3-4,.slot-2-3-4-5,.slot-3-4,.slot-3-4-5,.slot-4-5,.slot-6,.slot-7,.slot-8,.slot-9,.slot-6-7,.slot-6-7-8,.slot-6-7-8-9,.slot-7-8,.slot-7-8-9,.slot-8-9{ display:inline; float:left; margin-left:0px; } 14 | 15 | 16 | /* 6-Col Grid Sizes */ 17 | .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5{ width:16.6%; } /* Sixths */ 18 | .slot-0-1,.slot-1-2,.slot-2-3,.slot-3-4,.slot-4-5{ width:33.3%; } /* Thirds */ 19 | .slot-0-1-2-3,.slot-1-2-3-4,.slot-2-3-4-5{ width:66.6%; } /* Two-Thirds */ 20 | .slot-0-1-2-3-4,.slot-1-2-3-4-5{ width:83.3%; } /* Five-Sixths */ 21 | 22 | /* 4-Col Grid Sizes */ 23 | .slot-6,.slot-7,.slot-8,.slot-9{ width:25%; } /* Quarters */ 24 | .slot-6-7-8,.slot-7-8-9{ width:75%; } /* Three-Quarters */ 25 | 26 | /* 6-Col/4-Col Shared Grid Sizes */ 27 | .slot-0-1-2,.slot-1-2-3,.slot-2-3-4,.slot-3-4-5, .slot-6-7,.slot-7-8,.slot-8-9{ width:50%; } /* Halves */ -------------------------------------------------------------------------------- /src/main/webapp/components/hystrixThreadPool/templates/hystrixThreadPool.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | Host: <%= addCommas(ratePerSecondPerHost) %>/s 6 |
7 |
8 | Cluster: <%= addCommas(ratePerSecond) %>/s 9 |
10 | 11 |
12 | 13 |
14 |
Active
15 |
<%= currentActiveCount%>
16 | 17 |
Max Active
18 |
<%= addCommas(rollingMaxActiveThreads)%>
19 |
20 | 21 |
22 |
Queued
23 |
<%= currentQueueSize %>
24 |
Executions
25 |
<%= addCommas(rollingCountThreadsExecuted)%>
26 |
27 |
28 |
Pool Size
29 |
<%= currentPoolSize %>
30 |
Queue Size
31 |
<%= propertyValue_queueSizeRejectionThreshold %>
32 |
33 | -------------------------------------------------------------------------------- /src/main/java/com/netflix/hystrix/dashboard/stream/UrlUtils.java: -------------------------------------------------------------------------------- 1 | package com.netflix.hystrix.dashboard.stream; 2 | 3 | import java.io.InputStream; 4 | import java.net.HttpURLConnection; 5 | import java.net.URL; 6 | 7 | /** 8 | * Copyright 2013 Netflix, Inc. 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | /** 23 | * Utility class to work with InputStreams 24 | * 25 | * @author diegopacheco 26 | * 27 | */ 28 | public class UrlUtils { 29 | 30 | public static InputStream readXmlInputStream(String uri){ 31 | 32 | if (uri==null || "".equals(uri)) throw new IllegalArgumentException("Invalid uri. URI cannot be null or blank. "); 33 | 34 | try{ 35 | URL url = new URL(uri); 36 | HttpURLConnection connection = (HttpURLConnection) url.openConnection(); 37 | connection.setRequestMethod("GET"); 38 | connection.setRequestProperty("Accept", "application/xml"); 39 | 40 | return connection.getInputStream(); 41 | 42 | }catch(Exception e){ 43 | throw new RuntimeException(e); 44 | } 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | MockStreamServlet 10 | MockStreamServlet 11 | com.netflix.hystrix.dashboard.stream.MockStreamServlet 12 | 13 | 14 | MockStreamServlet 15 | /mock.stream 16 | 17 | 18 | 19 | 20 | 21 | ProxyStreamServlet 22 | ProxyStreamServlet 23 | com.netflix.hystrix.dashboard.stream.ProxyStreamServlet 24 | 25 | 26 | ProxyStreamServlet 27 | /proxy.stream 28 | 29 | 30 | 31 | 32 | EurekaInfoServlet 33 | EurekaInfoServlet 34 | com.netflix.hystrix.dashboard.stream.EurekaInfoServlet 35 | 36 | 37 | EurekaInfoServlet 38 | /eureka 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/webapp/js/tmpl.js: -------------------------------------------------------------------------------- 1 | 2 | //Simple JavaScript Templating 3 | //John Resig - http://ejohn.org/ - MIT Licensed 4 | // http://ejohn.org/blog/javascript-micro-templating/ 5 | (function(window, undefined) { 6 | var cache = {}; 7 | 8 | window.tmpl = function tmpl(str, data) { 9 | try { 10 | // Figure out if we're getting a template, or if we need to 11 | // load the template - and be sure to cache the result. 12 | var fn = !/\W/.test(str) ? 13 | cache[str] = cache[str] || 14 | tmpl(document.getElementById(str).innerHTML) : 15 | 16 | // Generate a reusable function that will serve as a template 17 | // generator (and which will be cached). 18 | new Function("obj", 19 | "var p=[],print=function(){p.push.apply(p,arguments);};" + 20 | 21 | // Introduce the data as local variables using with(){} 22 | "with(obj){p.push('" + 23 | 24 | // Convert the template into pure JavaScript 25 | str 26 | .replace(/[\r\t\n]/g, " ") 27 | .split("<%").join("\t") 28 | .replace(/((^|%>)[^\t]*)'/g, "$1\r") 29 | .replace(/\t=(.*?)%>/g, "',$1,'") 30 | .split("\t").join("');") 31 | .split("%>").join("p.push('") 32 | .split("\r").join("\\'") 33 | + "');}return p.join('');"); 34 | 35 | //console.log(fn); 36 | 37 | // Provide some basic currying to the user 38 | return data ? fn(data) : fn; 39 | }catch(e) { 40 | console.log(e); 41 | } 42 | }; 43 | })(window); 44 | -------------------------------------------------------------------------------- /src/main/webapp/components/hystrixThreadPool/templates/hystrixThreadPoolContainer.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | <% 4 | var displayName = name; 5 | var toolTip = ""; 6 | if(displayName.length > 32) { 7 | displayName = displayName.substring(0,4) + "..." + displayName.substring(displayName.length-20, displayName.length); 8 | toolTip = "title=\"" + name + "\""; 9 | } 10 | %> 11 | 12 |
13 |

><%= displayName %>

14 |
15 |
16 |
17 | 18 | 19 | 33 | 34 |
35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Hystrix Dashboard 2 | 3 | This is a dashboard for monitoring applications using Hystrix (https://github.com/Netflix/Hystrix). 4 | 5 | This project previously was a part of the [Netflix/Hystrix](https://github.com/Netflix/Hystrix) project. It is now deprecated and no longer supported. See the below security section for necessary security considerations. 6 | 7 | View the [Dashboard Wiki](https://github.com/Netflix-Skunkworks/hystrix-dashboard/wiki) for more information including installation instructions. 8 | 9 | 10 | 11 | 12 | # Security 13 | 14 | Hystrix dashboard is not intended to be deployed on untrusted networks, or without external authentication and authorization. Specifically, hystrix-dashboard does not offer any default security protection and can perform server side requests based on user provided urls. 15 | 16 | A security advisory exist for hystrix-dashboard at [nflx-2018-001](https://github.com/Netflix/security-bulletins/blob/master/advisories/nflx-2018-001.md) 17 | 18 | 19 | # Run via Gradle 20 | 21 | ``` 22 | $ git clone https://github.com/Netflix/Hystrix.git 23 | $ cd Hystrix/hystrix-dashboard 24 | $ ./gradlew appRun 25 | > Building > :appRun > Running at http://localhost:7979/hystrix-dashboard 26 | ``` 27 | 28 | Once running, open http://localhost:7979/hystrix-dashboard. 29 | 30 | # Run as standalone Java application 31 | 32 | @kennedyoliveira has written a standalone app, documented at : https://github.com/kennedyoliveira/standalone-hystrix-dashboard 33 | 34 | # Example 35 | 36 | Example screenshot from iPad while monitoring Netflix API: 37 | 38 |
39 | -------------------------------------------------------------------------------- /src/main/webapp/css/global.css: -------------------------------------------------------------------------------- 1 | @IMPORT url("resets.css"); 2 | 3 | body { 4 | font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; 5 | } 6 | 7 | img, object, embed { 8 | max-width: 100%; 9 | } 10 | 11 | img { 12 | height: auto; 13 | } 14 | 15 | #header { 16 | background: #FFFFFF url(../images/hystrix-logo-tagline-tiny.png) no-repeat scroll 99% 0%; 17 | height: 65px; 18 | margin-bottom: 5px; 19 | } 20 | 21 | #streamHeader { 22 | height: 65px; 23 | margin-bottom: 5px; 24 | } 25 | 26 | #streamHeader h2 { 27 | float:left; 28 | color: black; 29 | position:relative; 30 | padding-left: 20px; 31 | top: 26px; 32 | font-size: 20px; 33 | font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; 34 | } 35 | 36 | #header .header_nav { 37 | position:absolute; 38 | top:48px; 39 | right:15px; 40 | } 41 | 42 | #header .header_links { 43 | float:left; 44 | color: lightgray; 45 | font-size: 18px; 46 | top: 3px; 47 | padding-left: 10px; 48 | font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; 49 | } 50 | 51 | #header .header_links a { 52 | color: white; 53 | } 54 | 55 | #header .header_clusters { 56 | float:left; 57 | position:relative; 58 | padding-left: 10px; 59 | top: -1px; 60 | font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; 61 | } 62 | 63 | @media screen and (min-width: 1500px) { 64 | 65 | #header .header_nav { 66 | top:13px; 67 | right:130px; 68 | } 69 | 70 | #header { 71 | background: #FFFFFF url(../images/hystrix-logo-tagline-tiny.png) no-repeat scroll 99% 50%; 72 | height: 65px; 73 | } 74 | 75 | #streamHeader { 76 | height: 65px; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/main/webapp/js/jquery.tinysort.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery TinySort - A plugin to sort child nodes by (sub) contents or attributes. 3 | * 4 | * Version: 1.0.5 5 | * 6 | * Copyright (c) 2008-2011 Ron Valstar http://www.sjeiti.com/ 7 | * 8 | * Dual licensed under the MIT and GPL licenses: 9 | * http://www.opensource.org/licenses/mit-license.php 10 | * http://www.gnu.org/licenses/gpl.html 11 | */ 12 | (function(b){b.tinysort={id:"TinySort",version:"1.0.5",copyright:"Copyright (c) 2008-2011 Ron Valstar",uri:"http://tinysort.sjeiti.com/",defaults:{order:"asc",attr:"",place:"start",returns:false,useVal:false}};b.fn.extend({tinysort:function(h,j){if(h&&typeof(h)!="string"){j=h;h=null}var e=b.extend({},b.tinysort.defaults,j);var p={};this.each(function(t){var v=(!h||h=="")?b(this):b(this).find(h);var u=e.order=="rand"?""+Math.random():(e.attr==""?(e.useVal?v.val():v.text()):v.attr(e.attr));var s=b(this).parent();if(!p[s]){p[s]={s:[],n:[]}}if(v.length>0){p[s].s.push({s:u,e:b(this),n:t})}else{p[s].n.push({e:b(this),n:t})}});for(var g in p){var d=p[g];d.s.sort(function k(t,s){var i=t.s.toLowerCase?t.s.toLowerCase():t.s;var u=s.s.toLowerCase?s.s.toLowerCase():s.s;if(c(t.s)&&c(s.s)){i=parseFloat(t.s);u=parseFloat(s.s)}return(e.order=="asc"?1:-1)*(iu?1:0))})}var m=[];for(var g in p){var d=p[g];var n=[];var f=b(this).length;switch(e.place){case"first":b.each(d.s,function(s,t){f=Math.min(f,t.n)});break;case"org":b.each(d.s,function(s,t){n.push(t.n)});break;case"end":f=d.n.length;break;default:f=0}var q=[0,0];for(var l=0;l=f&&l0?d[1]:false}function a(e,f){var d=false;b.each(e,function(h,g){if(!d){d=g==f}});return d}b.fn.TinySort=b.fn.Tinysort=b.fn.tsort=b.fn.tinysort})(jQuery); -------------------------------------------------------------------------------- /src/main/java/com/netflix/hystrix/dashboard/stream/EurekaInfoServlet.java: -------------------------------------------------------------------------------- 1 | package com.netflix.hystrix.dashboard.stream; 2 | 3 | import java.io.IOException; 4 | 5 | import javax.servlet.ServletException; 6 | import javax.servlet.http.HttpServlet; 7 | import javax.servlet.http.HttpServletRequest; 8 | import javax.servlet.http.HttpServletResponse; 9 | 10 | import org.apache.commons.io.IOUtils; 11 | 12 | /** 13 | * Copyright 2013 Netflix, Inc. 14 | * 15 | * Licensed under the Apache License, Version 2.0 (the "License"); 16 | * you may not use this file except in compliance with the License. 17 | * You may obtain a copy of the License at 18 | * 19 | * http://www.apache.org/licenses/LICENSE-2.0 20 | * 21 | * Unless required by applicable law or agreed to in writing, software 22 | * distributed under the License is distributed on an "AS IS" BASIS, 23 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 24 | * See the License for the specific language governing permissions and 25 | * limitations under the License. 26 | */ 27 | 28 | /** 29 | * Servlet that calls eureka REST api in order to get instances information.
30 | * You need provide a url parameter. i.e: eureka?url=http://127.0.0.1:8080/eureka/v2/apps 31 | * 32 | * @author diegopacheco 33 | * 34 | */ 35 | public class EurekaInfoServlet extends HttpServlet { 36 | 37 | private static final long serialVersionUID = 1L; 38 | 39 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 40 | 41 | String uri = request.getParameter("url"); 42 | if (uri==null || "".equals(uri)) response.getOutputStream().write("Error. You need supply a valid eureka URL ".getBytes()); 43 | 44 | try{ 45 | response.setContentType("application/xml"); 46 | response.setHeader("Content-Encoding", "gzip"); 47 | IOUtils.copy( UrlUtils.readXmlInputStream(uri) ,response.getOutputStream()); 48 | }catch(Exception e){ 49 | response.getOutputStream().write(("Error. You need supply a valid eureka URL. Ex: " + e + "").getBytes()); 50 | } 51 | 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/webapp/monitor/monitor.css: -------------------------------------------------------------------------------- 1 | .container { 2 | padding-left: 20px; 3 | padding-right: 20px; 4 | } 5 | 6 | .row { 7 | width: 100%; 8 | margin: 0 auto; 9 | overflow: hidden; 10 | } 11 | 12 | .spacer { 13 | width: 100%; 14 | margin: 0 auto; 15 | padding-top:4px; 16 | clear:both; 17 | } 18 | 19 | 20 | .last { 21 | margin-right: 0px; 22 | } 23 | 24 | .menubar { 25 | overflow: hidden; 26 | border-bottom: 1px solid black; 27 | } 28 | 29 | .menubar div { 30 | padding-bottom:5px; 31 | 32 | margin: 0 auto; 33 | overflow: hidden; 34 | 35 | font-size: 80%; 36 | font-family:'Bookman Old Style',Bookman,'URW Bookman L','Palatino Linotype',serif; 37 | 38 | float:left; 39 | } 40 | 41 | .menubar .title { 42 | float: left; 43 | padding-right: 20px; 44 | 45 | font-size: 110%; 46 | font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; 47 | font-weight: bold; 48 | 49 | vertical-align: bottom; 50 | } 51 | 52 | .menubar .menu_actions { 53 | float: left; 54 | position:relative; 55 | top: 4px; 56 | } 57 | 58 | .menubar .menu_legend { 59 | float: right; 60 | position:relative; 61 | top: 4px; 62 | 63 | } 64 | 65 | h3.sectionHeader { 66 | color: black; 67 | font-size: 110%; 68 | padding-top: 4px; 69 | padding-bottom: 4px; 70 | padding-left: 8px; 71 | font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; 72 | background: lightgrey; 73 | } 74 | 75 | .success { 76 | color: green; 77 | } 78 | 79 | .shortCircuited { 80 | color: blue; 81 | } 82 | 83 | .timeout { 84 | color: #FF9900; /* shade of orange */ 85 | } 86 | 87 | .failure { 88 | color: red; 89 | } 90 | 91 | .rejected { 92 | color: purple; 93 | } 94 | 95 | .exceptionsThrown { 96 | color: brown; 97 | } 98 | 99 | .badRequest { 100 | color: lightSeaGreen; 101 | } 102 | 103 | @media screen and (max-width: 1100px) { 104 | .container { 105 | padding-left: 5px; 106 | padding-right: 5px; 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /src/main/webapp/css/resets.css: -------------------------------------------------------------------------------- 1 | /* 2 | html5doctor.com Reset Stylesheet 3 | v1.6.1 4 | Last Updated: 2010-09-17 5 | Author: Richard Clark - http://richclarkdesign.com 6 | Twitter: @rich_clark 7 | */ 8 | 9 | html, body, div, span, object, iframe, 10 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 11 | abbr, address, cite, code, 12 | del, dfn, em, img, ins, kbd, q, samp, 13 | small, strong, sub, sup, var, 14 | b, i, 15 | dl, dt, dd, ol, ul, li, 16 | fieldset, form, label, legend, 17 | table, caption, tbody, tfoot, thead, tr, th, td, 18 | article, aside, canvas, details, figcaption, figure, 19 | footer, header, hgroup, menu, nav, section, summary, 20 | time, mark, audio, video { 21 | margin:0; 22 | padding:0; 23 | border:0; 24 | outline:0; 25 | font-size:100%; 26 | vertical-align:baseline; 27 | background:transparent; 28 | } 29 | 30 | body { 31 | line-height:1; 32 | } 33 | 34 | article,aside,details,figcaption,figure, 35 | footer,header,hgroup,menu,nav,section { 36 | display:block; 37 | } 38 | 39 | nav ul { 40 | list-style:none; 41 | } 42 | 43 | blockquote, q { 44 | quotes:none; 45 | } 46 | 47 | blockquote:before, blockquote:after, 48 | q:before, q:after { 49 | content:''; 50 | content:none; 51 | } 52 | 53 | a { 54 | margin:0; 55 | padding:0; 56 | font-size:100%; 57 | vertical-align:baseline; 58 | background:transparent; 59 | } 60 | 61 | /* change colours to suit your needs */ 62 | ins { 63 | background-color:#ff9; 64 | color:#000; 65 | text-decoration:none; 66 | } 67 | 68 | /* change colours to suit your needs */ 69 | mark { 70 | background-color:#ff9; 71 | color:#000; 72 | font-style:italic; 73 | font-weight:bold; 74 | } 75 | 76 | del { 77 | text-decoration: line-through; 78 | } 79 | 80 | abbr[title], dfn[title] { 81 | border-bottom:1px dotted; 82 | cursor:help; 83 | } 84 | 85 | table { 86 | border-collapse:collapse; 87 | border-spacing:0; 88 | } 89 | 90 | /* change border colour to suit your needs */ 91 | hr { 92 | display:block; 93 | height:1px; 94 | border:0; 95 | border-top:1px solid #cccccc; 96 | margin:1em 0; 97 | padding:0; 98 | } 99 | 100 | input, select { 101 | vertical-align:middle; 102 | } -------------------------------------------------------------------------------- /gradle/javadocStyleSheet.css: -------------------------------------------------------------------------------- 1 | # originally from http://sensemaya.org/files/stylesheet.css and then modified 2 | # http://sensemaya.org/maya/2009/07/10/making-javadoc-more-legible 3 | 4 | /* Javadoc style sheet */ 5 | 6 | /* Define colors, fonts and other style attributes here to override the defaults */ 7 | 8 | /* Page background color */ 9 | body { background-color: #FFFFFF; color:#333; font-size: 100%; } 10 | 11 | body { font-size: 0.875em; line-height: 1.286em; font-family: "Helvetica", "Arial", sans-serif; } 12 | 13 | code { color: #777; line-height: 1.286em; font-family: "Consolas", "Lucida Console", "Droid Sans Mono", "Andale Mono", "Monaco", "Lucida Sans Typewriter"; } 14 | 15 | a { text-decoration: none; color: #16569A; /* also try #2E85ED, #0033FF, #6C93C6, #1D7BBE, #1D8DD2 */ } 16 | a:hover { text-decoration: underline; } 17 | 18 | 19 | table[border="1"] { border: 1px solid #ddd; } 20 | table[border="1"] td, table[border="1"] th { border: 1px solid #ddd; } 21 | table[cellpadding="3"] td { padding: 0.5em; } 22 | 23 | font[size="-1"] { font-size: 0.85em; line-height: 1.5em; } 24 | font[size="-2"] { font-size: 0.8em; } 25 | font[size="+2"] { font-size: 1.4em; line-height: 1.3em; padding: 0.4em 0; } 26 | 27 | /* Headings */ 28 | h1 { font-size: 1.5em; line-height: 1.286em;} 29 | h2.title { color: #c81f08; } 30 | 31 | /* Table colors */ 32 | .TableHeadingColor { background: #ccc; color:#444; } /* Dark mauve */ 33 | .TableSubHeadingColor { background: #ddd; color:#444; } /* Light mauve */ 34 | .TableRowColor { background: #FFFFFF; color:#666; font-size: 0.95em; } /* White */ 35 | .TableRowColor code { color:#000; } /* White */ 36 | 37 | /* Font used in left-hand frame lists */ 38 | .FrameTitleFont { font-size: 100%; } 39 | .FrameHeadingFont { font-size: 90%; } 40 | .FrameItemFont { font-size: 0.9em; line-height: 1.3em; 41 | } 42 | /* Java Interfaces */ 43 | .FrameItemFont a i { 44 | font-style: normal; color: #16569A; 45 | } 46 | .FrameItemFont a:hover i { 47 | text-decoration: underline; 48 | } 49 | 50 | 51 | /* Navigation bar fonts and colors */ 52 | .NavBarCell1 { background-color:#E0E6DF; } /* Light mauve */ 53 | .NavBarCell1Rev { background-color:#16569A; color:#FFFFFF} /* Dark Blue */ 54 | .NavBarFont1 { } 55 | .NavBarFont1Rev { color:#FFFFFF; } 56 | 57 | .NavBarCell2 { background-color:#FFFFFF; color:#000000} 58 | .NavBarCell3 { background-color:#FFFFFF; color:#000000} 59 | 60 | -------------------------------------------------------------------------------- /src/main/webapp/components/hystrixCommand/templates/hystrixCircuitContainer.html: -------------------------------------------------------------------------------- 1 |
2 | <% 3 | var displayName = name; 4 | var toolTip = ""; 5 | if(displayName.length > 32) { 6 | displayName = displayName.substring(0,4) + "..." + displayName.substring(displayName.length-20, displayName.length); 7 | toolTip = "title=\"" + name + "\""; 8 | } 9 | %> 10 | 11 |
12 |
13 | <% if(includeDetailIcon) { %> 14 |

style="padding-right:16px"> 15 | <%= displayName %> 16 | 17 |

18 | <% } else { %> 19 |

><%= displayName %>

20 | <% } %> 21 |
22 |
23 |
24 |
25 |
26 | 27 | 40 |
41 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /src/main/webapp/css/simplegrid/720_grid.css: -------------------------------------------------------------------------------- 1 | /* SimpleGrid - a fork of CSSGrid by Crowd Favorite (https://github.com/crowdfavorite/css-grid) 2 | * http://simplegrid.info 3 | * by Conor Muirhead (http://conor.cc) of Early LLC (http://earlymade.com) 4 | * License: http://creativecommons.org/licenses/MIT/ */ 5 | 6 | /* Containers */ 7 | body { font-size: 0.875em; padding: 0; } 8 | .grid{ margin:0 auto; padding: 0 10px; width:700px; } 9 | .row{ clear:left; } 10 | 11 | /* Slots Setup */ 12 | .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5,.slot-0-1,.slot-0-1-2,.slot-0-1-2-3,.slot-0-1-2-3-4,.slot-0-1-2-3-4-5,.slot-1-2,.slot-1-2-3,.slot-1-2-3-4,.slot-1-2-3-4-5,.slot-2-3,.slot-2-3-4,.slot-2-3-4-5,.slot-3-4,.slot-3-4-5,.slot-4-5,.slot-6,.slot-7,.slot-8,.slot-9,.slot-6-7,.slot-6-7-8,.slot-6-7-8-9,.slot-7-8,.slot-7-8-9,.slot-8-9{ display:inline; float:left; margin-left:20px; } 13 | 14 | /* 6-Col Grid Sizes */ 15 | .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5{ width:100px; } /* Sixths */ 16 | .slot-0-1,.slot-1-2,.slot-2-3,.slot-3-4,.slot-4-5{ width:220px; } /* Thirds */ 17 | .slot-0-1-2-3,.slot-1-2-3-4,.slot-2-3-4-5{ width:460px; } /* Two-Thirds */ 18 | .slot-0-1-2-3-4,.slot-1-2-3-4-5{ width:580px; } /* Five-Sixths */ 19 | 20 | /* 4-Col Grid Sizes */ 21 | .slot-6,.slot-7,.slot-8,.slot-9{ width:160px; } /* Quarters */ 22 | .slot-6-7-8,.slot-7-8-9{ width:520px; } /* Three-Quarters */ 23 | 24 | /* 6-Col/4-Col Shared Grid Sizes */ 25 | .slot-0-1-2,.slot-1-2-3,.slot-2-3-4,.slot-3-4-5, .slot-6-7,.slot-7-8,.slot-8-9{ width:340px; } /* Halves */ 26 | .slot-0-1-2-3-4-5, .slot-6-7-8-9{ width: 100%; } /* Full-Width */ 27 | 28 | /* Zeroing Out Leftmost Slot Margins */ 29 | .slot-0,.slot-0-1,.slot-0-1-2,.slot-0-1-2-3,.slot-0-1-2-3-4,.slot-0-1-2-3-4-5,.slot-6,.slot-6-7,.slot-6-7-8,.slot-6-7-8-9,.slot-1 .slot-1,.slot-1-2 .slot-1,.slot-1-2 .slot-1-2,.slot-1-2-3 .slot-1,.slot-1-2-3 .slot-1-2,.slot-1-2-3 .slot-1-2-3,.slot-1-2-3-4 .slot-1,.slot-1-2-3-4 .slot-1-2,.slot-1-2-3-4 .slot-1-2-3,.slot-1-2-3-4 .slot-1-2-3-4,.slot-1-2-3-4-5 .slot-1,.slot-1-2-3-4-5 .slot-1-2,.slot-1-2-3-4-5 .slot-1-2-3,.slot-1-2-3-4-5 .slot-1-2-3-4,.slot-1-2-3-4-5 .slot-1-2-3-4-5,.slot-2 .slot-2,.slot-2-3 .slot-2,.slot-2-3 .slot-2-3,.slot-2-3-4 .slot-2,.slot-2-3-4 .slot-2-3,.slot-2-3-4 .slot-2-3-4,.slot-2-3-4-5 .slot-2,.slot-2-3-4-5 .slot-2-3,.slot-2-3-4-5 .slot-2-3-4,.slot-2-3-4-5 .slot-2-3-4-5,.slot-3 .slot-3,.slot-3-4 .slot-3,.slot-3-4 .slot-3-4,.slot-3-4-5 .slot-3,.slot-3-4-5 .slot-3-4,.slot-3-4-5 .slot-3-4-5,.slot-4 .slot-4,.slot-4-5 .slot-4,.slot-4-5 .slot-4-5,.slot-5 .slot-5,.slot-7 .slot-7,.slot-7-8 .slot-7,.slot-7-8 .slot-7-8,.slot-7-8-9 .slot-7,.slot-7-8-9 .slot-7-8,.slot-7-8-9 .slot-7-8-9,.slot-8 .slot-8,.slot-8-9 .slot-8,.slot-8-9 .slot-8-9{ margin-left:0 !important; } /* Important is to avoid repeating this in larger screen css files */ 30 | 31 | /* Row Clearfix */ 32 | .row:after{ visibility:hidden; display:block; font-size:0; content:" "; clear:both; height:0; } 33 | .row{ zoom:1; } -------------------------------------------------------------------------------- /src/main/webapp/components/hystrixThreadPool/hystrixThreadPool.css: -------------------------------------------------------------------------------- 1 | .dependencyThreadPools .spacer { 2 | width: 100%; 3 | margin: 0 auto; 4 | padding-top:4px; 5 | clear:both; 6 | } 7 | 8 | 9 | .dependencyThreadPools .last { 10 | margin-right: 0px; 11 | } 12 | 13 | .dependencyThreadPools span.loading { 14 | display: block; 15 | padding-top: 6%; 16 | padding-bottom: 6%; 17 | color: gray; 18 | text-align: center; 19 | } 20 | 21 | .dependencyThreadPools span.loading.failed { 22 | color: red; 23 | } 24 | 25 | 26 | .dependencyThreadPools div.monitor { 27 | float: left; 28 | margin-right:5px; /* these are tweaked to look good on desktop and iPad portrait, and fit things densely */ 29 | margin-top:5px; 30 | } 31 | 32 | .dependencyThreadPools div.monitor p.name { 33 | font-weight:bold; 34 | font-size: 10pt; 35 | text-align: right; 36 | padding-bottom: 5px; 37 | } 38 | 39 | .dependencyThreadPools div.monitor_data { 40 | margin: 0 auto; 41 | } 42 | 43 | .dependencyThreadPools span.smaller { 44 | font-size: 8pt; 45 | color: grey; 46 | } 47 | 48 | 49 | .dependencyThreadPools div.tableRow { 50 | width:100%; 51 | white-space: nowrap; 52 | font-size: 8pt; 53 | margin: 0 auto; 54 | clear:both; 55 | } 56 | 57 | .dependencyThreadPools div.tableRow .cell { 58 | float:left; 59 | } 60 | 61 | .dependencyThreadPools div.tableRow .header { 62 | text-align:right; 63 | padding-right:5px; 64 | } 65 | 66 | .dependencyThreadPools div.tableRow .header.left { 67 | width:85px; 68 | } 69 | 70 | .dependencyThreadPools div.tableRow .header.right { 71 | width:75px; 72 | } 73 | 74 | .dependencyThreadPools div.tableRow .data { 75 | font-weight: bold; 76 | text-align:right; 77 | } 78 | 79 | .dependencyThreadPools div.tableRow .data.left { 80 | width:30px; 81 | } 82 | 83 | .dependencyThreadPools div.tableRow .data.right { 84 | width:45px; 85 | } 86 | 87 | .dependencyThreadPools div.monitor { 88 | width: 245px; /* we want a fixed width instead of percentage as I want the boxes to be a set size and then fill in as many as can fit in each row ... this allows 3 columns on an iPad */ 89 | height: 110px; 90 | } 91 | 92 | 93 | 94 | 95 | 96 | /* override the HREF when we have specified it as a tooltip to not act like a link */ 97 | .dependencyThreadPools div.monitor_data a.tooltip { 98 | text-decoration: none; 99 | cursor: default; 100 | } 101 | 102 | .dependencyThreadPools div.monitor_data a.rate { 103 | font-weight:bold; 104 | color: black; 105 | font-size: 11pt; 106 | } 107 | 108 | .dependencyThreadPools div.rate { 109 | padding-top: 1px; 110 | clear:both; 111 | text-align:right; 112 | } 113 | 114 | .dependencyThreadPools span.rate_value { 115 | font-weight:bold; 116 | } 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | .dependencyThreadPools div.monitor div.chart { 125 | } 126 | 127 | .dependencyThreadPools div.monitor div.chart svg { 128 | } 129 | 130 | .dependencyThreadPools div.monitor div.chart svg text { 131 | fill: white; 132 | } 133 | 134 | .dependencyThreadPools #hidden { 135 | width:1px; 136 | height:1px; 137 | background: lightgrey; 138 | display: none; 139 | } 140 | 141 | 142 | -------------------------------------------------------------------------------- /src/main/webapp/components/hystrixCommand/hystrixCommand.css: -------------------------------------------------------------------------------- 1 | .dependencies .spacer { 2 | width: 100%; 3 | margin: 0 auto; 4 | padding-top:4px; 5 | clear:both; 6 | } 7 | 8 | 9 | .dependencies .last { 10 | margin-right: 0px; 11 | } 12 | 13 | .dependencies span.loading { 14 | display: block; 15 | padding-top: 6%; 16 | padding-bottom: 6%; 17 | color: gray; 18 | text-align: center; 19 | } 20 | 21 | .dependencies span.loading.failed { 22 | color: red; 23 | } 24 | 25 | 26 | .dependencies div.monitor { 27 | float: left; 28 | margin-right:5px; 29 | margin-top:5px; 30 | } 31 | 32 | .dependencies div.monitor p.name { 33 | font-weight:bold; 34 | font-size: 10pt; 35 | text-align: right; 36 | padding-bottom: 5px; 37 | } 38 | 39 | .dependencies div.monitor_data { 40 | margin: 0 auto; 41 | } 42 | 43 | /* override the HREF when we have specified it as a tooltip to not act like a link */ 44 | .dependencies div.monitor_data a.tooltip { 45 | text-decoration: none; 46 | cursor: default; 47 | } 48 | 49 | .dependencies div.monitor_data div.counters { 50 | text-align: right; 51 | padding-bottom: 10px; 52 | font-size: 10pt; 53 | clear: both; 54 | 55 | } 56 | 57 | .dependencies div.monitor_data div.counters div.cell { 58 | display: inline; 59 | float: right; 60 | } 61 | 62 | .dependencies .borderRight { 63 | border-right: 1px solid grey; 64 | padding-right: 6px; 65 | padding-left: 8px; 66 | } 67 | 68 | .dependencies div.cell .line { 69 | display: block; 70 | } 71 | 72 | .dependencies div.monitor_data a, 73 | .dependencies span.rate_value { 74 | font-weight:bold; 75 | } 76 | 77 | 78 | .dependencies span.smaller { 79 | font-size: 8pt; 80 | color: grey; 81 | } 82 | 83 | 84 | 85 | .dependencies div.tableRow { 86 | width:100%; 87 | white-space: nowrap; 88 | font-size: 8pt; 89 | margin: 0 auto; 90 | clear:both; 91 | padding-left:26%; 92 | } 93 | 94 | .dependencies div.tableRow .cell { 95 | float:left; 96 | } 97 | 98 | .dependencies div.tableRow .header { 99 | width:18%; 100 | text-align:right; 101 | padding-right:2%; 102 | } 103 | 104 | .dependencies div.tableRow .data { 105 | width:17%; 106 | font-weight: bold; 107 | text-align:right; 108 | } 109 | 110 | 111 | .dependencies div.monitor { 112 | width: 245px; /* we want a fixed width instead of percentage as I want the boxes to be a set size and then fill in as many as can fit in each row ... this allows 3 columns on an iPad */ 113 | height: 160px; 114 | } 115 | 116 | .dependencies .success { 117 | color: green; 118 | } 119 | 120 | .dependencies .shortCircuited { 121 | color: blue; 122 | } 123 | 124 | .dependencies .timeout { 125 | color: #FF9900; /* shade of orange */ 126 | } 127 | 128 | .dependencies .failure { 129 | color: red; 130 | } 131 | 132 | .dependencies .rejected { 133 | color: purple; 134 | } 135 | 136 | .dependencies .exceptionsThrown { 137 | color: brown; 138 | } 139 | 140 | .dependencies .badRequest { 141 | color: lightSeaGreen; 142 | } 143 | 144 | .dependencies div.monitor_data a.rate { 145 | color: black; 146 | font-size: 11pt; 147 | } 148 | 149 | .dependencies div.rate { 150 | padding-top: 1px; 151 | clear:both; 152 | text-align:right; 153 | } 154 | 155 | .dependencies .errorPercentage { 156 | color: grey; 157 | } 158 | 159 | .dependencies div.cell .errorPercentage { 160 | padding-left:5px; 161 | font-size: 12pt !important; 162 | } 163 | 164 | 165 | .dependencies div.monitor div.chart { 166 | } 167 | 168 | .dependencies div.monitor div.chart svg { 169 | } 170 | 171 | .dependencies div.monitor div.chart svg text { 172 | fill: white; 173 | } 174 | 175 | 176 | .dependencies div.circuitStatus { 177 | width:100%; 178 | white-space: nowrap; 179 | font-size: 9pt; 180 | margin: 0 auto; 181 | clear:both; 182 | text-align:right; 183 | padding-top: 4px; 184 | } 185 | 186 | .dependencies #hidden { 187 | width:1px; 188 | height:1px; 189 | background: lightgrey; 190 | display: none; 191 | } 192 | 193 | 194 | 195 | /* sparkline */ 196 | .dependencies path { 197 | stroke: steelblue; 198 | stroke-width: 1; 199 | fill: none; 200 | } 201 | -------------------------------------------------------------------------------- /src/main/webapp/components/hystrixCommand/templates/hystrixCircuit.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 6 | 7 |
8 | <%= addCommas(rollingCountTimeout) %> 9 | <% if(propertyValue_executionIsolationStrategy == 'THREAD') { %> 10 | <%= addCommas(rollingCountThreadPoolRejected) %> 11 | <% } %> 12 | <% if(propertyValue_executionIsolationStrategy == 'SEMAPHORE') { %> 13 | <%= addCommas(rollingCountSemaphoreRejected) %> 14 | <% } %> 15 | <%= addCommas(rollingCountFailure) %> 16 |
17 | 23 |
24 | 25 | 28 | 31 | 32 |
33 | <% if(propertyValue_circuitBreakerForceClosed) { %> 34 | [ Forced Closed ] 35 | <% } %> 36 | <% if(propertyValue_circuitBreakerForceOpen) { %> 37 | Circuit Forced Open 38 | <% } else { %> 39 | <% if(isCircuitBreakerOpen == reportingHosts) { %> 40 | Circuit Open 41 | <% } else if(isCircuitBreakerOpen == 0) { %> 42 | Circuit Closed 43 | <% } else { 44 | /* We have some circuits that are open */ 45 | %> 46 | <% if(typeof isCircuitBreakerOpen === 'object' ) { %> 47 | Circuit Open <%= isCircuitBreakerOpen.true %> Closed <%= isCircuitBreakerOpen.false %> 48 | <% } else { %> 49 | Circuit <%= isCircuitBreakerOpen.toString().replace("true", "Open").replace("false", "Closed") %> 50 | <% } %> 51 | <% } %> 52 | <% } %> 53 |
54 | 55 |
56 | 57 |
58 | <% if(typeof reportingHosts != 'undefined') { %> 59 |
Hosts
60 |
<%= reportingHosts %>
61 | <% } else { %> 62 |
Host
63 |
Single
64 | <% } %> 65 |
90th
66 |
<%= getInstanceAverage(latencyExecute['90'], reportingHosts, false) %>ms
67 |
68 |
69 |
Median
70 |
<%= getInstanceAverage(latencyExecute['50'], reportingHosts, false) %>ms
71 |
99th
72 |
<%= getInstanceAverage(latencyExecute['99'], reportingHosts, false) %>ms
73 |
74 |
75 |
Mean
76 |
<%= latencyExecute_mean %>ms
77 |
99.5th
78 |
<%= getInstanceAverage(latencyExecute['99.5'], reportingHosts, false) %>ms
79 |
80 | 81 | 82 | -------------------------------------------------------------------------------- /src/main/java/com/netflix/hystrix/dashboard/stream/MockStreamServlet.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.hystrix.dashboard.stream; 17 | 18 | import java.io.BufferedReader; 19 | import java.io.IOException; 20 | import java.io.InputStream; 21 | import java.io.InputStreamReader; 22 | import java.io.StringWriter; 23 | import java.nio.charset.Charset; 24 | 25 | import javax.servlet.ServletException; 26 | import javax.servlet.http.HttpServlet; 27 | import javax.servlet.http.HttpServletRequest; 28 | import javax.servlet.http.HttpServletResponse; 29 | 30 | import org.slf4j.Logger; 31 | import org.slf4j.LoggerFactory; 32 | 33 | /** 34 | * Simulate an event stream URL by retrieving pre-canned data instead of going to live servers. 35 | */ 36 | public class MockStreamServlet extends HttpServlet { 37 | private static final long serialVersionUID = 1L; 38 | private static final Logger logger = LoggerFactory.getLogger(MockStreamServlet.class); 39 | 40 | public MockStreamServlet() { 41 | super(); 42 | } 43 | 44 | /** 45 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 46 | */ 47 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 48 | String filename = request.getParameter("file"); 49 | if (filename == null) { 50 | // default to using hystrix.stream 51 | filename = "hystrix.stream"; 52 | } else { 53 | // strip any .. / characters to avoid security problems 54 | filename = filename.replaceAll("\\.\\.", ""); 55 | filename = filename.replaceAll("/", ""); 56 | } 57 | int delay = 500; 58 | String delayArg = request.getParameter("delay"); 59 | if (delayArg != null) { 60 | delay = Integer.parseInt(delayArg); 61 | } 62 | 63 | int batch = 1; 64 | String batchArg = request.getParameter("batch"); 65 | if (batchArg != null) { 66 | batch = Integer.parseInt(batchArg); 67 | } 68 | 69 | String data = getFileFromPackage(filename); 70 | String lines[] = data.split("\n"); 71 | 72 | response.setContentType("text/event-stream"); 73 | response.setCharacterEncoding("UTF-8"); 74 | 75 | int batchCount = 0; 76 | // loop forever unless the user closes the connection 77 | for (;;) { 78 | for (String s : lines) { 79 | s = s.trim(); 80 | if (s.length() > 0) { 81 | try { 82 | response.getWriter().println(s); 83 | response.getWriter().println(""); // a newline is needed after each line for the events to trigger 84 | response.getWriter().flush(); 85 | batchCount++; 86 | } catch (Exception e) { 87 | logger.warn("Exception writing mock data to output.", e); 88 | // most likely the user closed the connection 89 | return; 90 | } 91 | if (batchCount == batch) { 92 | // we insert the delay whenever we finish a batch 93 | try { 94 | // simulate the delays we get from the real feed 95 | Thread.sleep(delay); 96 | } catch (InterruptedException e) { 97 | // ignore 98 | } 99 | // reset 100 | batchCount = 0; 101 | } 102 | } 103 | } 104 | } 105 | } 106 | 107 | private String getFileFromPackage(String filename) { 108 | try { 109 | String file = "/" + this.getClass().getPackage().getName().replace('.', '/') + "/" + filename; 110 | InputStream is = this.getClass().getResourceAsStream(file); 111 | try { 112 | /* this is FAR too much work just to get a string from a file */ 113 | BufferedReader in = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8"))); 114 | StringWriter s = new StringWriter(); 115 | int c = -1; 116 | while ((c = in.read()) > -1) { 117 | s.write(c); 118 | } 119 | return s.toString(); 120 | } finally { 121 | is.close(); 122 | } 123 | } catch (Exception e) { 124 | throw new RuntimeException("Could not find file: " + filename, e); 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hystrix Dashboard 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 133 | 134 | 135 |
136 | 137 |
138 | 139 |
140 |
141 | 142 |

Hystrix Dashboard

143 | 144 | Eureka URL:
145 | 146 | Eureka Application: 147 | 150 | 151 | Stream Type: 152 | Hystrix 153 | Turbine

154 | 155 | 156 |

157 | Cluster via Turbine (default cluster): http://turbine-hostname:port/turbine.stream 158 |
159 | Cluster via Turbine (custom cluster): http://turbine-hostname:port/turbine.stream?cluster=[clusterName] 160 |
161 | Single Hystrix App: http://hystrix-app:port/hystrix.stream 162 |

163 | Delay: ms 164 |      165 | Title:

166 | Authorization:
167 |
168 | 169 |

170 |
    171 |

    172 | 173 |

    174 |
    175 | 176 |
    177 |
    178 | 179 | 180 | -------------------------------------------------------------------------------- /src/main/java/com/netflix/hystrix/dashboard/stream/ProxyStreamServlet.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2015 Netflix, Inc. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.netflix.hystrix.dashboard.stream; 17 | 18 | import java.io.IOException; 19 | import java.io.InputStream; 20 | import java.io.OutputStream; 21 | import java.util.Map; 22 | 23 | import javax.servlet.ServletException; 24 | import javax.servlet.http.HttpServlet; 25 | import javax.servlet.http.HttpServletRequest; 26 | import javax.servlet.http.HttpServletResponse; 27 | 28 | import org.apache.http.Header; 29 | import org.apache.http.HttpHeaders; 30 | import org.apache.http.HttpResponse; 31 | import org.apache.http.HttpStatus; 32 | import org.apache.http.client.HttpClient; 33 | import org.apache.http.client.methods.HttpGet; 34 | import org.apache.http.impl.client.DefaultHttpClient; 35 | import org.apache.http.impl.conn.PoolingClientConnectionManager; 36 | import org.apache.http.params.HttpConnectionParams; 37 | import org.apache.http.params.HttpParams; 38 | import org.slf4j.Logger; 39 | import org.slf4j.LoggerFactory; 40 | 41 | /** 42 | * Proxy an EventStream request (data.stream via proxy.stream) since EventStream does not yet support CORS (https://bugs.webkit.org/show_bug.cgi?id=61862) 43 | * so that a UI can request a stream from a different server. 44 | */ 45 | public class ProxyStreamServlet extends HttpServlet { 46 | private static final long serialVersionUID = 1L; 47 | private static final Logger logger = LoggerFactory.getLogger(ProxyStreamServlet.class); 48 | 49 | public ProxyStreamServlet() { 50 | super(); 51 | } 52 | 53 | /** 54 | * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) 55 | */ 56 | protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 57 | String origin = request.getParameter("origin"); 58 | String authorization = request.getParameter("authorization"); 59 | if (origin == null) { 60 | response.setStatus(500); 61 | response.getWriter().println("Required parameter 'origin' missing. Example: 107.20.175.135:7001"); 62 | return; 63 | } 64 | origin = origin.trim(); 65 | 66 | HttpGet httpget = null; 67 | InputStream is = null; 68 | boolean hasFirstParameter = false; 69 | StringBuilder url = new StringBuilder(); 70 | if (!origin.startsWith("http")) { 71 | url.append("http://"); 72 | } 73 | url.append(origin); 74 | if (origin.contains("?")) { 75 | hasFirstParameter = true; 76 | } 77 | @SuppressWarnings("unchecked") 78 | Map params = request.getParameterMap(); 79 | for (String key : params.keySet()) { 80 | if (!key.equals("origin") && !key.equals("authorization")) { 81 | String[] values = params.get(key); 82 | String value = values[0].trim(); 83 | if (hasFirstParameter) { 84 | url.append("&"); 85 | } else { 86 | url.append("?"); 87 | hasFirstParameter = true; 88 | } 89 | url.append(key).append("=").append(value); 90 | } 91 | } 92 | String proxyUrl = url.toString(); 93 | logger.info("\n\nProxy opening connection to: {}\n\n", proxyUrl); 94 | try { 95 | httpget = new HttpGet(proxyUrl); 96 | if (authorization != null) { 97 | httpget.addHeader("Authorization", authorization); 98 | } 99 | HttpClient client = ProxyConnectionManager.httpClient; 100 | HttpResponse httpResponse = client.execute(httpget); 101 | int statusCode = httpResponse.getStatusLine().getStatusCode(); 102 | if (statusCode == HttpStatus.SC_OK) { 103 | // writeTo swallows exceptions and never quits even if outputstream is throwing IOExceptions (such as broken pipe) ... since the inputstream is infinite 104 | // httpResponse.getEntity().writeTo(new OutputStreamWrapper(response.getOutputStream())); 105 | // so I copy it manually ... 106 | is = httpResponse.getEntity().getContent(); 107 | 108 | // set headers 109 | for (Header header : httpResponse.getAllHeaders()) { 110 | if (!HttpHeaders.TRANSFER_ENCODING.equals(header.getName())) { 111 | response.addHeader(header.getName(), header.getValue()); 112 | } 113 | } 114 | 115 | // copy data from source to response 116 | OutputStream os = response.getOutputStream(); 117 | int b = -1; 118 | while ((b = is.read()) != -1) { 119 | try { 120 | os.write(b); 121 | if (b == 10 /** flush buffer on line feed */) { 122 | os.flush(); 123 | } 124 | } catch (Exception e) { 125 | if (e.getClass().getSimpleName().equalsIgnoreCase("ClientAbortException")) { 126 | // don't throw an exception as this means the user closed the connection 127 | logger.debug("Connection closed by client. Will stop proxying ..."); 128 | // break out of the while loop 129 | break; 130 | } else { 131 | // received unknown error while writing so throw an exception 132 | throw new RuntimeException(e); 133 | } 134 | } 135 | } 136 | } 137 | } catch (Exception e) { 138 | logger.error("Error proxying request: " + url, e); 139 | } finally { 140 | if (httpget != null) { 141 | try { 142 | httpget.abort(); 143 | } catch (Exception e) { 144 | logger.error("failed aborting proxy connection.", e); 145 | } 146 | } 147 | 148 | // httpget.abort() MUST be called first otherwise is.close() hangs (because data is still streaming?) 149 | if (is != null) { 150 | // this should already be closed by httpget.abort() above 151 | try { 152 | is.close(); 153 | } catch (Exception e) { 154 | // e.printStackTrace(); 155 | } 156 | } 157 | } 158 | } 159 | 160 | private static class ProxyConnectionManager { 161 | private final static PoolingClientConnectionManager threadSafeConnectionManager = new PoolingClientConnectionManager(); 162 | private final static HttpClient httpClient = new DefaultHttpClient(threadSafeConnectionManager); 163 | 164 | static { 165 | logger.debug("Initialize ProxyConnectionManager"); 166 | /* common settings */ 167 | HttpParams httpParams = httpClient.getParams(); 168 | HttpConnectionParams.setConnectionTimeout(httpParams, 5000); 169 | HttpConnectionParams.setSoTimeout(httpParams, 10000); 170 | 171 | /* number of connections to allow */ 172 | threadSafeConnectionManager.setDefaultMaxPerRoute(400); 173 | threadSafeConnectionManager.setMaxTotal(400); 174 | } 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /src/main/webapp/monitor/monitor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hystrix Monitor 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 |
    35 | 36 | 187 | 188 | 189 | -------------------------------------------------------------------------------- /LICENSE-2.0.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2012 Netflix, Inc. 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /src/main/webapp/components/hystrixThreadPool/hystrixThreadPool.js: -------------------------------------------------------------------------------- 1 | 2 | (function(window) { 3 | 4 | // cache the templates we use on this page as global variables (asynchronously) 5 | jQuery.get(getRelativePath("../components/hystrixThreadPool/templates/hystrixThreadPool.html"), function(data) { 6 | htmlTemplate = data; 7 | }); 8 | jQuery.get(getRelativePath("../components/hystrixThreadPool/templates/hystrixThreadPoolContainer.html"), function(data) { 9 | htmlTemplateContainer = data; 10 | }); 11 | 12 | function getRelativePath(path) { 13 | var p = location.pathname.slice(0, location.pathname.lastIndexOf("/")+1); 14 | return p + path; 15 | } 16 | 17 | /** 18 | * Object containing functions for displaying and updating the UI with streaming data. 19 | * 20 | * Publish this externally as "HystrixThreadPoolMonitor" 21 | */ 22 | window.HystrixThreadPoolMonitor = function(index, containerId) { 23 | 24 | var self = this; // keep scope under control 25 | 26 | this.index = index; 27 | this.containerId = containerId; 28 | 29 | /** 30 | * Initialization on construction 31 | */ 32 | // intialize various variables we use for visualization 33 | var maxXaxisForCircle="40%"; 34 | var maxYaxisForCircle="40%"; 35 | var maxRadiusForCircle="125"; 36 | var maxDomain = 2000; 37 | 38 | self.circleRadius = d3.scale.pow().exponent(0.5).domain([0, maxDomain]).range(["5", maxRadiusForCircle]); // requests per second per host 39 | self.circleYaxis = d3.scale.linear().domain([0, maxDomain]).range(["30%", maxXaxisForCircle]); 40 | self.circleXaxis = d3.scale.linear().domain([0, maxDomain]).range(["30%", maxYaxisForCircle]); 41 | self.colorRange = d3.scale.linear().domain([10, 25, 40, 50]).range(["green", "#FFCC00", "#FF9900", "red"]); 42 | self.errorPercentageColorRange = d3.scale.linear().domain([0, 10, 35, 50]).range(["grey", "black", "#FF9900", "red"]); 43 | 44 | /** 45 | * We want to keep sorting in the background since data values are always changing, so this will re-sort every X milliseconds 46 | * to maintain whatever sort the user (or default) has chosen. 47 | * 48 | * In other words, sorting only for adds/deletes is not sufficient as all but alphabetical sort are dynamically changing. 49 | */ 50 | setInterval(function() { 51 | // sort since we have added a new one 52 | self.sortSameAsLast(); 53 | }, 1000) 54 | 55 | /** 56 | * END of Initialization on construction 57 | */ 58 | 59 | /** 60 | * Event listener to handle new messages from EventSource as streamed from the server. 61 | */ 62 | /* public */ self.eventSourceMessageListener = function(e) { 63 | var data = JSON.parse(e.data); 64 | if(data) { 65 | data.index = self.index; 66 | // check for reportingHosts (if not there, set it to 1 for singleHost vs cluster) 67 | if(!data.reportingHosts) { 68 | data.reportingHosts = 1; 69 | } 70 | 71 | if(data && data.type == 'HystrixThreadPool') { 72 | if (data.deleteData == 'true') { 73 | deleteThreadPool(data.escapedName); 74 | } else { 75 | displayThreadPool(data); 76 | } 77 | } 78 | } 79 | } 80 | 81 | /** 82 | * Pre process the data before displying in the UI. 83 | * e.g Get Averages from sums, do rate calculation etc. 84 | */ 85 | function preProcessData(data) { 86 | validateData(data); 87 | // escape string used in jQuery & d3 selectors 88 | data.escapedName = data.name.replace(/([ !"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,'\\$1') + '_' + data.index; 89 | // do math 90 | converAllAvg(data); 91 | calcRatePerSecond(data); 92 | } 93 | 94 | function converAllAvg(data) { 95 | convertAvg(data, "propertyValue_queueSizeRejectionThreshold", false); 96 | 97 | // the following will break when it becomes a compound string if the property is dynamically changed 98 | convertAvg(data, "propertyValue_metricsRollingStatisticalWindowInMilliseconds", false); 99 | } 100 | 101 | function convertAvg(data, key, decimal) { 102 | if (decimal) { 103 | data[key] = roundNumber(data[key]/data["reportingHosts"]); 104 | } else { 105 | data[key] = Math.floor(data[key]/data["reportingHosts"]); 106 | } 107 | } 108 | 109 | function calcRatePerSecond(data) { 110 | var numberSeconds = data["propertyValue_metricsRollingStatisticalWindowInMilliseconds"] / 1000; 111 | 112 | var totalThreadsExecuted = data["rollingCountThreadsExecuted"]; 113 | if (totalThreadsExecuted < 0) { 114 | totalThreadsExecuted = 0; 115 | } 116 | data["ratePerSecond"] = roundNumber(totalThreadsExecuted / numberSeconds); 117 | data["ratePerSecondPerHost"] = roundNumber(totalThreadsExecuted / numberSeconds / data["reportingHosts"]); 118 | } 119 | 120 | function validateData(data) { 121 | 122 | assertNotNull(data,"type"); 123 | assertNotNull(data,"name"); 124 | // assertNotNull(data,"currentTime"); 125 | assertNotNull(data,"currentActiveCount"); 126 | assertNotNull(data,"currentCompletedTaskCount"); 127 | assertNotNull(data,"currentCorePoolSize"); 128 | assertNotNull(data,"currentLargestPoolSize"); 129 | assertNotNull(data,"currentMaximumPoolSize"); 130 | assertNotNull(data,"currentPoolSize"); 131 | assertNotNull(data,"currentQueueSize"); 132 | assertNotNull(data,"currentTaskCount"); 133 | assertNotNull(data,"rollingCountThreadsExecuted"); 134 | assertNotNull(data,"rollingMaxActiveThreads"); 135 | assertNotNull(data,"reportingHosts"); 136 | 137 | assertNotNull(data,"propertyValue_queueSizeRejectionThreshold"); 138 | assertNotNull(data,"propertyValue_metricsRollingStatisticalWindowInMilliseconds"); 139 | } 140 | 141 | function assertNotNull(data, key) { 142 | if(data[key] == undefined) { 143 | if (key == "dependencyOwner") { 144 | data["dependencyOwner"] = data.name; 145 | } else { 146 | throw new Error("Key Missing: " + key + " for " + data.name) 147 | } 148 | } 149 | } 150 | 151 | /** 152 | * Method to display the THREAD_POOL data 153 | * 154 | * @param data 155 | */ 156 | /* private */ function displayThreadPool(data) { 157 | 158 | try { 159 | preProcessData(data); 160 | } catch (err) { 161 | log("Failed preProcessData: " + err.message); 162 | return; 163 | } 164 | 165 | // add the 'addCommas' function to the 'data' object so the HTML templates can use it 166 | data.addCommas = addCommas; 167 | // add the 'roundNumber' function to the 'data' object so the HTML templates can use it 168 | data.roundNumber = roundNumber; 169 | 170 | var addNew = false; 171 | // check if we need to create the container 172 | if(!$('#THREAD_POOL_' + data.escapedName).length) { 173 | // it doesn't exist so add it 174 | var html = tmpl(htmlTemplateContainer, data); 175 | // remove the loading thing first 176 | $('#' + containerId + ' span.loading').remove(); 177 | // get the current last column and remove the 'last' class from it 178 | $('#' + containerId + ' div.last').removeClass('last'); 179 | // now create the new data and add it 180 | $('#' + containerId + '').append(html); 181 | // add the 'last' class to the column we just added 182 | $('#' + containerId + ' div.monitor').last().addClass('last'); 183 | 184 | // add the default sparkline graph 185 | d3.selectAll('#graph_THREAD_POOL_' + data.escapedName + ' svg').append("svg:path"); 186 | 187 | // remember this is new so we can trigger a sort after setting data 188 | addNew = true; 189 | } 190 | 191 | // set the rate on the div element so it's available for sorting 192 | $('#THREAD_POOL_' + data.escapedName).attr('rate_value', data.ratePerSecondPerHost); 193 | 194 | // now update/insert the data 195 | $('#THREAD_POOL_' + data.escapedName + ' div.monitor_data').html(tmpl(htmlTemplate, data)); 196 | 197 | // set variables for circle visualization 198 | var rate = data.ratePerSecondPerHost; 199 | // we will treat each item in queue as 1% of an error visualization 200 | // ie. 5 threads in queue per instance == 5% error percentage 201 | var errorPercentage = data.currentQueueSize / data.reportingHosts; 202 | 203 | updateCircle('#THREAD_POOL_' + data.escapedName + ' circle', rate, errorPercentage); 204 | 205 | if(addNew) { 206 | // sort since we added a new circuit 207 | self.sortSameAsLast(); 208 | } 209 | } 210 | 211 | /* round a number to X digits: num => the number to round, dec => the number of decimals */ 212 | /* private */ function roundNumber(num) { 213 | var dec=1; // we are hardcoding to support only 1 decimal so that our padding logic at the end is simple 214 | var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec); 215 | var resultAsString = result.toString(); 216 | if(resultAsString.indexOf('.') == -1) { 217 | resultAsString = resultAsString + '.'; 218 | for(var i=0; i parseInt(maxXaxisForCircle)) { 229 | newXaxisForCircle = maxXaxisForCircle; 230 | } 231 | var newYaxisForCircle = self.circleYaxis(rate); 232 | if(parseInt(newYaxisForCircle) > parseInt(maxYaxisForCircle)) { 233 | newYaxisForCircle = maxYaxisForCircle; 234 | } 235 | var newRadiusForCircle = self.circleRadius(rate); 236 | if(parseInt(newRadiusForCircle) > parseInt(maxRadiusForCircle)) { 237 | newRadiusForCircle = maxRadiusForCircle; 238 | } 239 | 240 | d3.selectAll(cssTarget) 241 | .transition() 242 | .duration(400) 243 | .attr("cy", newYaxisForCircle) 244 | .attr("cx", newXaxisForCircle) 245 | .attr("r", newRadiusForCircle) 246 | .style("fill", self.colorRange(errorPercentage)); 247 | } 248 | 249 | /* private */ function deleteThreadPool(poolName) { 250 | $('#THREAD_POOL_' + poolName).remove(); 251 | } 252 | 253 | } 254 | 255 | // public methods for sorting 256 | HystrixThreadPoolMonitor.prototype.sortByVolume = function() { 257 | var direction = "desc"; 258 | if(this.sortedBy == 'rate_desc') { 259 | direction = 'asc'; 260 | } 261 | this.sortByVolumeInDirection(direction); 262 | } 263 | 264 | HystrixThreadPoolMonitor.prototype.sortByVolumeInDirection = function(direction) { 265 | this.sortedBy = 'rate_' + direction; 266 | $('#' + this.containerId + ' div.monitor').tsort({order: direction, attr: 'rate_value'}); 267 | } 268 | 269 | HystrixThreadPoolMonitor.prototype.sortAlphabetically = function() { 270 | var direction = "asc"; 271 | if(this.sortedBy == 'alph_asc') { 272 | direction = 'desc'; 273 | } 274 | this.sortAlphabeticalInDirection(direction); 275 | } 276 | 277 | HystrixThreadPoolMonitor.prototype.sortAlphabeticalInDirection = function(direction) { 278 | this.sortedBy = 'alph_' + direction; 279 | $('#' + this.containerId + ' div.monitor').tsort("p.name", {order: direction}); 280 | } 281 | 282 | HystrixThreadPoolMonitor.prototype.sortByMetricInDirection = function(direction, metric) { 283 | $('#' + this.containerId + ' div.monitor').tsort(metric, {order: direction}); 284 | } 285 | 286 | // this method is for when new divs are added to cause the elements to be sorted to whatever the user last chose 287 | HystrixThreadPoolMonitor.prototype.sortSameAsLast = function() { 288 | if(this.sortedBy == 'alph_asc') { 289 | this.sortAlphabeticalInDirection('asc'); 290 | } else if(this.sortedBy == 'alph_desc') { 291 | this.sortAlphabeticalInDirection('desc'); 292 | } else if(this.sortedBy == 'rate_asc') { 293 | this.sortByVolumeInDirection('asc'); 294 | } else if(this.sortedBy == 'rate_desc') { 295 | this.sortByVolumeInDirection('desc'); 296 | } else if(this.sortedBy == 'error_asc') { 297 | this.sortByErrorInDirection('asc'); 298 | } else if(this.sortedBy == 'error_desc') { 299 | this.sortByErrorInDirection('desc'); 300 | } else if(this.sortedBy == 'lat90_asc') { 301 | this.sortByMetricInDirection('asc', 'p90'); 302 | } else if(this.sortedBy == 'lat90_desc') { 303 | this.sortByMetricInDirection('desc', 'p90'); 304 | } else if(this.sortedBy == 'lat99_asc') { 305 | this.sortByMetricInDirection('asc', 'p99'); 306 | } else if(this.sortedBy == 'lat99_desc') { 307 | this.sortByMetricInDirection('desc', 'p99'); 308 | } else if(this.sortedBy == 'lat995_asc') { 309 | this.sortByMetricInDirection('asc', 'p995'); 310 | } else if(this.sortedBy == 'lat995_desc') { 311 | this.sortByMetricInDirection('desc', 'p995'); 312 | } else if(this.sortedBy == 'latMean_asc') { 313 | this.sortByMetricInDirection('asc', 'pMean'); 314 | } else if(this.sortedBy == 'latMean_desc') { 315 | this.sortByMetricInDirection('desc', 'pMean'); 316 | } else if(this.sortedBy == 'latMedian_asc') { 317 | this.sortByMetricInDirection('asc', 'pMedian'); 318 | } else if(this.sortedBy == 'latMedian_desc') { 319 | this.sortByMetricInDirection('desc', 'pMedian'); 320 | } 321 | } 322 | 323 | // default sort type and direction 324 | this.sortedBy = 'alph_asc'; 325 | 326 | 327 | // a temporary home for the logger until we become more sophisticated 328 | function log(message) { 329 | console.log(message); 330 | }; 331 | 332 | function addCommas(nStr){ 333 | nStr += ''; 334 | if(nStr.length <=3) { 335 | return nStr; //shortcut if we don't need commas 336 | } 337 | x = nStr.split('.'); 338 | x1 = x[0]; 339 | x2 = x.length > 1 ? '.' + x[1] : ''; 340 | var rgx = /(\d+)(\d{3})/; 341 | while (rgx.test(x1)) { 342 | x1 = x1.replace(rgx, '$1' + ',' + '$2'); 343 | } 344 | return x1 + x2; 345 | } 346 | })(window) 347 | 348 | 349 | -------------------------------------------------------------------------------- /src/main/webapp/components/hystrixCommand/hystrixCommand.js: -------------------------------------------------------------------------------- 1 | 2 | (function(window) { 3 | 4 | // cache the templates we use on this page as global variables (asynchronously) 5 | jQuery.get(getRelativePath("../components/hystrixCommand/templates/hystrixCircuit.html"), function(data) { 6 | hystrixTemplateCircuit = data; 7 | }); 8 | jQuery.get(getRelativePath("../components/hystrixCommand/templates/hystrixCircuitContainer.html"), function(data) { 9 | hystrixTemplateCircuitContainer = data; 10 | }); 11 | 12 | function getRelativePath(path) { 13 | var p = location.pathname.slice(0, location.pathname.lastIndexOf("/")+1); 14 | return p + path; 15 | } 16 | 17 | /** 18 | * Object containing functions for displaying and updating the UI with streaming data. 19 | * 20 | * Publish this externally as "HystrixCommandMonitor" 21 | */ 22 | window.HystrixCommandMonitor = function(index, containerId, args) { 23 | 24 | var self = this; // keep scope under control 25 | self.args = args; 26 | if(self.args == undefined) { 27 | self.args = {}; 28 | } 29 | 30 | this.index = index; 31 | this.containerId = containerId; 32 | 33 | /** 34 | * Initialization on construction 35 | */ 36 | // intialize various variables we use for visualization 37 | var maxXaxisForCircle="40%"; 38 | var maxYaxisForCircle="40%"; 39 | var maxRadiusForCircle="125"; 40 | 41 | // CIRCUIT_BREAKER circle visualization settings 42 | self.circuitCircleRadius = d3.scale.pow().exponent(0.5).domain([0, 400]).range(["5", maxRadiusForCircle]); // requests per second per host 43 | self.circuitCircleYaxis = d3.scale.linear().domain([0, 400]).range(["30%", maxXaxisForCircle]); 44 | self.circuitCircleXaxis = d3.scale.linear().domain([0, 400]).range(["30%", maxYaxisForCircle]); 45 | self.circuitColorRange = d3.scale.linear().domain([10, 25, 40, 50]).range(["green", "#FFCC00", "#FF9900", "red"]); 46 | self.circuitErrorPercentageColorRange = d3.scale.linear().domain([0, 10, 35, 50]).range(["grey", "black", "#FF9900", "red"]); 47 | 48 | /** 49 | * We want to keep sorting in the background since data values are always changing, so this will re-sort every X milliseconds 50 | * to maintain whatever sort the user (or default) has chosen. 51 | * 52 | * In other words, sorting only for adds/deletes is not sufficient as all but alphabetical sort are dynamically changing. 53 | */ 54 | setInterval(function() { 55 | // sort since we have added a new one 56 | self.sortSameAsLast(); 57 | }, 10000); 58 | 59 | 60 | /** 61 | * END of Initialization on construction 62 | */ 63 | 64 | /** 65 | * Event listener to handle new messages from EventSource as streamed from the server. 66 | */ 67 | /* public */ self.eventSourceMessageListener = function(e) { 68 | var data = JSON.parse(e.data); 69 | if(data) { 70 | data.index = self.index; 71 | // check for reportingHosts (if not there, set it to 1 for singleHost vs cluster) 72 | if(!data.reportingHosts) { 73 | data.reportingHosts = 1; 74 | } 75 | 76 | if(data && data.type == 'HystrixCommand') { 77 | if (data.deleteData == 'true') { 78 | deleteCircuit(data.escapedName); 79 | } else { 80 | displayCircuit(data); 81 | } 82 | } 83 | } 84 | }; 85 | 86 | /** 87 | * Pre process the data before displying in the UI. 88 | * e.g Get Averages from sums, do rate calculation etc. 89 | */ 90 | function preProcessData(data) { 91 | // set defaults for values that may be missing from older streams 92 | setIfMissing(data, "rollingCountBadRequests", 0); 93 | // assert all the values we need 94 | validateData(data); 95 | // escape string used in jQuery & d3 selectors 96 | data.escapedName = data.name.replace(/([ !"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,'\\$1') + '_' + data.index; 97 | // do math 98 | convertAllAvg(data); 99 | calcRatePerSecond(data); 100 | } 101 | 102 | function setIfMissing(data, key, defaultValue) { 103 | if(data[key] == undefined) { 104 | data[key] = defaultValue; 105 | } 106 | } 107 | 108 | /** 109 | * Since the stream of data can be aggregated from multiple hosts in a tiered manner 110 | * the aggregation just sums everything together and provides us the denominator (reportingHosts) 111 | * so we must divide by it to get an average per instance value. 112 | * 113 | * We want to do this on any numerical values where we want per instance rather than cluster-wide sum. 114 | */ 115 | function convertAllAvg(data) { 116 | convertAvg(data, "errorPercentage", true); 117 | convertAvg(data, "latencyExecute_mean", false); 118 | } 119 | 120 | function convertAvg(data, key, decimal) { 121 | if (decimal) { 122 | data[key] = getInstanceAverage(data[key], data["reportingHosts"], decimal); 123 | } else { 124 | data[key] = getInstanceAverage(data[key], data["reportingHosts"], decimal); 125 | } 126 | } 127 | 128 | function getInstanceAverage(value, reportingHosts, decimal) { 129 | if (decimal) { 130 | return roundNumber(value/reportingHosts); 131 | } else { 132 | return Math.floor(value/reportingHosts); 133 | } 134 | } 135 | 136 | function calcRatePerSecond(data) { 137 | var numberSeconds = data["propertyValue_metricsRollingStatisticalWindowInMilliseconds"] / 1000; 138 | 139 | var totalRequests = data["requestCount"]; 140 | if (totalRequests < 0) { 141 | totalRequests = 0; 142 | } 143 | data["ratePerSecond"] = roundNumber(totalRequests / numberSeconds); 144 | data["ratePerSecondPerHost"] = roundNumber(totalRequests / numberSeconds / data["reportingHosts"]) ; 145 | } 146 | 147 | function validateData(data) { 148 | assertNotNull(data,"reportingHosts"); 149 | assertNotNull(data,"type"); 150 | assertNotNull(data,"name"); 151 | assertNotNull(data,"group"); 152 | // assertNotNull(data,"currentTime"); 153 | assertNotNull(data,"isCircuitBreakerOpen"); 154 | assertNotNull(data,"errorPercentage"); 155 | assertNotNull(data,"errorCount"); 156 | assertNotNull(data,"requestCount"); 157 | assertNotNull(data,"rollingCountCollapsedRequests"); 158 | assertNotNull(data,"rollingCountExceptionsThrown"); 159 | assertNotNull(data,"rollingCountFailure"); 160 | assertNotNull(data,"rollingCountFallbackFailure"); 161 | assertNotNull(data,"rollingCountFallbackRejection"); 162 | assertNotNull(data,"rollingCountFallbackSuccess"); 163 | assertNotNull(data,"rollingCountResponsesFromCache"); 164 | assertNotNull(data,"rollingCountSemaphoreRejected"); 165 | assertNotNull(data,"rollingCountShortCircuited"); 166 | assertNotNull(data,"rollingCountSuccess"); 167 | assertNotNull(data,"rollingCountThreadPoolRejected"); 168 | assertNotNull(data,"rollingCountTimeout"); 169 | assertNotNull(data,"rollingCountBadRequests"); 170 | assertNotNull(data,"currentConcurrentExecutionCount"); 171 | assertNotNull(data,"latencyExecute_mean"); 172 | assertNotNull(data,"latencyExecute"); 173 | assertNotNull(data,"propertyValue_circuitBreakerRequestVolumeThreshold"); 174 | assertNotNull(data,"propertyValue_circuitBreakerSleepWindowInMilliseconds"); 175 | assertNotNull(data,"propertyValue_circuitBreakerErrorThresholdPercentage"); 176 | assertNotNull(data,"propertyValue_circuitBreakerForceOpen"); 177 | assertNotNull(data,"propertyValue_circuitBreakerForceClosed"); 178 | assertNotNull(data,"propertyValue_executionIsolationStrategy"); 179 | assertNotNull(data,"propertyValue_executionIsolationThreadTimeoutInMilliseconds"); 180 | assertNotNull(data,"propertyValue_executionIsolationThreadInterruptOnTimeout"); 181 | // assertNotNull(data,"propertyValue_executionIsolationThreadPoolKeyOverride"); 182 | assertNotNull(data,"propertyValue_executionIsolationSemaphoreMaxConcurrentRequests"); 183 | assertNotNull(data,"propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests"); 184 | assertNotNull(data,"propertyValue_requestCacheEnabled"); 185 | assertNotNull(data,"propertyValue_requestLogEnabled"); 186 | assertNotNull(data,"propertyValue_metricsRollingStatisticalWindowInMilliseconds"); 187 | } 188 | 189 | function assertNotNull(data, key) { 190 | if(data[key] == undefined) { 191 | throw new Error("Key Missing: " + key + " for " + data.name); 192 | } 193 | } 194 | 195 | /** 196 | * Method to display the CIRCUIT data 197 | * 198 | * @param data 199 | */ 200 | /* private */ function displayCircuit(data) { 201 | 202 | try { 203 | preProcessData(data); 204 | } catch (err) { 205 | log("Failed preProcessData: " + err.message); 206 | return; 207 | } 208 | 209 | // add the 'addCommas' function to the 'data' object so the HTML templates can use it 210 | data.addCommas = addCommas; 211 | // add the 'roundNumber' function to the 'data' object so the HTML templates can use it 212 | data.roundNumber = roundNumber; 213 | // add the 'getInstanceAverage' function to the 'data' object so the HTML templates can use it 214 | data.getInstanceAverage = getInstanceAverage; 215 | 216 | var addNew = false; 217 | // check if we need to create the container 218 | if(!$('#CIRCUIT_' + data.escapedName).length) { 219 | // args for display 220 | if(self.args.includeDetailIcon != undefined && self.args.includeDetailIcon) { 221 | data.includeDetailIcon = true; 222 | }else { 223 | data.includeDetailIcon = false; 224 | } 225 | 226 | // it doesn't exist so add it 227 | var html = tmpl(hystrixTemplateCircuitContainer, data); 228 | // remove the loading thing first 229 | $('#' + containerId + ' span.loading').remove(); 230 | // now create the new data and add it 231 | $('#' + containerId + '').append(html); 232 | 233 | // add the default sparkline graph 234 | d3.selectAll('#graph_CIRCUIT_' + data.escapedName + ' svg').append("svg:path"); 235 | 236 | // remember this is new so we can trigger a sort after setting data 237 | addNew = true; 238 | } 239 | 240 | 241 | // now update/insert the data 242 | $('#CIRCUIT_' + data.escapedName + ' div.monitor_data').html(tmpl(hystrixTemplateCircuit, data)); 243 | 244 | var ratePerSecond = data.ratePerSecond; 245 | var ratePerSecondPerHost = data.ratePerSecondPerHost; 246 | var ratePerSecondPerHostDisplay = ratePerSecondPerHost; 247 | var errorThenVolume = isNaN( ratePerSecond )? -1: (data.errorPercentage * 100000000) + ratePerSecond; 248 | // set the rates on the div element so it's available for sorting 249 | $('#CIRCUIT_' + data.escapedName).attr('rate_value', ratePerSecond); 250 | $('#CIRCUIT_' + data.escapedName).attr('error_then_volume', errorThenVolume); 251 | 252 | // update errorPercentage color on page 253 | $('#CIRCUIT_' + data.escapedName + ' a.errorPercentage').css('color', self.circuitErrorPercentageColorRange(data.errorPercentage)); 254 | 255 | updateCircle('circuit', '#CIRCUIT_' + data.escapedName + ' circle', ratePerSecondPerHostDisplay, data.errorPercentage); 256 | 257 | if(data.graphValues) { 258 | // we have a set of values to initialize with 259 | updateSparkline('circuit', '#CIRCUIT_' + data.escapedName + ' path', data.graphValues); 260 | } else { 261 | updateSparkline('circuit', '#CIRCUIT_' + data.escapedName + ' path', ratePerSecond); 262 | } 263 | 264 | if(addNew) { 265 | // sort since we added a new circuit 266 | self.sortSameAsLast(); 267 | } 268 | } 269 | 270 | /* round a number to X digits: num => the number to round, dec => the number of decimals */ 271 | /* private */ function roundNumber(num) { 272 | var dec=1; 273 | var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec); 274 | var resultAsString = result.toString(); 275 | if(resultAsString.indexOf('.') == -1) { 276 | resultAsString = resultAsString + '.0'; 277 | } 278 | return resultAsString; 279 | }; 280 | 281 | 282 | 283 | 284 | /* private */ function updateCircle(variablePrefix, cssTarget, rate, errorPercentage) { 285 | var newXaxisForCircle = self[variablePrefix + 'CircleXaxis'](rate); 286 | if(parseInt(newXaxisForCircle) > parseInt(maxXaxisForCircle)) { 287 | newXaxisForCircle = maxXaxisForCircle; 288 | } 289 | var newYaxisForCircle = self[variablePrefix + 'CircleYaxis'](rate); 290 | if(parseInt(newYaxisForCircle) > parseInt(maxYaxisForCircle)) { 291 | newYaxisForCircle = maxYaxisForCircle; 292 | } 293 | var newRadiusForCircle = self[variablePrefix + 'CircleRadius'](rate); 294 | if(parseInt(newRadiusForCircle) > parseInt(maxRadiusForCircle)) { 295 | newRadiusForCircle = maxRadiusForCircle; 296 | } 297 | 298 | d3.selectAll(cssTarget) 299 | .transition() 300 | .duration(400) 301 | .attr("cy", newYaxisForCircle) 302 | .attr("cx", newXaxisForCircle) 303 | .attr("r", newRadiusForCircle) 304 | .style("fill", self[variablePrefix + 'ColorRange'](errorPercentage)); 305 | } 306 | 307 | /* private */ function updateSparkline(variablePrefix, cssTarget, newDataPoint) { 308 | var currentTimeMilliseconds = new Date().getTime(); 309 | var data = self[variablePrefix + cssTarget + '_data']; 310 | if(typeof data == 'undefined') { 311 | // else it's new 312 | if(typeof newDataPoint == 'object') { 313 | // we received an array of values, so initialize with it 314 | data = newDataPoint; 315 | } else { 316 | // v: VALUE, t: TIME_IN_MILLISECONDS 317 | data = [{"v":parseFloat(newDataPoint),"t":currentTimeMilliseconds}]; 318 | } 319 | self[variablePrefix + cssTarget + '_data'] = data; 320 | } else { 321 | if(typeof newDataPoint == 'object') { 322 | /* if an array is passed in we'll replace the cached one */ 323 | data = newDataPoint; 324 | } else { 325 | // else we just add to the existing one 326 | data.push({"v":parseFloat(newDataPoint),"t":currentTimeMilliseconds}); 327 | } 328 | } 329 | 330 | while(data.length > 200) { // 400 should be plenty for the 2 minutes we have the scale set to below even with a very low update latency 331 | // remove data so we don't keep increasing forever 332 | data.shift(); 333 | } 334 | 335 | if(data.length == 1 && data[0].v == 0) { 336 | //console.log("we have a single 0 so skipping"); 337 | // don't show if we have a single 0 338 | return; 339 | } 340 | 341 | if(data.length > 1 && data[0].v == 0 && data[1].v != 0) { 342 | //console.log("we have a leading 0 so removing it"); 343 | // get rid of a leading 0 if the following number is not a 0 344 | data.shift(); 345 | } 346 | 347 | var xScale = d3.time.scale().domain([new Date(currentTimeMilliseconds-(60*1000*2)), new Date(currentTimeMilliseconds)]).range([0, 140]); 348 | 349 | var yMin = d3.min(data, function(d) { return d.v; }); 350 | var yMax = d3.max(data, function(d) { return d.v; }); 351 | var yScale = d3.scale.linear().domain([yMin, yMax]).nice().range([60, 0]); // y goes DOWN, so 60 is the "lowest" 352 | 353 | sparkline = d3.svg.line() 354 | // assign the X function to plot our line as we wish 355 | .x(function(d,i) { 356 | // return the X coordinate where we want to plot this datapoint based on the time 357 | return xScale(new Date(d.t)); 358 | }) 359 | .y(function(d) { 360 | return yScale(d.v); 361 | }) 362 | .interpolate("basis"); 363 | 364 | d3.selectAll(cssTarget).attr("d", sparkline(data)); 365 | } 366 | 367 | /* private */ function deleteCircuit(circuitName) { 368 | $('#CIRCUIT_' + circuitName).remove(); 369 | } 370 | 371 | }; 372 | 373 | // public methods for sorting 374 | HystrixCommandMonitor.prototype.sortByVolume = function() { 375 | var direction = "desc"; 376 | if(this.sortedBy == 'rate_desc') { 377 | direction = 'asc'; 378 | } 379 | this.sortByVolumeInDirection(direction); 380 | }; 381 | 382 | HystrixCommandMonitor.prototype.sortByVolumeInDirection = function(direction) { 383 | this.sortedBy = 'rate_' + direction; 384 | $('#' + this.containerId + ' div.monitor').tsort({order: direction, attr: 'rate_value'}); 385 | }; 386 | 387 | HystrixCommandMonitor.prototype.sortAlphabetically = function() { 388 | var direction = "asc"; 389 | if(this.sortedBy == 'alph_asc') { 390 | direction = 'desc'; 391 | } 392 | this.sortAlphabeticalInDirection(direction); 393 | }; 394 | 395 | HystrixCommandMonitor.prototype.sortAlphabeticalInDirection = function(direction) { 396 | this.sortedBy = 'alph_' + direction; 397 | $('#' + this.containerId + ' div.monitor').tsort("p.name", {order: direction}); 398 | }; 399 | 400 | 401 | HystrixCommandMonitor.prototype.sortByError = function() { 402 | var direction = "desc"; 403 | if(this.sortedBy == 'error_desc') { 404 | direction = 'asc'; 405 | } 406 | this.sortByErrorInDirection(direction); 407 | }; 408 | 409 | HystrixCommandMonitor.prototype.sortByErrorInDirection = function(direction) { 410 | this.sortedBy = 'error_' + direction; 411 | $('#' + this.containerId + ' div.monitor').tsort(".errorPercentage .value", {order: direction}); 412 | }; 413 | 414 | HystrixCommandMonitor.prototype.sortByErrorThenVolume = function() { 415 | var direction = "desc"; 416 | if(this.sortedBy == 'error_then_volume_desc') { 417 | direction = 'asc'; 418 | } 419 | this.sortByErrorThenVolumeInDirection(direction); 420 | }; 421 | 422 | HystrixCommandMonitor.prototype.sortByErrorThenVolumeInDirection = function(direction) { 423 | this.sortedBy = 'error_then_volume_' + direction; 424 | $('#' + this.containerId + ' div.monitor').tsort({order: direction, attr: 'error_then_volume'}); 425 | }; 426 | 427 | HystrixCommandMonitor.prototype.sortByLatency90 = function() { 428 | var direction = "desc"; 429 | if(this.sortedBy == 'lat90_desc') { 430 | direction = 'asc'; 431 | } 432 | this.sortedBy = 'lat90_' + direction; 433 | this.sortByMetricInDirection(direction, ".latency90 .value"); 434 | }; 435 | 436 | HystrixCommandMonitor.prototype.sortByLatency99 = function() { 437 | var direction = "desc"; 438 | if(this.sortedBy == 'lat99_desc') { 439 | direction = 'asc'; 440 | } 441 | this.sortedBy = 'lat99_' + direction; 442 | this.sortByMetricInDirection(direction, ".latency99 .value"); 443 | }; 444 | 445 | HystrixCommandMonitor.prototype.sortByLatency995 = function() { 446 | var direction = "desc"; 447 | if(this.sortedBy == 'lat995_desc') { 448 | direction = 'asc'; 449 | } 450 | this.sortedBy = 'lat995_' + direction; 451 | this.sortByMetricInDirection(direction, ".latency995 .value"); 452 | }; 453 | 454 | HystrixCommandMonitor.prototype.sortByLatencyMean = function() { 455 | var direction = "desc"; 456 | if(this.sortedBy == 'latMean_desc') { 457 | direction = 'asc'; 458 | } 459 | this.sortedBy = 'latMean_' + direction; 460 | this.sortByMetricInDirection(direction, ".latencyMean .value"); 461 | }; 462 | 463 | HystrixCommandMonitor.prototype.sortByLatencyMedian = function() { 464 | var direction = "desc"; 465 | if(this.sortedBy == 'latMedian_desc') { 466 | direction = 'asc'; 467 | } 468 | this.sortedBy = 'latMedian_' + direction; 469 | this.sortByMetricInDirection(direction, ".latencyMedian .value"); 470 | }; 471 | 472 | HystrixCommandMonitor.prototype.sortByMetricInDirection = function(direction, metric) { 473 | $('#' + this.containerId + ' div.monitor').tsort(metric, {order: direction}); 474 | }; 475 | 476 | // this method is for when new divs are added to cause the elements to be sorted to whatever the user last chose 477 | HystrixCommandMonitor.prototype.sortSameAsLast = function() { 478 | if(this.sortedBy == 'alph_asc') { 479 | this.sortAlphabeticalInDirection('asc'); 480 | } else if(this.sortedBy == 'alph_desc') { 481 | this.sortAlphabeticalInDirection('desc'); 482 | } else if(this.sortedBy == 'rate_asc') { 483 | this.sortByVolumeInDirection('asc'); 484 | } else if(this.sortedBy == 'rate_desc') { 485 | this.sortByVolumeInDirection('desc'); 486 | } else if(this.sortedBy == 'error_asc') { 487 | this.sortByErrorInDirection('asc'); 488 | } else if(this.sortedBy == 'error_desc') { 489 | this.sortByErrorInDirection('desc'); 490 | } else if(this.sortedBy == 'error_then_volume_asc') { 491 | this.sortByErrorThenVolumeInDirection('asc'); 492 | } else if(this.sortedBy == 'error_then_volume_desc') { 493 | this.sortByErrorThenVolumeInDirection('desc'); 494 | } else if(this.sortedBy == 'lat90_asc') { 495 | this.sortByMetricInDirection('asc', '.latency90 .value'); 496 | } else if(this.sortedBy == 'lat90_desc') { 497 | this.sortByMetricInDirection('desc', '.latency90 .value'); 498 | } else if(this.sortedBy == 'lat99_asc') { 499 | this.sortByMetricInDirection('asc', '.latency99 .value'); 500 | } else if(this.sortedBy == 'lat99_desc') { 501 | this.sortByMetricInDirection('desc', '.latency99 .value'); 502 | } else if(this.sortedBy == 'lat995_asc') { 503 | this.sortByMetricInDirection('asc', '.latency995 .value'); 504 | } else if(this.sortedBy == 'lat995_desc') { 505 | this.sortByMetricInDirection('desc', '.latency995 .value'); 506 | } else if(this.sortedBy == 'latMean_asc') { 507 | this.sortByMetricInDirection('asc', '.latencyMean .value'); 508 | } else if(this.sortedBy == 'latMean_desc') { 509 | this.sortByMetricInDirection('desc', '.latencyMean .value'); 510 | } else if(this.sortedBy == 'latMedian_asc') { 511 | this.sortByMetricInDirection('asc', '.latencyMedian .value'); 512 | } else if(this.sortedBy == 'latMedian_desc') { 513 | this.sortByMetricInDirection('desc', '.latencyMedian .value'); 514 | } 515 | }; 516 | 517 | // default sort type and direction 518 | this.sortedBy = 'alph_asc'; 519 | 520 | 521 | // a temporary home for the logger until we become more sophisticated 522 | function log(message) { 523 | console.log(message); 524 | }; 525 | 526 | function addCommas(nStr){ 527 | nStr += ''; 528 | if(nStr.length <=3) { 529 | return nStr; //shortcut if we don't need commas 530 | } 531 | x = nStr.split('.'); 532 | x1 = x[0]; 533 | x2 = x.length > 1 ? '.' + x[1] : ''; 534 | var rgx = /(\d+)(\d{3})/; 535 | while (rgx.test(x1)) { 536 | x1 = x1.replace(rgx, '$1' + ',' + '$2'); 537 | } 538 | return x1 + x2; 539 | } 540 | })(window); 541 | 542 | 543 | -------------------------------------------------------------------------------- /src/main/webapp/js/jquery.min.js: -------------------------------------------------------------------------------- 1 | /*! jQuery v1.7.2 jquery.com | jquery.org/license */ 2 | (function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
    a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
    "+""+"
    ",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
    t
    ",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
    ",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( 3 | a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f 4 | .clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); --------------------------------------------------------------------------------