Jacob Perkins avatar Jacob Perkins committed 83f69e2

fix info parsing

Comments (0)

Files changed (3)

 {application, erldis, [
 	{description, "Erlang Redis application"},
-	{vsn, "0.1.1"},
+	{vsn, "0.1.2"},
 	{registered, [erldis_sup]},
 	{mod, {erldis_app, []}},
 	{applications, [kernel, stdlib]},

ebin/erldis.appup

-{"0.1.1", [
+{"0.1.2", [
+	{"0.1.1", [
+		{load_module, erldis_client}
+	]},
 	{"0.1.0", [
 		{load_module, erldis_client},
 		{load_module, erldis}
 		{add_module, erldis_sets}
 	]}
 ], [
+	{"0.1.1", [
+		{load_module, erldis_client}
+	]},
 	{"0.1.0", [
 		{load_module, erldis_client},
 		{load_module, erldis}

src/erldis_client.erl

 			end
 		end,
 
-	[S] = scall(Client, info),
+	[S] = scall(Client, <<"info ">>),
 	elists:mapfilter(F, string:tokens(binary_to_list(S), ?EOL)).
 
-parse_stat(<<"redis_version:",Vsn/binary>>) ->
+parse_stat("redis_version:"++Vsn) ->
 	{version, Vsn};
-parse_stat(<<"uptime_in_seconds:",Val/binary>>) ->
+parse_stat("uptime_in_seconds:"++Val) ->
 	{uptime, list_to_integer(Val)};
-parse_stat(<<"connected_clients:",Val/binary>>) ->
+parse_stat("connected_clients:"++Val) ->
 	{clients, list_to_integer(Val)};
-parse_stat(<<"connected_slaves:",Val/binary>>) ->
+parse_stat("connected_slaves:"++Val) ->
 	{slaves, list_to_integer(Val)};
-parse_stat(<<"used_memory:",Val/binary>>) ->
+parse_stat("used_memory:"++Val) ->
 	{memory, list_to_integer(Val)};
-parse_stat(<<"changes_since_last_save:",Val/binary>>) ->
+parse_stat("changes_since_last_save:"++Val) ->
 	{changes, list_to_integer(Val)};
-parse_stat(<<"last_save_time:",Val/binary>>) ->
+parse_stat("last_save_time:"++Val) ->
 	{last_save, list_to_integer(Val)};
-parse_stat(<<"total_connections_received:",Val/binary>>) ->
+parse_stat("total_connections_received:"++Val) ->
 	{connections, list_to_integer(Val)};
-parse_stat(<<"total_commands_processed:",Val/binary>>) ->
+parse_stat("total_commands_processed:"++Val) ->
 	{commands, list_to_integer(Val)};
 parse_stat(_) ->
 	undefined.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.