anchor.diff:  -define(MB, (1024*1024)).
   -define(GB, (1024*1024*1024)).
   -include_lib("stdlib/include/qlc.hrl").
  +-include_lib("stdlib/include/ms_transform.hrl").
   
   -import(proplists, [get_value/2, get_value/3]).
   
  
positive.code: 	_ -> false
      end.
  
  clientcount(Tab, Where) ->
      F = fun(#mqtt_client{client_id = ClientId, peername = {IpAddr, Port},
                           username = Username, clean_sess = CleanSess,
                           proto_ver = ProtoVer, keepalive = KeepAlvie,
                           connected_at = ConnectedAt}) ->
          [{clientId, ClientId}, 
  	 {username, Username}, 
  	 {ipaddress, list_to_binary(emqttd_net:ntoa(IpAddr))}, 
  	 {port, Port},
           {clean_sess, CleanSess},
           {proto_ver, ProtoVer},
           {keepalive, KeepAlvie},
           {connected_at, list_to_binary(connected_at_format(ConnectedAt))}]
      end,
      Filter = fun(DbContent)-> match(DbContent, Where) end,
      if length(Where) == 0 ->
      	[F(Client) || Client <- emqttd_vm:get_ets_object(Tab)];
      true ->
  	[F(Client) || Client <- emqttd_vm:get_ets_object(Tab), Filter(str(Client#mqtt_client.username))]
      end.
  
  int(S) ->
      list_to_integer(S).
  
  str(A) when is_atom(A) -> atom_to_list(A);
  str(B) when is_binary(B) -> binary_to_list(B);
  str(L) when is_list(L) -> L.
  
negative.code: %%clients api
  api(clients, Req) ->
      ClientQry = Req:parse_post(),
      io:format("arg~p~n",[ClientQry]),
      CFlag = get_value("c_flag", ClientQry, ""),
      TotalNum = clientcount(mqtt_client), 
      io:format("count:~p~n",[TotalNum]),
      {M, C} = queryclient(mqtt_client, CFlag), 
      io:format("Result:~p~n",[M]),
      api_respond(Req, [{totalNum, TotalNum}, {result, M}, {c_flag, C}]);
      
  %%-----------------------------------session--------------------------------------
  %%sessin check api
  