|
@@ -83,27 +83,6 @@ public class NginxLogService {
|
|
|
.collect(Collectors.toList());
|
|
.collect(Collectors.toList());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public List<Object> getNginxLog2(DateTimeQuery dateTimeQuery) {
|
|
|
|
|
- try {
|
|
|
|
|
- String start = dateTimeQuery.getStart();
|
|
|
|
|
- LocalDateTime start1 = DateTimeConverter.localDateTime2(start);
|
|
|
|
|
- String end = dateTimeQuery.getEnd();
|
|
|
|
|
- LocalDateTime end1 = DateTimeConverter.localDateTime2(end);
|
|
|
|
|
-
|
|
|
|
|
- Duration duration = Duration.between(start1, end1);
|
|
|
|
|
- long days = duration.toHours();
|
|
|
|
|
- if (days < 0) {
|
|
|
|
|
- return Collections.emptyList();
|
|
|
|
|
- } else if (days > 24) {
|
|
|
|
|
- return Collections.emptyList();
|
|
|
|
|
- }
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- // ignore
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public List<ChartData> getTopN(String dateStr) {
|
|
public List<ChartData> getTopN(String dateStr) {
|
|
|
int pageSize = 100;
|
|
int pageSize = 100;
|
|
|
int pageNumber = 1;
|
|
int pageNumber = 1;
|
|
@@ -307,6 +286,19 @@ public class NginxLogService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public List<Object> getChartData5(DateTimeQuery dateTimeQuery) {
|
|
public List<Object> getChartData5(DateTimeQuery dateTimeQuery) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ LocalDateTime start = DateTimeConverter.localDateTime2(dateTimeQuery.getStart());
|
|
|
|
|
+ LocalDateTime end = DateTimeConverter.localDateTime2(dateTimeQuery.getEnd());
|
|
|
|
|
+ Duration duration = Duration.between(start, end);
|
|
|
|
|
+ long days = duration.toDays();
|
|
|
|
|
+ long hours = duration.toHours();
|
|
|
|
|
+ if (days < 0 || days > 7) {
|
|
|
|
|
+ return Collections.emptyList();
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ // ignore
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
String aggregateField = "timeIso8601";
|
|
String aggregateField = "timeIso8601";
|
|
|
String fieldName = "methodUrl.raw";
|
|
String fieldName = "methodUrl.raw";
|
|
|
|
|
|