[#333] feat: expose metrics of TOP10 app bytes in one shuffle server - #1400
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1400 +/- ##
============================================
+ Coverage 53.39% 55.16% +1.77%
- Complexity 2730 2773 +43
============================================
Files 422 403 -19
Lines 24052 21817 -2235
Branches 2051 2057 +6
============================================
- Hits 12842 12035 -807
+ Misses 10410 9044 -1366
+ Partials 800 738 -62 ☔ View full report in Codecov by Sentry. |
|
I think I will review this in the next monday |
| if (executorService != null) { | ||
| executorService.shutdownNow(); | ||
| } | ||
| shuffleTaskManager.stop(); |
There was a problem hiding this comment.
if the shuffleTaskManager is not identified as final, you should check null
There was a problem hiding this comment.
shuffleTaskManager is assigned in constructor and initialization() method.
I added the null check to make code more robustness
| private StorageManager storageManager; | ||
| private HealthCheck healthCheck; | ||
| private Set<String> tags = Sets.newHashSet(); | ||
| private final Set<String> tags = Sets.newHashSet(); |
There was a problem hiding this comment.
Finally, I reverted the changes.
| + "Default is 0, OS will dynamically adjust the buf size."); | ||
|
|
||
| public static final ConfigOption<Integer> SERVER_SHUFFLE_DATA_METRIC_TOP_NUMBER = | ||
| ConfigOptions.key("rss.server.shuffle.data.metric.top.number") |
There was a problem hiding this comment.
The name is not accurate, what's the shuffle data metric? I think here you want to expose the topN of app level total shuffle size.
There was a problem hiding this comment.
Ok, I changed the code like this:
public static final ConfigOption<Integer> SERVER_SHUFFLE_DATA_METRIC_TOP_NUMBER =
ConfigOptions.key("rss.server.shuffle.data.metric.top.number")
.intType()
.defaultValue(10)
.withDescription(
"size of topN when calc max shuffle data in memory、on disk、remote HDFS or total.");
public static final ConfigOption<Integer> SERVER_SHUFFLE_DATA_METRIC_REFRESH_INTERVAL =
ConfigOptions.key("rss.server.shuffle.data.metric.refresh.interval")
.intType()
.defaultValue(1000)
.withDescription("Shuffle data metric refresh interval in ms");
| "size of topN when calc max shuffle data in memory、on disk、remote HDFS or total."); | ||
|
|
||
| public static final ConfigOption<Integer> SERVER_SHUFFLE_DATA_METRIC_REFRESH_INTERVAL = | ||
| ConfigOptions.key("rss.server.shuffle.data.metric.refresh.interval") |
| private static final String TOTAL_REMOVE_RESOURCE_BY_SHUFFLE_IDS_TIME = | ||
| "total_remove_resource_by_shuffle_ids_time"; | ||
|
|
||
| private static final String TOP_N_TOTAL_SHUFFLE_DATA = "top_N_total_shuffle_data"; |
There was a problem hiding this comment.
this all metrics newly introduced are not consistent with their names.
I think the
topN_of_total_data_size_for_app
topN_of_on_memory_data_size_for_app
topN_of_on_localfile_data_size_for_app
topN_of_on_hadoop_data_size_for_app
How about this?
There was a problem hiding this comment.
I'm not sure these metrics are about app?
There was a problem hiding this comment.
this metric is from ShuffleTaskManager.shuffleTaskInfos, it maintain the app level shuffle data size info.
There was a problem hiding this comment.
this all metrics newly introduced are not consistent with their names.
I think the
topN_of_total_data_size_for_apptopN_of_on_memory_data_size_for_apptopN_of_on_localfile_data_size_for_apptopN_of_on_hadoop_data_size_for_appHow about this?
Ok, I change to it. it is more clear
| private final AtomicLong totalDataSize = new AtomicLong(0); | ||
| private final AtomicLong totalDataSizeInMemory = new AtomicLong(0); | ||
| private final AtomicLong totalDataSizeOnDisk = new AtomicLong(0); | ||
| private final AtomicLong totalDataSizeRemote = new AtomicLong(0); |
There was a problem hiding this comment.
remote is not accurate. I hope the naming should be careful, hadoop is more accurate
There was a problem hiding this comment.
change to hadoop is ok and I changed, but if use obs file system.
| import org.slf4j.Logger; | ||
| import org.slf4j.LoggerFactory; | ||
|
|
||
| public class ShuffleDataExporterTask { |
There was a problem hiding this comment.
Ok, I changed to TopNShuffleDataSizeOfAppCalcTask
zuston
left a comment
There was a problem hiding this comment.
Please attach the metrics shown in the prometheus. And the tests cases are needed.
| .withDescription("size of TopN total shuffle data size of app level."); | ||
|
|
||
| public static final ConfigOption<Integer> TOP_N_SHUFFLE_DATA_SIZE_OF_APP_LEVEL_REFRESH_INTERVAL = | ||
| ConfigOptions.key("rss.server.topN.shuffle.data.size.of.app-level.refresh.interval") |
There was a problem hiding this comment.
How about rss.server.topN.appShuffleDataSize.refresh.interval ?
There was a problem hiding this comment.
How about this refer to: #1363 (comment)
rss.server.topN.appShuffleDataSize.refreshIntervalMs
And it depends on you.
| + "Default is 0, OS will dynamically adjust the buf size."); | ||
|
|
||
| public static final ConfigOption<Integer> TOP_N_SHUFFLE_DATA_SIZE_OF_APP_LEVEL = | ||
| ConfigOptions.key("rss.server.topN.shuffle.data.size.of.app-level") |
There was a problem hiding this comment.
How about rss.server.topN.appShuffleDataSize.number ?
| .build(); | ||
|
|
||
| startClearResourceThread(); | ||
| memoryExporter = |
There was a problem hiding this comment.
memoryExporter is not accurate. Please rename this.
There was a problem hiding this comment.
ok, I rename it to: topNShuffleDataSizeOfAppCalcTask, I think it should be ok.
| Gauge.build() | ||
| .name(TOPN_OF_TOTAL_DATA_SIZE_FOR_APP) | ||
| .help("top N of total shuffle data size for app level") | ||
| .labelNames("topn_of_total_data_size_for_app") |
There was a problem hiding this comment.
the label name is wrong. If we hope this could be shown to find out the app and sorted number, these labels should be taken.
There was a problem hiding this comment.
This is the first initialization in setUpMetrics() in ShuffleServerMetrics.java, and to make gaugeDataSizeTotalUsage not be null.
The real metric cals is in incStorageSuccessCounter() in TopNShuffleDataSizeOfAppCalcTask.java.
eg:
List<Map.Entry<String, ShuffleTaskInfo>> topNTaskInfo = calcTopNTotalDataSizeTaskInfo();
gaugeTotalDataSize.clear();
for (Map.Entry<String, ShuffleTaskInfo> taskInfo : topNTaskInfo) {
gaugeTotalDataSize.labels(taskInfo.getKey()).set(taskInfo.getValue().getTotalDataSize());
}
In order to no make misunderstand, how about I delete the init and add null check ?
There was a problem hiding this comment.
Or How about code:
Gauge.build()
.name(TOPN_OF_TOTAL_DATA_SIZE_FOR_APP)
.help("top N of total shuffle data size for app level")
.labelNames("")
labelNames is set to "".
Sorry, I tried this, and get error when run the code.
| } | ||
| } | ||
|
|
||
| public List<Map.Entry<String, ShuffleTaskInfo>> calcTopNTotalDataSizeTaskInfo() { |
There was a problem hiding this comment.
How about putting these calcTopN methods into TopNShuffleDataSizeOfAppCalcTask
There was a problem hiding this comment.
I original want to encapsulate shuffleTaskInfos in ShuffleTaskManager.
If do as what you say, shuffleTaskInfos will be public through get method().
I will modify the code to your idea.
There was a problem hiding this comment.
I added test case TopNShuffleDataSizeOfAppCalcTaskTest.java
e38e518 to
39a2fc8
Compare
39a2fc8 to
b039800
Compare
| Gauge.build() | ||
| .name(TOPN_OF_TOTAL_DATA_SIZE_FOR_APP) | ||
| .help("top N of total shuffle data size for app level") | ||
| .labelNames("TOPN_OF_TOTAL_DATA_SIZE_FOR_APP") |
| Gauge.build() | ||
| .name(TOPN_OF_IN_MEMORY_DATA_SIZE_FOR_APP) | ||
| .help("top N of in memory shuffle data size for app level") | ||
| .labelNames("TOPN_OF_IN_MEMORY_DATA_SIZE_FOR_APP") |
| Gauge.build() | ||
| .name(TOPN_OF_ON_LOCALFILE_DATA_SIZE_FOR_APP) | ||
| .help("top N of on disk shuffle data size for app level") | ||
| .labelNames("TOPN_OF_ON_LOCALFILE_DATA_SIZE_FOR_APP") |
| Gauge.build() | ||
| .name(TOPN_OF_ON_HADOOP_DATA_SIZE_FOR_APP) | ||
| .help("top N of on hadoop shuffle data size for app level") | ||
| .labelNames("TOPN_OF_ON_HADOOP_DATA_SIZE_FOR_APP") |
a998b80 to
d17d1a4
Compare
…uffle server (apache#1400) expose metrics of TOP10 app bytes in one shuffle server apache#333 Fix: apache#333 apache#681 No. unit test






What changes were proposed in this pull request?
expose metrics of TOP10 app bytes in one shuffle server #333
Why are the changes needed?
Fix:
#333
#681
Does this PR introduce any user-facing change?
No.
How was this patch tested?
unit test