Skip to content

Commit

Permalink
fix last report null problem
Browse files Browse the repository at this point in the history
  • Loading branch information
youyong205 committed Jan 2, 2015
1 parent 3a1344a commit 0cd61bf
Show file tree
Hide file tree
Showing 12 changed files with 345 additions and 341 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ private TopReport queryTopReport(Payload payload) {
if (m_topService.isEligable(request)) {
ModelResponse<TopReport> response = m_topService.invoke(request);
TopReport report = response.getModel();

if (report == null || report.getDomains().size() == 0) {
report = m_reportService.queryTopReport(domain, new Date(payload.getDate()), new Date(payload.getDate()
+ TimeHelper.ONE_HOUR));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public LocalCrossService() {
protected CrossReport getReport(ModelRequest request, ModelPeriod period, String domain) throws Exception {
CrossReport report = super.getReport(request, period, domain);

if (report == null && period.isLast()) {
if ((report == null || report.getIps().isEmpty()) && period.isLast()) {
long startTime = request.getStartTime();
report = getReportFromLocalDisk(startTime, domain);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public LocalDependencyService() {
protected DependencyReport getReport(ModelRequest request, ModelPeriod period, String domain) throws Exception {
DependencyReport report = super.getReport(request, period, domain);

if (report == null && period.isLast()) {
if ((report == null || report.getDomainNames().isEmpty()) && period.isLast()) {
long startTime = request.getStartTime();
report = getReportFromLocalDisk(startTime, domain);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public LocalEventService() {
protected EventReport getReport(ModelRequest request, ModelPeriod period, String domain) throws Exception {
EventReport report = super.getReport(request, period, domain);

if (report == null && period.isLast()) {
if ((report == null || report.getIps().isEmpty()) && period.isLast()) {
long startTime = request.getStartTime();
report = getReportFromLocalDisk(startTime, domain);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public LocalHeartbeatService() {
protected HeartbeatReport getReport(ModelRequest request, ModelPeriod period, String domain) throws Exception {
HeartbeatReport report = super.getReport(request, period, domain);

if (report == null && period.isLast()) {
if ((report == null || report.getIps().isEmpty()) && period.isLast()) {
long startTime = request.getStartTime();
report = getReportFromLocalDisk(startTime, domain);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public LocalMatrixService() {
protected MatrixReport getReport(ModelRequest request, ModelPeriod period, String domain) throws Exception {
MatrixReport report = super.getReport(request, period, domain);

if (report == null && period.isLast()) {
if ((report == null || report.getDomainNames().isEmpty()) && period.isLast()) {
long startTime = request.getStartTime();
report = getReportFromLocalDisk(startTime, domain);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public LocalMetricService() {
protected MetricReport getReport(ModelRequest request, ModelPeriod period, String domain) throws Exception {
MetricReport report = super.getReport(request, period, domain);

if (report == null && period.isLast()) {
if ((report == null || report.getMetricItems().isEmpty()) && period.isLast()) {
long startTime = request.getStartTime();
report = getReportFromLocalDisk(startTime, domain);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public LocalProblemService() {
protected ProblemReport getReport(ModelRequest request, ModelPeriod period, String domain) throws Exception {
ProblemReport report = super.getReport(request, period, domain);

if (report == null && period.isLast()) {
if ((report == null || report.getIps().isEmpty()) && period.isLast()) {
long startTime = request.getStartTime();
report = getReportFromLocalDisk(startTime, domain);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public LocalStateService() {
protected StateReport getReport(ModelRequest request, ModelPeriod period, String domain) throws Exception {
StateReport report = super.getReport(request, period, domain);

if (report == null && period.isLast()) {
if ((report == null || report.getMachines().isEmpty()) && period.isLast()) {
long startTime = request.getStartTime();
report = getReportFromLocalDisk(startTime, domain);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public LocalTopService() {
protected TopReport getReport(ModelRequest request, ModelPeriod period, String domain) throws Exception {
TopReport report = super.getReport(request, period, domain);

if (report == null && period.isLast()) {
if ((report == null || report.getDomains().isEmpty()) && period.isLast()) {
long startTime = request.getStartTime();
report = getReportFromLocalDisk(startTime, domain);

if (report == null) {
report = new TopReport(domain);
report.setStartTime(new Date(startTime));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public LocalTransactionService() {
protected TransactionReport getReport(ModelRequest request, ModelPeriod period, String domain) throws Exception {
TransactionReport report = super.getReport(request, period, domain);

if (report == null && period.isLast()) {
if ((report == null || report.getIps().isEmpty()) && period.isLast()) {
long startTime = request.getStartTime();
report = getReportFromLocalDisk(startTime, domain);
}
Expand Down
Loading

0 comments on commit 0cd61bf

Please sign in to comment.