From 8fb08c6c9334b0de08d7b1428afe04fc9a83b1c9 Mon Sep 17 00:00:00 2001 From: Alexander Alexandrov Date: Fri, 9 Sep 2016 14:18:32 +0200 Subject: [PATCH] More efficient `findIn` method in `DistributedLogCollection`. As the list is transmitted through the network, listing everything in large `log` subdirectories might cause timeout execptions with the default value of 5s per host. The new implementation only lists files directly located in the `log` folder. --- .../core/beans/system/DistributedLogCollection.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/peel-core/src/main/scala/org/peelframework/core/beans/system/DistributedLogCollection.scala b/peel-core/src/main/scala/org/peelframework/core/beans/system/DistributedLogCollection.scala index bb84e1cc..4f9934f5 100644 --- a/peel-core/src/main/scala/org/peelframework/core/beans/system/DistributedLogCollection.scala +++ b/peel-core/src/main/scala/org/peelframework/core/beans/system/DistributedLogCollection.scala @@ -54,7 +54,7 @@ trait DistributedLogCollection { implicit val patterns = logFilePatterns() val findIn = (host: String, logFolder: String) => - s"""ssh $host "find $logFolder -type f -exec ls {} \\; 2> /dev/null"""".trim + s"""ssh $host "ls -l $logFolder 2> /dev/null"""".trim val countFiles = (host: String, logFile: String) => s"""ssh $host "wc -l $logFile| xargs | cut -d' ' -f1""""