| | |
| | | public void videoPlay() throws Exception { |
| | | Set<String> sets = new HashSet<>(); |
| | | Gson gson = new Gson(); |
| | | Scanner scanner = new Scanner(new FileInputStream("C:\\Users\\Administrator\\Desktop\\日志\\布丸播放\\play_2021_03_20.log")); |
| | | Scanner scanner = new Scanner(new FileInputStream("C:\\Users\\Administrator\\Desktop\\日志\\布丸播放\\play_2021_04_07.log")); |
| | | Map<String, Integer> countMap = new HashMap<>(); |
| | | List<String> videoList = new ArrayList<>(); |
| | | while (scanner.hasNextLine()) { |
| | |
| | | @Test |
| | | public void userActive() throws Exception { |
| | | Gson gson = new Gson(); |
| | | List<String> list = loadLog("C:\\Users\\Administrator\\Desktop\\日志\\布丸播放\\active_2021_03_23.log"); |
| | | List<String> list = loadLog("C:\\Users\\Administrator\\Desktop\\日志\\布丸播放\\active_2021_04_07.log"); |
| | | Map<String, List<UserActiveLogInfo>> map = new HashMap<>(); |
| | | for (String st : list) { |
| | | UserActiveLogInfo activeLogInfo = gson.fromJson(st, UserActiveLogInfo.class); |
| | |
| | | System.out.println("搜索之后播放总数:" + searchPlayCount + "比例为:" + getPercent(map.size(), searchPlayCount)); |
| | | System.out.println("搜索之后未播放总数:" + searchNoPlay + "比例为:" + getPercent(map.size(), searchNoPlay)); |
| | | System.out.println("未搜索也未播放总数:" + noSearchAndPlay + "比例为:" + getPercent(map.size(), noSearchAndPlay)); |
| | | System.out.println("搜索满意度:" + getPercent(searchCount, searchPlayCount)); |
| | | System.out.println("未能成功进入首页总数:" + noComeInCount + "比例为:" + getPercent(map.size(), noComeInCount)); |
| | | System.out.println("进入首页后无动作的总数:" + comeinAndNoAction + "比例为:" + getPercent(map.size(), comeinAndNoAction)); |
| | | } |