Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add version, stats and dump stats to text protocol. Sorta kinda test it... #55

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

gphat commented Jul 29, 2011

I tested the new response class I made, but I didn't know see an example of the version/stats/dump_stats to see how to properly test that. I'm not really a Scala guy, but I can copy it and adapt it a bit. ;)

That response class might be a bad idea.

I'm sure blatantly copying the stats and dump_stats code from the other handler is a bad idea, since it should likely be put in some common place.

This might not be useful, but I thought I'd send it along. Thanks either way!

gphat commented Aug 24, 2011

Ping? :)

@robey robey commented on the diff Sep 2, 2011

src/main/scala/net/lag/kestrel/TextHandler.scala
@@ -89,6 +90,9 @@ case class ErrorResponse(message: String) extends TextResponse {
case class CountResponse(count: Long) extends TextResponse {
def toBuffer = ChannelBuffers.wrappedBuffer(("+" + count.toString + "\n").getBytes("ascii"))
}
+case class StringResponse(message: String) extends TextResponse {
+ def toBuffer = ChannelBuffers.wrappedBuffer(("+" + message + "\n").getBytes("ascii"))
@robey

robey Sep 2, 2011

Contributor

indentation, but i can fix it in post... and actually, i think we should use ":" here since it's returning a string.

@robey robey commented on the diff Sep 2, 2011

src/main/scala/net/lag/kestrel/TextHandler.scala
case x =>
channel.write(ErrorResponse("Unknown command: " + x))
}
}
+ private def stats() = {
@robey

robey Sep 2, 2011

Contributor

i'd rather not do stats this way anymore. you can get them from the admin port in json or text, which is much more supportable.

Contributor

robey commented Sep 2, 2011

i guess i really only want "version" from here. i want to keep the stats on the admin/stats port. i'll copy the "version" bit manually but still give you credit. :)

Contributor

robey commented Sep 2, 2011

done!

@robey robey closed this Sep 2, 2011

gphat commented Sep 2, 2011

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment