Repository: incubator-eagle Updated Branches: refs/heads/master 38f292644 -> ca0fae407
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/module/ModuleRegistryTest.java ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/module/ModuleRegistryTest.java b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/module/ModuleRegistryTest.java index a7236bb..2de57f2 100644 --- a/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/module/ModuleRegistryTest.java +++ b/eagle-core/eagle-common/src/test/java/org/apache/eagle/common/module/ModuleRegistryTest.java @@ -22,7 +22,7 @@ import org.junit.Test; public class ModuleRegistryTest { @Test - public void testPutAndGet(){ + public void testPutAndGet() { ModuleRegistry registry = new ModuleRegistryImpl(); registry.register(TestModuleScope_1.class, new AbstractModule() { @Override @@ -42,11 +42,14 @@ public class ModuleRegistryTest { } }); - Assert.assertEquals(2,registry.getModules(TestModuleScope_1.class).size()); - Assert.assertEquals(1,registry.getModules(TestModuleScope_2.class).size()); - Assert.assertEquals(3,registry.getModules().size()); + Assert.assertEquals(2, registry.getModules(TestModuleScope_1.class).size()); + Assert.assertEquals(1, registry.getModules(TestModuleScope_2.class).size()); + Assert.assertEquals(3, registry.getModules().size()); } - private class TestModuleScope_1 implements ModuleScope {} - private class TestModuleScope_2 implements ModuleScope {} + private class TestModuleScope_1 implements ModuleScope { + } + + private class TestModuleScope_2 implements ModuleScope { + } } http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/resources/footer.vm ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-common/src/test/resources/footer.vm b/eagle-core/eagle-common/src/test/resources/footer.vm index 8df4b06..d255988 100755 --- a/eagle-core/eagle-common/src/test/resources/footer.vm +++ b/eagle-core/eagle-common/src/test/resources/footer.vm @@ -16,9 +16,9 @@ * * @version 0.3.0 *# - </td> - </tr> - </tr> +</td> +</tr> +</tr> </table> <!-- End of wrapper table --> </body> http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/resources/header.vm ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-common/src/test/resources/header.vm b/eagle-core/eagle-common/src/test/resources/header.vm index 8bd4388..c91890f 100755 --- a/eagle-core/eagle-common/src/test/resources/header.vm +++ b/eagle-core/eagle-common/src/test/resources/header.vm @@ -19,281 +19,282 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - <meta name="viewport" content="width=device-width, initial-scale=1.0"/> - <title></title> - <style type="text/css"> - /* Based on The MailChimp Reset INLINE: Yes. */ - /* Client-specific Styles */ - .outlook a { - color: #091D42; - padding: 0; - text-decoration: none; - } - - /* Force Outlook to provide a "view in browser" menu link. */ - body { - width: 100% !important; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; - margin: 0; - padding: 0; - } - - /* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/ - .ExternalClass { - width: 100%; - } - - /* Force Hotmail to display emails at full width */ - .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { - line-height: 100%; - } - - /* Forces Hotmail to display normal line spacing. More on that: http://www.emailonacid.com/forum/viewthread/43/ */ - #backgroundTable { - margin: 0; - padding: 0; - width: 100% !important; - line-height: 100% !important; - } - - /* End reset */ - - /* Some sensible defaults for images - Bring inline: Yes. */ - img { - outline: none; - text-decoration: none; - -ms-interpolation-mode: bicubic; - } - - a img { - border: none; - } - - .image_fix { - display: block; - } - - /* Yahoo paragraph fix - Bring inline: Yes. */ - p { - margin: 1em 0; - } - - /* Hotmail header color reset - Bring inline: Yes. */ - h1, h2, h3, h4, h5, h6 { - color: black !important; - } - - h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { - color: blue !important; - } - - h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active { - color: red !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */ - } - - h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited { - color: purple !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */ - } - - /* Outlook 07, 10 Padding issue fix - Bring inline: No.*/ - table td { - border-collapse: collapse; - } - - table{ - width: 100%; - } - - /* Remove spacing around Outlook 07, 10 tables - Bring inline: Yes */ - table { - border-collapse: collapse; - mso-table-lspace: 0pt; - mso-table-rspace: 0pt; - } - - /* Styling your links has become much simpler with the new Yahoo. In fact, it falls in line with the main credo of styling in email and make sure to bring your styles inline. Your link colors will be uniform across clients when brought inline. - Bring inline: Yes. */ - a { - color: orange; - } - - /*************************************************** + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <title></title> + <style type="text/css"> + /* Based on The MailChimp Reset INLINE: Yes. */ + /* Client-specific Styles */ + .outlook a { + color: #091D42; + padding: 0; + text-decoration: none; + } + + /* Force Outlook to provide a "view in browser" menu link. */ + body { + width: 100% !important; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; + margin: 0; + padding: 0; + } + + /* Prevent Webkit and Windows Mobile platforms from changing default font sizes.*/ + .ExternalClass { + width: 100%; + } + + /* Force Hotmail to display emails at full width */ + .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div { + line-height: 100%; + } + + /* Forces Hotmail to display normal line spacing. More on that: http://www.emailonacid.com/forum/viewthread/43/ */ + #backgroundTable { + margin: 0; + padding: 0; + width: 100% !important; + line-height: 100% !important; + } + + /* End reset */ + + /* Some sensible defaults for images + Bring inline: Yes. */ + img { + outline: none; + text-decoration: none; + -ms-interpolation-mode: bicubic; + } + + a img { + border: none; + } + + .image_fix { + display: block; + } + + /* Yahoo paragraph fix + Bring inline: Yes. */ + p { + margin: 1em 0; + } + + /* Hotmail header color reset + Bring inline: Yes. */ + h1, h2, h3, h4, h5, h6 { + color: black !important; + } + + h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { + color: blue !important; + } + + h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active { + color: red !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */ + } + + h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited { + color: purple !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */ + } + + /* Outlook 07, 10 Padding issue fix + Bring inline: No.*/ + table td { + border-collapse: collapse; + } + + table { + width: 100%; + } + + /* Remove spacing around Outlook 07, 10 tables + Bring inline: Yes */ + table { + border-collapse: collapse; + mso-table-lspace: 0pt; + mso-table-rspace: 0pt; + } + + /* Styling your links has become much simpler with the new Yahoo. In fact, it falls in line with the main credo of styling in email and make sure to bring your styles inline. Your link colors will be uniform across clients when brought inline. + Bring inline: Yes. */ + a { + color: orange; + } + + /*************************************************** + **************************************************** + MOBILE TARGETING + **************************************************** + ***************************************************/ + @media only screen and (max-device-width: 480px) { + /* Part one of controlling phone number linking for mobile. */ + a[href^="tel"], a[href^="sms"] { + text-decoration: none; + color: blue; /* or whatever your want */ + pointer-events: none; + cursor: default; + } + + .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] { + text-decoration: default; + color: orange !important; + pointer-events: auto; + cursor: default; + } + + } + + /* More Specific Targeting */ + + @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { + /* You guessed it, ipad (tablets, smaller screens, etc) */ + /* repeating for the ipad */ + a[href^="tel"], a[href^="sms"] { + text-decoration: none; + color: blue; /* or whatever your want */ + pointer-events: none; + cursor: default; + } + + .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] { + text-decoration: default; + color: orange !important; + pointer-events: auto; + cursor: default; + } + } + + @media only screen and (-webkit-min-device-pixel-ratio: 2) { + /* Put your iPhone 4g styles in here */ + } + + /* Android targeting */ + @media only screen and (-webkit-device-pixel-ratio: .75) { + /* Put CSS for low density (ldpi) Android layouts in here */ + } + + @media only screen and (-webkit-device-pixel-ratio: 1) { + /* Put CSS for medium density (mdpi) Android layouts in here */ + } + + @media only screen and (-webkit-device-pixel-ratio: 1.5) { + /* Put CSS for high density (hdpi) Android layouts in here */ + } + + /* end Android targeting */ + .head { + font-family: Helvetica, Arial; + font-size: 30px; + text-decoration: none; + text-align: left; + color: #333; + align: left; + padding: 25px 0 15px 0; + valign: middle; + font-weight: 500; + border-bottom: 1px solid #cccccc; + } + + .head2 { + font-family: Helvetica, Arial; + font-size: 24px; + text-decoration: none; + text-align: left; + color: #333; + align: left; + padding: 20px 0 10px 0; + valign: middle; + font-weight: 500; + } + + .text { + font-family: Helvetica, Arial; + font-size: 14px; + text-decoration: none; + text-align: left; + color: #333; + align: left; + padding: 0.5em 0em 0.5em 0em; + valign: middle; + } + + .info { + font-family: Helvetica, Arial; + font-size: 16px; + text-decoration: none; + text-align: left; + padding-left: 10px; + border-left: 3px solid #396A92; + background-color: #9AB4CB; + color: #091D42; + align: left; + padding: 1em 0em 1em 1em; + valign: middle; + } + + .table-border { + border: 1px solid #ddd; + border-radius: 4px 4px 0 0; + box-shadow: none; + } + + .table-border-th { + font-family: Helvetica, Arial; + font-size: 14px; + text-decoration: none; + text-align: left; + border-top: 1px solid #cccccc; + border-right: 1px solid #cccccc; + padding: 8px; + } + + .table-border-td { + font-family: Helvetica, Arial; + font-size: 14px; + text-decoration: none; + text-align: left; + border-top: 1px solid #cccccc; + border-right: 1px solid #cccccc; + padding: 8px; + word-break: break-all; + } + + .foot { + font-family: Arial; + font-size: 14px; + text-decoration: none; + text-align: left; + padding: 0.5em 0em 0.5em 0.5em; + border-top: 1px solid #cccccc; + color: #777; + } + + </style> + + <!-- Targeting Windows Mobile --> + <!--[if IEMobile 7]> + <style type="text/css"> + + </style> + <![endif]--> + + <!-- *********************************************** **************************************************** - MOBILE TARGETING + END MOBILE TARGETING **************************************************** - ***************************************************/ - @media only screen and (max-device-width: 480px) { - /* Part one of controlling phone number linking for mobile. */ - a[href^="tel"], a[href^="sms"] { - text-decoration: none; - color: blue; /* or whatever your want */ - pointer-events: none; - cursor: default; - } - - .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] { - text-decoration: default; - color: orange !important; - pointer-events: auto; - cursor: default; - } - - } - - /* More Specific Targeting */ - - @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { - /* You guessed it, ipad (tablets, smaller screens, etc) */ - /* repeating for the ipad */ - a[href^="tel"], a[href^="sms"] { - text-decoration: none; - color: blue; /* or whatever your want */ - pointer-events: none; - cursor: default; - } - - .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] { - text-decoration: default; - color: orange !important; - pointer-events: auto; - cursor: default; - } - } - - @media only screen and (-webkit-min-device-pixel-ratio: 2) { - /* Put your iPhone 4g styles in here */ - } - - /* Android targeting */ - @media only screen and (-webkit-device-pixel-ratio: .75) { - /* Put CSS for low density (ldpi) Android layouts in here */ - } - - @media only screen and (-webkit-device-pixel-ratio: 1) { - /* Put CSS for medium density (mdpi) Android layouts in here */ - } - - @media only screen and (-webkit-device-pixel-ratio: 1.5) { - /* Put CSS for high density (hdpi) Android layouts in here */ - } - - /* end Android targeting */ - .head{ - font-family:Helvetica, Arial; - font-size:30px; - text-decoration:none; - text-align:left; - color:#333; - align:left; - padding: 25px 0 15px 0; - valign:middle; - font-weight: 500; - border-bottom: 1px solid #cccccc; - } - - .head2{ - font-family:Helvetica, Arial; - font-size:24px; - text-decoration:none; - text-align:left; - color:#333; - align:left; - padding: 20px 0 10px 0; - valign:middle; - font-weight: 500; - } - - .text{ - font-family:Helvetica, Arial; - font-size:14px; - text-decoration:none; - text-align:left; - color:#333; - align:left; - padding: 0.5em 0em 0.5em 0em; - valign:middle; - } - - .info { - font-family:Helvetica, Arial; - font-size:16px; - text-decoration:none; - text-align:left; - padding-left:10px; - border-left: 3px solid #396A92; - background-color: #9AB4CB; - color:#091D42; - align:left; - padding: 1em 0em 1em 1em; - valign:middle; - } - - .table-border{ - border: 1px solid #ddd; - border-radius: 4px 4px 0 0; - box-shadow: none; - } - - .table-border-th{ - font-family:Helvetica, Arial; - font-size:14px; - text-decoration:none; - text-align:left; - border-top: 1px solid #cccccc; - border-right: 1px solid #cccccc; - padding: 8px; - } - .table-border-td{ - font-family:Helvetica, Arial; - font-size:14px; - text-decoration:none; - text-align:left; - border-top: 1px solid #cccccc; - border-right: 1px solid #cccccc; - padding: 8px; - word-break: break-all; - } - - .foot{ - font-family:Arial; - font-size:14px; - text-decoration:none; - text-align:left; - padding: 0.5em 0em 0.5em 0.5em; - border-top: 1px solid #cccccc; - color:#777; - } - - </style> - - <!-- Targeting Windows Mobile --> - <!--[if IEMobile 7]> - <style type="text/css"> - - </style> - <![endif]--> - - <!-- *********************************************** - **************************************************** - END MOBILE TARGETING - **************************************************** - ************************************************ --> - - <!--[if gte mso 9]> - <style> - /* Target Outlook 2007 and 2010 */ - </style> - <![endif]--> + ************************************************ --> + + <!--[if gte mso 9]> + <style> + /* Target Outlook 2007 and 2010 */ + </style> + <![endif]--> </head> <body> <!-- Wrapper/Container Table: Use a wrapper table to control the width and the background color consistently of your email. Use this approach instead of setting attributes on the body tag. --> <table cellpadding="0" cellspacing="0" border="0" id="backgroundTable"> - <tr> - <td valign="top" style="padding-left: 10px"> + <tr> + <td valign="top" style="padding-left: 10px"> http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/resources/log4j.properties ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-common/src/test/resources/log4j.properties b/eagle-core/eagle-common/src/test/resources/log4j.properties index 5a5709e..a9ca14f 100644 --- a/eagle-core/eagle-common/src/test/resources/log4j.properties +++ b/eagle-core/eagle-common/src/test/resources/log4j.properties @@ -12,16 +12,13 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - log4j.rootLogger=INFO, DRFA, stdout eagle.log.dir=./logs eagle.log.file=eagle.log - # standard output log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %p [%t] %c{2}[%L]: %m%n - # Daily Rolling File Appender log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender log4j.appender.DRFA.File=${eagle.log.dir}/${eagle.log.file} @@ -29,6 +26,5 @@ log4j.appender.DRFA.DatePattern=.yyyy-MM-dd # 30-day backup #log4j.appender.DRFA.MaxBackupIndex=30 log4j.appender.DRFA.layout=org.apache.log4j.PatternLayout - # Pattern format: Date LogLevel LoggerName LogMessage log4j.appender.DRFA.layout.ConversionPattern=%d{ISO8601} %p [%t] %c{2}[%L]: %m%n http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/resources/templates/tec_alert.vm ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-common/src/test/resources/templates/tec_alert.vm b/eagle-core/eagle-common/src/test/resources/templates/tec_alert.vm index 2219ebf..a74dfbc 100755 --- a/eagle-core/eagle-common/src/test/resources/templates/tec_alert.vm +++ b/eagle-core/eagle-common/src/test/resources/templates/tec_alert.vm @@ -18,102 +18,103 @@ *# #parse("header.vm") <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" style=""> - <tr> - <td class="head" width="800"> - <span style="color: #091D42">Eagle Service <small style="color: #999999;">$startTime ~ $endTime</small></span> - </td> - </tr> - <tr> - <td class="head2" width="800"> + <tr> + <td class="head" width="800"> + <span style="color: #091D42">Eagle Service <small style="color: #999999;">$startTime + ~ $endTime</small></span> + </td> + </tr> + <tr> + <td class="head2" width="800"> <span> Statistics </span> - </td> - </tr> - <tr> - <td valign="top" style="padding: 0.5em 0em 0.5em 0em;"> - <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border"> - <thead> - <tr> - <th class="table-border-th" style="width: 25%">type</th> - <th class="table-border-th" style="width: 25%">count</th> - <th class="table-border-th" style="width: 25%">type</th> - <th class="table-border-th" style="width: 25%">count</th> - </tr> - </thead> - <tbody> - #foreach($key in $statistics.keySet()) - #if( $foreach.count % 2 == 1 ) - <tr> - #end - <td class="table-border-td">$key</td> - <td class="table-border-td">$statistics.get($key)</td> - #if( $foreach.count % 2 == 0) - </tr> - #end - #if( $foreach.count % 2 == 1 && !$foreach.hasNext ) - <td class="table-border-td"></td> - <td class="table-border-td"></td> - </tr> - #end - #end - </tbody> - </table> - </td> - </tr> - <tr> - <td class="head2" width="800"> + </td> + </tr> + <tr> + <td valign="top" style="padding: 0.5em 0em 0.5em 0em;"> + <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border"> + <thead> + <tr> + <th class="table-border-th" style="width: 25%">type</th> + <th class="table-border-th" style="width: 25%">count</th> + <th class="table-border-th" style="width: 25%">type</th> + <th class="table-border-th" style="width: 25%">count</th> + </tr> + </thead> + <tbody> + #foreach($key in $statistics.keySet()) + #if( $foreach.count % 2 == 1 ) + <tr> + #end + <td class="table-border-td">$key</td> + <td class="table-border-td">$statistics.get($key)</td> + #if( $foreach.count % 2 == 0) + </tr> + #end + #if( $foreach.count % 2 == 1 && !$foreach.hasNext ) + <td class="table-border-td"></td> + <td class="table-border-td"></td> + </tr> + #end + #end + </tbody> + </table> + </td> + </tr> + <tr> + <td class="head2" width="800"> <span> Detail Info </span> - </td> - </tr> - <tr> - <td class="info" width="800"> + </td> + </tr> + <tr> + <td class="info" width="800"> <span> These are the alerts that we can not find its hostname. </span> - </td> - </tr> - <tr> - <td valign="top" style="padding: 0.5em 0em 0.5em 0em;"> - <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border"> - <thead> - <tr> - <th class="table-border-th">hostname</th> - <th class="table-border-th">date_reception</th> - <th class="table-border-th">type</th> - <th class="table-border-th">origin</th> - <th class="table-border-th">msg</th> - </tr> - </thead> - <tbody> - #foreach($entry in $noHostnameItems) - <tr> - <td class="table-border-td">$entry.hostname</td> - <td class="table-border-td">$entry.date_reception</td> - <td class="table-border-td">$entry.type</td> - <td class="table-border-td">$entry.origin</td> - <td class="table-border-td">$entry.msg</td> - </tr> - #end - </tbody> - </table> - </td> - </tr> + </td> + </tr> + <tr> + <td valign="top" style="padding: 0.5em 0em 0.5em 0em;"> + <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border"> + <thead> + <tr> + <th class="table-border-th">hostname</th> + <th class="table-border-th">date_reception</th> + <th class="table-border-th">type</th> + <th class="table-border-th">origin</th> + <th class="table-border-th">msg</th> + </tr> + </thead> + <tbody> + #foreach($entry in $noHostnameItems) + <tr> + <td class="table-border-td">$entry.hostname</td> + <td class="table-border-td">$entry.date_reception</td> + <td class="table-border-td">$entry.type</td> + <td class="table-border-td">$entry.origin</td> + <td class="table-border-td">$entry.msg</td> + </tr> + #end + </tbody> + </table> + </td> + </tr> <tr> <td> <img src="cid:$cid.get("chart.png")"/> </td> </tr> - <tr> - <td class="foot" width="800"> + <tr> + <td class="foot" width="800"> <span class="outlook"> Apache Eagle <a href="http://<Eagle-Host>:9090/eagle-web/ui/eagle.html" - target ="_blank" title="Hadoop Eagle">Apache Eagle</a> + target="_blank" title="Hadoop Eagle">Apache Eagle</a> </span> - </td> - </tr> + </td> + </tr> </table> #parse("footer.vm") \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/ca0fae40/eagle-core/eagle-common/src/test/resources/templates/test_anomaly_alert.vm ---------------------------------------------------------------------- diff --git a/eagle-core/eagle-common/src/test/resources/templates/test_anomaly_alert.vm b/eagle-core/eagle-common/src/test/resources/templates/test_anomaly_alert.vm index da1f8d0..8071682 100644 --- a/eagle-core/eagle-common/src/test/resources/templates/test_anomaly_alert.vm +++ b/eagle-core/eagle-common/src/test/resources/templates/test_anomaly_alert.vm @@ -18,118 +18,122 @@ *# #parse("header.vm") <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" style=""> - <tr> - <td class="head" width="800"> - <span style="color: #091D42">Eagle Job Anomaly Host Detection <small style="color: #999999;"><br>$startTime ~ $endTime</small></span> - </td> - </tr> - <tr> - <td class="head2" width="800"> + <tr> + <td class="head" width="800"> + <span style="color: #091D42">Eagle Job Anomaly Host Detection <small style="color: #999999;"><br>$startTime ~ $endTime</small></span> + </td> + </tr> + <tr> + <td class="head2" width="800"> <span> Statistics </span> - </td> - </tr> - <tr> - <td valign="top" style="padding: 0.5em 0em 0.5em 0em;"> - <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border"> - <thead> - <tr> - <th class="table-border-th" style="width: 25%">Cluster</th> - <th class="table-border-th" style="width: 25%">Datacener</th> - <th class="table-border-th" style="width: 25%">Count</th> - </tr> - </thead> - <tbody> - <tr> - <td class="table-border-td">$cluster</td> - <td class="table-border-td">$datacenter</td> - <td class="table-border-td">$count</td> - </tr> - </tbody> - </table> - </td> - </tr> - <tr> - <td class="head2" width="800"> + </td> + </tr> + <tr> + <td valign="top" style="padding: 0.5em 0em 0.5em 0em;"> + <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border"> + <thead> + <tr> + <th class="table-border-th" style="width: 25%">Cluster</th> + <th class="table-border-th" style="width: 25%">Datacener</th> + <th class="table-border-th" style="width: 25%">Count</th> + </tr> + </thead> + <tbody> + <tr> + <td class="table-border-td">$cluster</td> + <td class="table-border-td">$datacenter</td> + <td class="table-border-td">$count</td> + </tr> + </tbody> + </table> + </td> + </tr> + <tr> + <td class="head2" width="800"> <span> Anomaly detector configurations </span> - </td> - </tr> - <tr> - <td valign="top" style="padding: 0.5em 0em 0.5em 0em;"> - <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border"> - <thead> - <tr> - <th class="table-border-th" style="width: 25%">Parameter Name</th> - <th class="table-border-th" style="width: 25%">Value</th> - <th class="table-border-th" style="width: 25%">Description</th> - </tr> - </thead> - <tbody> - #foreach($key in $configMap.keySet()) - <tr> - <td class="table-border-td">$key</td> - <td class="table-border-td">$configMap.get($key)</td> - <td class="table-border-td">$configDescMap.get($key)</td> - </tr> - #end - </tbody> - </table> - </td> - </tr> - <tr> - <td class="head2" width="800"> + </td> + </tr> + <tr> + <td valign="top" style="padding: 0.5em 0em 0.5em 0em;"> + <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border"> + <thead> + <tr> + <th class="table-border-th" style="width: 25%">Parameter Name</th> + <th class="table-border-th" style="width: 25%">Value</th> + <th class="table-border-th" style="width: 25%">Description</th> + </tr> + </thead> + <tbody> + #foreach($key in $configMap.keySet()) + <tr> + <td class="table-border-td">$key</td> + <td class="table-border-td">$configMap.get($key)</td> + <td class="table-border-td">$configDescMap.get($key)</td> + </tr> + #end + </tbody> + </table> + </td> + </tr> + <tr> + <td class="head2" width="800"> <span> Detail Information </span> - </td> - </tr> - <tr> - <td class="info" width="800"> + </td> + </tr> + <tr> + <td class="info" width="800"> <span> These are the anomaly hosts detected by Hadoop Eagle: </span> - </td> - </tr> - <tr> - <td valign="top" style="padding: 0.5em 0em 0.5em 0em;"> - <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border"> - <thead> - <tr> - <th class="table-border-th">Cluster</th> - <th class="table-border-th">Datacenter</th> - <th class="table-border-th">Hostname</th> - <th class="table-border-th">Description</th> - <th class="table-border-th">Job Types</th> - <th class="table-border-th">Errors</th> - </tr> - </thead> - <tbody> - #foreach($key in $anomalyHostMap.keySet()) - <tr> - <td class="table-border-td">$cluster</td> - <td class="table-border-td">$datacenter</td> - <td class="table-border-td"><a href="http://123.dc1.xyz.com:9090/eagle-web/ui/AnomalyDetection.html?cluster=$cluster&datacenter=$datacenter&intervalmin=1&startTime=$startTime&endTime=$endTime&top=20">$key</a></td> - <td class="table-border-td">$anomalyHostMap.get($key)</td> - <td class="table-border-td">$jobNameMap.get($key)</td> - <td class="table-border-td"><a href="http://hadoop-eagle.vip.dc1.xyz.com/eagle-service/rest/list?query=TaskExecutionService[@cluster=%22$cluster%22%20AND%20@datacenter=%22$datacenter%22%20AND%20@hostname=%22$key%22%20AND%20@taskStatus=%22FAILED%22]{@error,@jobID,@taskID,@normJobName}&pageSize=1000&startTime=$startTime&endTime=$endTime">$errorMap.get($key)</a></td> - </tr> - #end - </tbody> - </table> - </td> - </tr> - <br> - <tr> - <td class="foot" width="800"> + </td> + </tr> + <tr> + <td valign="top" style="padding: 0.5em 0em 0.5em 0em;"> + <table cellpadding="0" cellspacing="0" border="0" align="left" width="800" class="table-border"> + <thead> + <tr> + <th class="table-border-th">Cluster</th> + <th class="table-border-th">Datacenter</th> + <th class="table-border-th">Hostname</th> + <th class="table-border-th">Description</th> + <th class="table-border-th">Job Types</th> + <th class="table-border-th">Errors</th> + </tr> + </thead> + <tbody> + #foreach($key in $anomalyHostMap.keySet()) + <tr> + <td class="table-border-td">$cluster</td> + <td class="table-border-td">$datacenter</td> + <td class="table-border-td"><a + href="http://123.dc1.xyz.com:9090/eagle-web/ui/AnomalyDetection.html?cluster=$cluster&datacenter=$datacenter&intervalmin=1&startTime=$startTime&endTime=$endTime&top=20">$key</a> + </td> + <td class="table-border-td">$anomalyHostMap.get($key)</td> + <td class="table-border-td">$jobNameMap.get($key)</td> + <td class="table-border-td"><a + href="http://hadoop-eagle.vip.dc1.xyz.com/eagle-service/rest/list?query=TaskExecutionService[@cluster=%22$cluster%22%20AND%20@datacenter=%22$datacenter%22%20AND%20@hostname=%22$key%22%20AND%20@taskStatus=%22FAILED%22]{@error,@jobID,@taskID,@normJobName}&pageSize=1000&startTime=$startTime&endTime=$endTime">$errorMap.get($key)</a> + </td> + </tr> + #end + </tbody> + </table> + </td> + </tr> + <br> + <tr> + <td class="foot" width="800"> <span class="outlook"> Apache Eagle <a href="http://hadoop-eagle.vip.dc1.xyz.com" - target ="_blank" title="Hadoop Eagle">Apache Eagle</a> + target="_blank" title="Hadoop Eagle">Apache Eagle</a> </span> - </td> - </tr> + </td> + </tr> </table> <br> <br>