Skip to content

Commit

Permalink
More efficient findIn method in DistributedLogCollection.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aalexandrov committed Sep 9, 2016
1 parent 65a70b8 commit 8fb08c6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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""""
Expand Down

0 comments on commit 8fb08c6

Please sign in to comment.