Permalink
Browse files

pretty client builder toString

  • Loading branch information...
1 parent 945224c commit 30146033580279455eba6ac9d4ece22d7b9f9376 @mariusae mariusae committed Jan 11, 2011
Showing with 29 additions and 0 deletions.
  1. +29 −0 finagle-core/src/main/scala/com/twitter/finagle/builder/ClientBuilder.scala
@@ -83,6 +83,35 @@ case class ClientBuilder(
None // proactivelyConnect
)
+ override def toString() = {
+ val options = Seq(
+ "name" -> _name,
+ "hosts" -> _hosts,
+ "codec" -> _codec,
+ "connectionTimeout" -> Some(_connectionTimeout),
+ "requestTimeout" -> Some(_requestTimeout),
+ "statsReceiver" -> _statsReceiver,
+ "sampleWindow" -> _sampleWindow,
+ "sampleGranularity" -> _sampleGranularity,
+ "hostConnectionLimit" -> _hostConnectionLimit,
+ "sendBufferSize" -> _sendBufferSize,
+ "recvBufferSize" -> _recvBufferSize,
+ "failureAccrualWindow" -> _failureAccrualWindow,
+ "retries" -> _retries,
+ "initialBackoff" -> _initialBackoff,
+ "backoffMultiplier" -> _backoffMultiplier,
+ "logger" -> _logger,
+ "channelFactory" -> _channelFactory,
+ "proactivelyConnect" -> _proactivelyConnect
+ )
+
+ "ClientBuilder(%s)".format(
+ options flatMap {
+ case (k, Some(v)) => Some("%s=%s".format(k, v))
+ case _ => None
+ } mkString(", "))
+ }
+
def hosts(hostnamePortCombinations: String): ClientBuilder =
copy(_hosts = Some(parseHosts(hostnamePortCombinations)))

0 comments on commit 3014603

Please sign in to comment.