| | |
| | | |
| | | import com.lf.server.entity.all.RedisCacheKey; |
| | | import com.lf.server.entity.sys.ResEntity; |
| | | import com.lf.server.entity.sys.UsersEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.FileHelper; |
| | | import com.lf.server.service.sys.ResService; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | |
| | | |
| | | // 剩余 |
| | | long surplusByte = memory.getAvailable(); |
| | | map.put("totalMem", StringHelper.formatByte(totalByte)); |
| | | map.put("use", StringHelper.formatByte(totalByte - surplusByte)); |
| | | map.put("remainMem", StringHelper.formatByte(surplusByte)); |
| | | map.put("totalMem", FileHelper.formatByte(totalByte)); |
| | | map.put("use", FileHelper.formatByte(totalByte - surplusByte)); |
| | | map.put("remainMem", FileHelper.formatByte(surplusByte)); |
| | | map.put("usage", new DecimalFormat("#.##%").format((totalByte - surplusByte) * 1.0 / totalByte)); |
| | | |
| | | return map; |
| | |
| | | Set<String> keys = redisTemplate.keys(RedisCacheKey.signUserKey("*")); |
| | | for (String key : keys) { |
| | | Object obj = redisTemplate.opsForValue().get(key); |
| | | if (obj != null && obj instanceof UsersEntity) { |
| | | UsersEntity ue = (UsersEntity) obj; |
| | | if (obj != null && obj instanceof UserEntity) { |
| | | UserEntity ue = (UserEntity) obj; |
| | | |
| | | JSONObject map = new JSONObject(); |
| | | map.put("uid", ue.getUid()); |
| | |
| | | // Ping通地址 |
| | | socket.connect(add, 2000); |
| | | } catch (Exception e) { |
| | | log.error(e.getStackTrace()); |
| | | log.error(e.getMessage() + e.getStackTrace() + "\n"); |
| | | list.add(re); |
| | | } finally { |
| | | try { |
| | | socket.close(); |
| | | } catch (Exception e) { |
| | | log.error(e.getStackTrace()); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage() + ex.getStackTrace() + "\n"); |
| | | } |
| | | } |
| | | } |