Skip to content
This repository
Browse code

blah

  • Loading branch information...
commit b059ab6095179ad9a3f799e25bccc91f28cc4dac 1 parent 58b221b
Zhou Li authored December 04, 2009

Showing 1 changed file with 4 additions and 15 deletions. Show diff stats Hide diff stats

  1. 19  lib/mcache/src/mcache_client.erl
19  lib/mcache/src/mcache_client.erl
@@ -8,7 +8,6 @@
8 8
 -export([start_link/1]).
9 9
 -export([init/1,handle_call/3,handle_cast/2,handle_info/2,code_change/3,terminate/2]).
10 10
 -export([mc_get/2, ab_get/2, ab_mget/2, mc_set/5, ab_set/5, mc_delete/2, ab_delete/2]).
11  
--export([test_get/4, test_get2/2]).
12 11
 
13 12
 -include_lib("kernel/src/inet_int.hrl").
14 13
 
@@ -69,7 +68,7 @@ send_wrapper({mget, Keys}=Req, From, #state{sock=Sock, seq=Seq, pendings=Ps, mge
69 68
         true ->
70 69
             ItemDict = lists:foldl(fun(K, Acc) -> dict:store(K, undefined, Acc) end, dict:new(), Keys),
71 70
             {ok, State#state{seq=Seq+1,
72  
-                        pendings=dict:store(Seq, {From, app_util:now()}, Ps),
  71
+                        pendings=dict:store(Seq, {From, erlang:now()}, Ps),
73 72
                         mgets=dict:store(Seq, ItemDict, Ms)}};
74 73
         _ ->
75 74
             {not_sent, State}
@@ -77,7 +76,7 @@ send_wrapper({mget, Keys}=Req, From, #state{sock=Sock, seq=Seq, pendings=Ps, mge
77 76
 send_wrapper(Req, From, #state{sock=Sock, seq=Seq, pendings=Ps}=State) ->
78 77
     case (catch send_req(Sock, Seq, Req)) of
79 78
         true ->
80  
-            {ok, State#state{seq=Seq+1, pendings=dict:store(Seq, {From, app_util:now()}, Ps)}};
  79
+            {ok, State#state{seq=Seq+1, pendings=dict:store(Seq, {From, erlang:now()}, Ps)}};
81 80
         _ ->
82 81
             {not_sent, State}
83 82
     end.
@@ -217,7 +216,7 @@ ab_delete(Server, Key) ->
217 216
 % internal apis
218 217
 
219 218
 get_client_pid(Server) ->
220  
-    case app_util:pg2_get_closest_pid({?PG2_GROUP_TAG, Server}) of
  219
+    case pg2:get_closest_pid({?PG2_GROUP_TAG, Server}) of
221 220
         {error, {no_process, _Reason}} ->
222 221
             exit(no_process);
223 222
         Pid when is_pid(Pid) ->
@@ -248,7 +247,7 @@ do_parse(<<16#81, Opcode, KeyLen:16, ExtraLen, DataType, Status:16, TotalBodyLen
248 247
                 data_type=DataType,
249 248
                 cas=CAS,
250 249
                 extra=Extra,
251  
-				key=Key,
  250
+                key=Key,
252 251
                 body=Body},
253 252
     do_parse(Rest, [Resp|Acc]);
254 253
 do_parse(Data, Acc) ->
@@ -351,13 +350,3 @@ do_send_req(Sock, Seq, [Req]) ->
351 350
     erlang:port_command(Sock, gen_req(Seq, Req));
352 351
 do_send_req(Sock, Seq, Req) ->
353 352
     erlang:port_command(Sock, gen_req(Seq, Req)).
354  
-
355  
-test_get(P, R, S, K) ->
356  
-    F = fun(_) -> mc_get(S, K) end,
357  
-    stresstest:start("mcache_client:get", P, R, F).
358  
-
359  
-test_get2(P, R) ->
360  
-    F = fun(_) ->
361  
-            memcached_api:get(webqq, <<"439311075:friends">>)
362  
-        end,
363  
-    stresstest:start("memcached_client:get", P, R, F).

0 notes on commit b059ab6

Please sign in to comment.
Something went wrong with that request. Please try again.