提交 764e676c 编写于 作者: Y yong.you

merge the code and fix confict

biz @ dbcbe7e1
Subproject commit dbcbe7e175f7bec0b0d123cdd75f3281bf444794
......@@ -3,6 +3,7 @@ package com.dianping.cat.consumer.state;
import java.util.Date;
import java.util.Map;
import java.util.Map.Entry;
import java.util.concurrent.atomic.AtomicLong;
import org.codehaus.plexus.logging.LogEnabled;
import org.codehaus.plexus.logging.Logger;
......@@ -13,6 +14,7 @@ import com.dianping.cat.analysis.AbstractMessageAnalyzer;
import com.dianping.cat.configuration.NetworkInterfaceManager;
import com.dianping.cat.consumer.state.model.entity.Detail;
import com.dianping.cat.consumer.state.model.entity.Machine;
import com.dianping.cat.consumer.state.model.entity.Message;
import com.dianping.cat.consumer.state.model.entity.ProcessDomain;
import com.dianping.cat.consumer.state.model.entity.StateReport;
import com.dianping.cat.core.dal.Hostinfo;
......@@ -43,18 +45,19 @@ public class StateAnalyzer extends AbstractMessageAnalyzer<StateReport> implemen
if (end > System.currentTimeMillis()) {
end = System.currentTimeMillis();
}
int size = 0;
double maxTps = 0;
for (; start < end; start += minute) {
size++;
Statistic state = m_serverStateManager.findState(start);
Message temp = machine.findOrCreateMessage(start);
com.dianping.cat.consumer.state.model.entity.Message temp = machine.findOrCreateMessage(start);
Map<String, Long> totals = state.getMessageTotals();
Map<String, AtomicLong> totals = state.getMessageTotals();
long messageTotal = state.getMessageTotal();
temp.setTotal(messageTotal);
Map<String, Long> totalLosses = state.getMessageTotalLosses();
Map<String, AtomicLong> totalLosses = state.getMessageTotalLosses();
long messageTotalLoss = state.getMessageTotalLoss();
temp.setTotalLoss(messageTotalLoss);
......@@ -66,9 +69,9 @@ public class StateAnalyzer extends AbstractMessageAnalyzer<StateReport> implemen
machine.setTotalLoss(messageTotalLoss + machine.getTotalLoss());
machine.setSize(messageSize + machine.getSize());
for (Entry<String, Long> entry : totals.entrySet()) {
for (Entry<String, AtomicLong> entry : totals.entrySet()) {
String key = entry.getKey();
long value = entry.getValue();
long value = entry.getValue().get();
ProcessDomain domain = machine.findOrCreateProcessDomain(key);
Detail detail = domain.findOrCreateDetail(start);
if (totals.containsKey(key)) {
......@@ -76,8 +79,8 @@ public class StateAnalyzer extends AbstractMessageAnalyzer<StateReport> implemen
detail.setTotal(value);
}
if (totalLosses.containsKey(key)) {
domain.setTotalLoss(totalLosses.get(key) + domain.getTotalLoss());
detail.setTotalLoss(totalLosses.get(key));
domain.setTotalLoss(totalLosses.get(key).get() + domain.getTotalLoss());
detail.setTotalLoss(totalLosses.get(key).get());
}
if (sizes.containsKey(key)) {
domain.setSize(sizes.get(key) + domain.getSize());
......@@ -128,11 +131,14 @@ public class StateAnalyzer extends AbstractMessageAnalyzer<StateReport> implemen
double sum = machine.getDelaySum();
long count = machine.getDelayCount();
double avg = 0;
if (count > 0) {
avg = sum / count;
machine.setDelayAvg(avg);
}
temp.setTime(new Date(start));
size++;
}
double avgTps = 0;
......@@ -174,6 +180,7 @@ public class StateAnalyzer extends AbstractMessageAnalyzer<StateReport> implemen
@Override
public StateReport getReport(String domain) {
StateReport report = new StateReport(domain);
report = new StateReport(ReportConstants.CAT);
report.setStartTime(new Date(m_startTime));
report.setEndTime(new Date(m_startTime + MINUTE * 60 - 1));
......@@ -213,7 +220,7 @@ public class StateAnalyzer extends AbstractMessageAnalyzer<StateReport> implemen
m_domainManager.insert(domain, ip);
} else if (!ipInfo.getIp().equals(ip)) {
String localIp = NetworkInterfaceManager.INSTANCE.getLocalHostAddress();
// only work on online enviroment
// only work on online environment
if (localIp.startsWith("10.")) {
long current = System.currentTimeMillis();
long lastModifyTime = ipInfo.getLastModifiedDate().getTime();
......
......@@ -3,9 +3,10 @@ package com.dianping.cat.statistic;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;
public class ServerStatistic {
private Map<Long, Statistic> m_statistics = new LinkedHashMap<Long, Statistic>(60);
private Map<Long, Statistic> m_statistics = new LinkedHashMap<Long, Statistic>(100);
public Statistic findOrCreate(Long time) {
Statistic state = m_statistics.get(time);
......@@ -33,9 +34,9 @@ public class ServerStatistic {
private long m_messageDumpLoss;
private Map<String, Long> m_messageTotals = new HashMap<String, Long>(256);
private Map<String, AtomicLong> m_messageTotals = new HashMap<String, AtomicLong>(256);
private Map<String, Long> m_messageTotalLosses = new HashMap<String, Long>(256);
private Map<String, AtomicLong> m_messageTotalLosses = new HashMap<String, AtomicLong>(256);
private Map<String, Double> m_messageSizes = new HashMap<String, Double>(256);
......@@ -82,20 +83,20 @@ public class ServerStatistic {
}
public void addMessageTotal(String domain, long messageTotal) {
Long value = m_messageTotals.get(domain);
AtomicLong value = m_messageTotals.get(domain);
if (value != null) {
m_messageTotals.put(domain, value + messageTotal);
value.set(value.get()+messageTotal);
} else {
m_messageTotals.put(domain, messageTotal);
m_messageTotals.put(domain, new AtomicLong(messageTotal));
}
}
public void addMessageTotalLoss(String domain, long messageTotalLoss) {
Long value = m_messageTotalLosses.get(domain);
AtomicLong value = m_messageTotalLosses.get(domain);
if (value != null) {
m_messageTotalLosses.put(domain, value + messageTotalLoss);
value.set(value.get()+messageTotalLoss);
} else {
m_messageTotalLosses.put(domain, messageTotalLoss);
m_messageTotalLosses.put(domain, new AtomicLong(messageTotalLoss));
}
}
......@@ -164,11 +165,11 @@ public class ServerStatistic {
return m_messageSizes;
}
public Map<String, Long> getMessageTotals() {
public Map<String, AtomicLong> getMessageTotals() {
return m_messageTotals;
}
public Map<String, Long> getMessageTotalLosses() {
public Map<String, AtomicLong> getMessageTotalLosses() {
return m_messageTotalLosses;
}
......
......@@ -6,99 +6,83 @@ public class ServerStatisticManager {
public ServerStatistic m_serverState = new ServerStatistic();
public void addBlockTotal(long total) {
Long time = getCurrentMinute();
private Statistic m_currentStatistic = null;
private long m_currentMunite = -1;
m_serverState.findOrCreate(time).addBlockTotal(total);
public void addBlockTotal(long total) {
getCurrentStatistic().addBlockTotal(total);
}
public void addBlockLoss(long total) {
Long time = getCurrentMinute();
m_serverState.findOrCreate(time).addBlockLoss(total);
getCurrentStatistic().addBlockLoss(total);
}
public void addBlockTime(long total) {
Long time = getCurrentMinute();
m_serverState.findOrCreate(time).addBlockTime(total);
getCurrentStatistic().addBlockTime(total);
}
public void addPigeonTimeError(long total) {
Long time = getCurrentMinute();
m_serverState.findOrCreate(time).addPigeonTimeError(total);
getCurrentStatistic().addPigeonTimeError(total);
}
public void addMessageDump(long total) {
Long time = getCurrentMinute();
m_serverState.findOrCreate(time).addMessageDump(total);
getCurrentStatistic().addMessageDump(total);
}
public void addNetworkTimeError(long total) {
Long time = getCurrentMinute();
m_serverState.findOrCreate(time).addNetworkTimeError(total);
getCurrentStatistic().addNetworkTimeError(total);
}
public void addMessageDumpLoss(long total) {
Long time = getCurrentMinute();
m_serverState.findOrCreate(time).addMessageDumpLoss(total);
getCurrentStatistic().addMessageDumpLoss(total);
}
public void addMessageSize(String domain, double size) {
Long time = getCurrentMinute();
m_serverState.findOrCreate(time).addMessageSize(domain, size);
addMessageSize(size);
getCurrentStatistic().addMessageSize(domain, size);
}
public void addMessageSize(double size) {
Long time = getCurrentMinute();
m_serverState.findOrCreate(time).addMessageSize(size);
public void addMessageSize(double size) {
getCurrentStatistic().addMessageSize(size);
}
public void addMessageTotal(String domain, long total) {
Long time = getCurrentMinute();
m_serverState.findOrCreate(time).addMessageTotal(domain, total);
getCurrentStatistic().addMessageTotal(domain, total);
}
public void addMessageTotal(long total) {
Long time = getCurrentMinute();
m_serverState.findOrCreate(time).addMessageTotal(total);
getCurrentStatistic().addMessageTotal(total);
}
public void addMessageTotalLoss(String domain, long total) {
Long time = getCurrentMinute();
m_serverState.findOrCreate(time).addMessageTotalLoss(domain, total);
addMessageTotalLoss(total);
getCurrentStatistic().addMessageTotalLoss(domain, total);
}
public void addMessageTotalLoss(long total) {
Long time = getCurrentMinute();
m_serverState.findOrCreate(time).addMessageTotalLoss(total);
getCurrentStatistic().addMessageTotalLoss(total);
}
public void addProcessDelay(double delay) {
Long time = getCurrentMinute();
m_serverState.findOrCreate(time).addProcessDelay(delay);
getCurrentStatistic().addProcessDelay(delay);
}
public Statistic findState(long time) {
return m_serverState.findOrCreate(time);
}
public Long getCurrentMinute() {
private Statistic getCurrentStatistic() {
long time = System.currentTimeMillis();
return time - time % (60 * 1000);
time = time - time % (60 * 1000);
synchronized(this){
if (time != m_currentMunite) {
m_currentMunite = time;
m_currentStatistic = m_serverState.findOrCreate(time);
}
}
return m_currentStatistic;
}
public void removeState(long time) {
......
......@@ -376,6 +376,7 @@ public class LocalMessageBucketManager extends ContainerHolder implements Messag
double amount = totalSize - lastTotalSize;
m_lastTotalSizes.put(domain, totalSize);
m_serverStateManager.addMessageSize(domain, amount);
m_serverStateManager.addMessageSize(amount);
}
}
......
......@@ -23,6 +23,7 @@ import com.dianping.cat.home.utilization.entity.UtilizationReport;
import com.dianping.cat.message.Event;
import com.dianping.cat.report.service.AbstractReportService;
import com.dianping.cat.report.task.utilization.UtilizationReportMerger;
import com.dianping.cat.service.ReportConstants;
public class UtilizationReportService extends AbstractReportService<UtilizationReport> {
......@@ -49,14 +50,13 @@ public class UtilizationReportService extends AbstractReportService<UtilizationR
UtilizationReportMerger merger = new UtilizationReportMerger(new UtilizationReport(domain));
long startTime = start.getTime();
long endTime = end.getTime();
String name = "utilization";
String name = ReportConstants.REPORT_UTILIZATION;
for (; startTime < endTime; startTime = startTime + TimeUtil.ONE_DAY) {
try {
DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
DailyReportEntity.READSET_FULL);
String xml = report.getContent();
UtilizationReport reportModel = com.dianping.cat.home.utilization.transform.DefaultSaxParser.parse(xml);
reportModel.accept(merger);
} catch (Exception e) {
......
......@@ -18,8 +18,6 @@
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&tab=tab1">Machine Number</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&sort=urlCount&tab=tab1">URL Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&sort=urlResponse&tab=tab1">URL Response Time</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&sort=serviceCount&tab=tab1">Service Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&sort=serviceResponse&tab=tab1">Service Response Time</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&sort=sqlCount&tab=tab1">SQL Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&sort=pigeonCallCount&tab=tab1">Pigeon Call Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&sort=swallowCallCount&tab=tab1">Swallow Call Count</th>
......@@ -33,8 +31,6 @@
<td style="text-align:right">${item.machineNumber}</td>
<td style="text-align:right">${w:format(item.urlCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.urlResponseTime,'0.0')}</td>
<td style="text-align:right">${w:format(item.serviceCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.serviceResponseTime,'0.0')}</td>
<td style="text-align:right">${w:format(item.sqlCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.pigeonCallCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.swallowCallCount,'#,###,###,###,##0')}</td>
......@@ -51,8 +47,6 @@
<tr>
<th class="left">id</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&tab=tab2">Machine Number</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&sort=urlCount&tab=tab2">URL Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&sort=urlResponse&tab=tab2">URL Response Time</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&sort=serviceCount&tab=tab2">Service Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&sort=serviceResponse&tab=tab2">Service Response Time</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=utilization&sort=sqlCount&tab=tab2">SQL Count</th>
......@@ -66,8 +60,6 @@
<tr class="${status.index mod 2 != 0 ? 'odd' : 'even'}">
<td>${item.id}</td>
<td style="text-align:right">${item.machineNumber}</td>
<td style="text-align:right">${w:format(item.urlCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.urlResponseTime,'0.0')}</td>
<td style="text-align:right">${w:format(item.serviceCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.serviceResponseTime,'0.0')}</td>
<td style="text-align:right">${w:format(item.sqlCount,'#,###,###,###,##0')}</td>
......
......@@ -56,16 +56,14 @@
<table class="table table-striped table-bordered table-condensed">
<tr>
<th class="left">id</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&tab=tab1">Machine Number</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=urlCount&tab=tab1">URL Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=urlResponse&tab=tab1">URL Response Time</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=serviceCount&tab=tab1">Service Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=serviceResponse&tab=tab1">Service Response Time</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=sqlCount&tab=tab1">SQL Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=pigeonCallCount&tab=tab1">Pigeon Call Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=swallowCallCount&tab=tab1">Swallow Call Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=memcacheCount&tab=tab1">Memcache Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=webScore&tab=tab1">Web Score</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&tab=tab1">Machine Number</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=urlCount&tab=tab1">URL Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=urlResponse&tab=tab1">URL Response Time</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=sqlCount&tab=tab1">SQL Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=pigeonCallCount&tab=tab1">Pigeon Call Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=swallowCallCount&tab=tab1">Swallow Call Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=memcacheCount&tab=tab1">Memcache Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=webScore&tab=tab1">Web Score</th>
</tr>
<c:forEach var="item" items="${model.utilizationWebList}" varStatus="status">
......@@ -74,8 +72,6 @@
<td style="text-align:right">${item.machineNumber}</td>
<td style="text-align:right">${w:format(item.urlCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.urlResponseTime,'0.0')}</td>
<td style="text-align:right">${w:format(item.serviceCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.serviceResponseTime,'0.0')}</td>
<td style="text-align:right">${w:format(item.sqlCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.pigeonCallCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.swallowCallCount,'#,###,###,###,##0')}</td>
......@@ -91,24 +87,20 @@
<table class="table table-striped table-bordered table-condensed">
<tr>
<th class="left">id</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&tab=tab2">Machine Number</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=urlCount&tab=tab2">URL Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=urlResponse&tab=tab2">URL Response Time</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=serviceCount&tab=tab2">Service Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=serviceResponse&tab=tab2">Service Response Time</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=sqlCount&tab=tab2">SQL Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=pigeonCallCount&tab=tab2">Pigeon Call Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=swallowCallCount&tab=tab2">Swallow Call Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=memcacheCount&tab=tab2">Memcache Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyHtilization&sort=serviceScore&tab=tab2">Service Score</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&tab=tab2">Machine Number</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=serviceCount&tab=tab2">Service Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=serviceResponse&tab=tab2">Service Response Time</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=sqlCount&tab=tab2">SQL Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=pigeonCallCount&tab=tab2">Pigeon Call Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=swallowCallCount&tab=tab2">Swallow Call Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=memcacheCount&tab=tab2">Memcache Count</th>
<th style="text-align:right"><a href="?domain=${model.domain}&date=${model.date}&ip=${model.ipAddress}&op=historyUtilization&sort=serviceScore&tab=tab2">Service Score</th>
</tr>
<c:forEach var="item" items="${model.utilizationServiceList}" varStatus="status">
<tr class="${status.index mod 2 != 0 ? 'odd' : 'even'}">
<td>${item.id}</td>
<td style="text-align:right">${item.machineNumber}</td>
<td style="text-align:right">${w:format(item.urlCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.urlResponseTime,'0.0')}</td>
<td style="text-align:right">${w:format(item.serviceCount,'#,###,###,###,##0')}</td>
<td style="text-align:right">${w:format(item.serviceResponseTime,'0.0')}</td>
<td style="text-align:right">${w:format(item.sqlCount,'#,###,###,###,##0')}</td>
......@@ -133,3 +125,13 @@
</table>
</div>
</a:body>
<script type="text/javascript">
$(document).ready(function() {
var tab = '${payload.tab}';
if(tab=='tab2'){
$('#tab2Href').trigger('click');
}else{
$('#tab1Href').trigger('click');
}
});
</script>
......@@ -18,7 +18,7 @@ public class UtilizationBuilderTest extends ComponentTestCase{
DomainManager manager = lookup(DomainManager.class);
manager.initialize();
builder.buildHourlyTask("utilization",CatString.CAT, new SimpleDateFormat("yyyyMMddHH").parse("2013082505"));
builder.buildHourlyTask("utilization",CatString.CAT, new SimpleDateFormat("yyyyMMddHH").parse("2013082617"));
}
@Test
......@@ -27,7 +27,7 @@ public class UtilizationBuilderTest extends ComponentTestCase{
DomainManager manager = lookup(DomainManager.class);
manager.initialize();
builder.buildDailyTask("utilization", CatString.CAT, new SimpleDateFormat("yyyyMMdd").parse("20130825"));
builder.buildDailyTask("utilization", CatString.CAT, new SimpleDateFormat("yyyyMMdd").parse("20130826"));
}
@Test
......
......@@ -349,6 +349,18 @@ CREATE TABLE `topologyGraph` (
KEY `period` (`period`)
) ENGINE=InnoDB AUTO_INCREMENT=21912 DEFAULT CHARSET=utf8 COMMENT='用于存储历史的拓扑图曲线';
CREATE TABLE `baseline` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`report_name` varchar(100) DEFAULT NULL,
`index_key` varchar(100) DEFAULT NULL,
`report_period` datetime DEFAULT NULL,
`data` blob,
`creation_date` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ix_indexkey_reportperiod` (`index_key`,`report_period`),
KEY `ix_reportperiod` (`report_period`)
) ENGINE=InnoDB AUTO_INCREMENT=5062 DEFAULT CHARSET=utf8
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册