Browse Source

Merge branch 'feature/20241202-log-time' of Server/long-article-recommend into master

fengzhoutian 7 months ago
parent
commit
bf88262eb5

+ 5 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/filter/FilterService.java

@@ -41,7 +41,11 @@ public class FilterService {
         for (final FilterStrategy strategy : strategies) {
             Future<FilterResult> future = pool.submit(() -> {
                 try {
-                    return strategy.filter(param);
+                    long t1 = System.currentTimeMillis();
+                    FilterResult ret = strategy.filter(param);
+                    long t2 = System.currentTimeMillis();
+                    log.info("Filter {} cost: {}", strategy.getClass().getSimpleName(), t2 - t1);
+                    return ret;
                 } finally {
                     cdl.countDown();
                 }

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/filter/strategy/BadStrategy.java

@@ -41,7 +41,6 @@ public class BadStrategy implements FilterStrategy {
         }
         filterResult.setContentIds(result);
         filterResult.setFilterContent(filterContents);
-        log.info("BadStrategy cost:{}", System.currentTimeMillis() - start);
         return filterResult;
     }
 

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/filter/strategy/ColdStartBackupFilterStrategy.java

@@ -35,7 +35,6 @@ public class ColdStartBackupFilterStrategy implements FilterStrategy {
             }
         }
         filterResult.setContentIds(result);
-        log.info("ColdStartBackupFilterStrategy cost:{}", System.currentTimeMillis() - start);
         return filterResult;
     }
 

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/filter/strategy/HistoryTitleForFwhColdStartStrategy.java

@@ -50,7 +50,6 @@ public class HistoryTitleForFwhColdStartStrategy implements FilterStrategy {
         }
         filterResult.setContentIds(result);
         filterResult.setFilterContent(filterContents);
-        log.info("HistoryTitleForFwhColdStartStrategy cost:{}", System.currentTimeMillis() - start);
         return filterResult;
     }
 

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/filter/strategy/HistoryTitleStrategy.java

@@ -101,7 +101,6 @@ public class HistoryTitleStrategy implements FilterStrategy {
         }
         filterResult.setContentIds(result);
         filterResult.setFilterContent(filterContents);
-        log.info("HistoryTitleStrategy cost:{}", System.currentTimeMillis() - start);
         return filterResult;
     }
 

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/filter/strategy/InfiniteHisTitleStrategy.java

@@ -84,7 +84,6 @@ public class InfiniteHisTitleStrategy implements FilterStrategy {
         }
         filterResult.setContentIds(result);
         filterResult.setFilterContent(filterContents);
-        log.info("InfiniteHisTitleStrategy cost:{}", System.currentTimeMillis() - start);
         return filterResult;
     }
 

+ 0 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/filter/strategy/SensitiveStrategy.java

@@ -104,7 +104,6 @@ public class SensitiveStrategy implements FilterStrategy {
         }
         filterResult.setContentIds(result);
         filterResult.setFilterContent(filterContents);
-        log.info("SensitiveStrategy cost:{}", System.currentTimeMillis() - start);
         return filterResult;
     }