-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.navercorp.pinpoint.web.applicationmap.view; | ||
|
||
import com.navercorp.pinpoint.common.server.util.json.JsonFields; | ||
import com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram; | ||
import com.navercorp.pinpoint.web.applicationmap.histogram.Histogram; | ||
import com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram; | ||
import com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogramFormat; | ||
import com.navercorp.pinpoint.web.applicationmap.nodes.NodeHistogramSummary; | ||
import com.navercorp.pinpoint.web.applicationmap.nodes.ServerGroupList; | ||
import com.navercorp.pinpoint.web.view.TimeViewModel; | ||
import com.navercorp.pinpoint.web.view.id.AgentNameView; | ||
import com.navercorp.pinpoint.web.vo.ResponseTimeStatics; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
public class NodeHistogramSummaryView { | ||
|
||
private final NodeHistogramSummary nodeHistogramSummary; | ||
private final NodeHistogram nodeHistogram; | ||
private final TimeHistogramFormat format; | ||
|
||
private final ServerGroupList serverGroupList; | ||
|
||
public NodeHistogramSummaryView(NodeHistogramSummary nodeHistogramSummary, ServerGroupList serverGroupList, TimeHistogramFormat format) { | ||
this.nodeHistogramSummary = Objects.requireNonNull(nodeHistogramSummary, "nodeHistogramSummary"); | ||
this.nodeHistogram = nodeHistogramSummary.getNodeHistogram(); | ||
Check warning on line 28 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java Codecov / codecov/patchweb/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L26-L28
|
||
|
||
this.serverGroupList = Objects.requireNonNull(serverGroupList, "serverGroupList"); | ||
Check warning on line 30 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java Codecov / codecov/patchweb/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L30
|
||
|
||
this.format = Objects.requireNonNull(format, "format"); | ||
} | ||
Check warning on line 33 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java Codecov / codecov/patchweb/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L32-L33
|
||
|
||
public long getCurrentServerTime() { | ||
return System.currentTimeMillis(); | ||
Check warning on line 36 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java Codecov / codecov/patchweb/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L36
|
||
} | ||
|
||
public ServerGroupList getServerList() { | ||
return serverGroupList; | ||
Check warning on line 40 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java Codecov / codecov/patchweb/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L40
|
||
} | ||
|
||
public ResponseTimeStatics getResponseStatistics() { | ||
return ResponseTimeStatics.fromHistogram(nodeHistogram.getApplicationHistogram()); | ||
Check warning on line 44 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java Codecov / codecov/patchweb/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L44
|
||
} | ||
|
||
public Histogram getHistogram() { | ||
return nodeHistogram.getApplicationHistogram(); | ||
Check warning on line 48 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java Codecov / codecov/patchweb/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L48
|
||
} | ||
|
||
public Map<String, Histogram> getAgentHistogram() { | ||
return nodeHistogram.getAgentHistogramMap(); | ||
Check warning on line 52 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java Codecov / codecov/patchweb/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L52
|
||
} | ||
|
||
public Map<String, ResponseTimeStatics> getAgentResponseStatistics() { | ||
return nodeHistogram.getAgentResponseStatisticsMap(); | ||
Check warning on line 56 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java Codecov / codecov/patchweb/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L56
|
||
} | ||
|
||
|
||
public List<TimeViewModel> getTimeSeriesHistogram() { | ||
ApplicationTimeHistogram applicationTimeHistogram = nodeHistogramSummary.getApplicationTimeHistogram(); | ||
Check warning on line 61 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java Codecov / codecov/patchweb/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L61
|
||
if (applicationTimeHistogram == null) { | ||
return List.of(); | ||
Check warning on line 63 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java Codecov / codecov/patchweb/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L63
|
||
} | ||
return applicationTimeHistogram.createViewModel(format); | ||
Check warning on line 65 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java Codecov / codecov/patchweb/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L65
|
||
} | ||
|
||
public JsonFields<AgentNameView, List<TimeViewModel>> getAgentTimeSeriesHistogram() { | ||
return nodeHistogram.getAgentTimeHistogram().createViewModel(format); | ||
Check warning on line 69 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java Codecov / codecov/patchweb/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L69
|
||
} | ||
} | ||
|