mirror of
https://e.coding.net/circlecloud/Yum.git
synced 2024-10-31 20:28:47 +00:00
feat: 事件能耗估计时间排序
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
a0cb9c2ca7
commit
2e9419a376
@ -151,7 +151,7 @@ public class MonitorCommand implements CommandExecutor {
|
||||
}
|
||||
}
|
||||
sender.sendMessage(mieprefix);
|
||||
for (final String event : eventTotalTime.keySet()) {
|
||||
for (final String event : MonitorManager.sortMapByValue(eventTotalTime).keySet()) {
|
||||
final double avgTime = eventTotalTime.get(event) / um / eventCount.get(event);
|
||||
sender.sendMessage(String.format(avgTime < 10 ? milist : miwlist, event, eventTotalTime.get(event) / um, eventCount.get(event), avgTime));
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ public class MonitorManager {
|
||||
*/
|
||||
public static Map<String, Long> sortMapByValue(final Map<String, Long> oriMap) {
|
||||
if (oriMap == null || oriMap.isEmpty()) {
|
||||
return null;
|
||||
return oriMap;
|
||||
}
|
||||
final Map<String, Long> sortedMap = new LinkedHashMap<String, Long>();
|
||||
final List<Map.Entry<String, Long>> entryList = new ArrayList<Map.Entry<String, Long>>(oriMap.entrySet());
|
||||
|
Loading…
Reference in New Issue
Block a user