-
Notifications
You must be signed in to change notification settings - Fork 210
gcPauses -> jvm.gc.pause, memory -> jvm.memory.used #875
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,10 @@ | |
*/ | ||
public class SpringProcessConnectorService { | ||
|
||
private static final String METRICS = "metrics"; | ||
public static final String GC_PAUSES = "gcPauses"; | ||
public static final String MEMORY = "memory"; | ||
|
||
private static final Logger log = LoggerFactory.getLogger(SpringProcessConnectorService.class); | ||
|
||
private final SpringProcessLiveDataProvider liveDataProvider; | ||
|
@@ -171,8 +175,8 @@ private void scheduleConnect(ProgressTask progressTask, String processKey, Sprin | |
progressTask.progressDone(); | ||
|
||
refreshProcess(new SpringProcessParams(processKey, "", "", "")); | ||
refreshProcess(new SpringProcessParams(processKey, "metrics", "memory", "area:heap")); | ||
refreshProcess(new SpringProcessParams(processKey, "metrics", "gcPauses", "")); | ||
refreshProcess(new SpringProcessParams(processKey, METRICS, MEMORY, "area:heap")); | ||
refreshProcess(new SpringProcessParams(processKey, METRICS, GC_PAUSES, "")); | ||
} | ||
catch (Exception e) { | ||
log.info("problem occured during process connect", e); | ||
|
@@ -232,7 +236,7 @@ private void scheduleRefresh(ProgressTask progressTask, SpringProcessParams spri | |
|
||
try { | ||
progressTask.progressEvent(progressMessage); | ||
if(endpoint.equals("metrics") && metricName.equals("memory")) { | ||
if(METRICS.equals(endpoint) && MEMORY.equals(metricName)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The The getMemoryMetrics function is where the metric names ("jvm.memory.used, jvm.memory.max") are passed. Also, with the current implementation, the retrieveLiveMemoryMetricsData has the logic to fetch the heap and non-heap memory metrics together. |
||
SpringProcessMemoryMetricsLiveData newMetricsLiveData = connector.refreshMemoryMetrics(this.liveDataProvider.getCurrent(processKey), metricName, springProcessParams.getTags()); | ||
|
||
if (newMetricsLiveData != null) { | ||
|
@@ -243,7 +247,7 @@ private void scheduleRefresh(ProgressTask progressTask, SpringProcessParams spri | |
this.connectedSuccess.put(processKey, true); | ||
} | ||
|
||
} else if(endpoint.equals("metrics") && metricName.equals("gcPauses")) { | ||
} else if(METRICS.equals(endpoint) && GC_PAUSES.equals(metricName)) { | ||
SpringProcessGcPausesMetricsLiveData newMetricsLiveData = connector.refreshGcPausesMetrics(this.liveDataProvider.getCurrent(processKey), metricName, springProcessParams.getTags()); | ||
|
||
if (newMetricsLiveData != null) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
metricName
passed here are ("gcPauses", "heapMemory", "nonHeapMemory"). This is used to fetch the region-specific metric data separately.(This is the result of my bad naming convention again ;-) )
@BoykoAlex I would like to discuss and get your feedback on how to improve this.