anchor.diff:                                  1 -> A ++ " -" ++ L ++ Val2;
                                   _ -> A ++ " --" ++ L ++ " " ++ Val2 end end,
                               "", Options),
  -    WorkerID = proplists:get_value(worker_id, Meta),
  -    case run(Command, WorkerID) of
  -        0 -> ok;
  -        ExitCode -> erlang:error({tcpkali_error, ExitCode})
  -    end,
  -    {nil, State}.
  -
  -start_cmd(#state{executable = Exec} = State, Meta, "tcpkali " ++ Options) ->
  -    Command = Exec ++ " " ++ Options,
  -    WorkerID = proplists:get_value(worker_id, Meta),
  -    PoolID = proplists:get_value(pool_id, Meta),
  -    ID = lists:flatten(io_lib:format("~b.~b", [PoolID, WorkerID])),
  +    ID = report_worker_nums(Meta),
       case run(Command, ID) of
           0 -> ok;
           ExitCode -> erlang:error({tcpkali_error, ExitCode})
       end,
       {nil, State}.
  +
  +start_cmd(#state{executable = Exec} = State, Meta, "tcpkali " ++ Options) ->
  +    Command = Exec ++ " " ++ Options,
  +    ID = report_worker_nums(Meta),
  +    case run(Command, ID) of
  +        0 -> ok;
  +        ExitCode -> erlang:error({tcpkali_error, ExitCode})
  +    end,
  +    {nil, State}.
  +
  +report_worker_nums(Meta) ->
  +    WorkerID = proplists:get_value(worker_id, Meta),
  +    PoolID = proplists:get_value(pool_id, Meta),
  +    PoolNum = proplists:get_value(pools_num, Meta),
  +    WorkersNum = proplists:get_value(pool_size, Meta),
  +    notify(lists:flatten(io_lib:format("tcpkali.workers_num.pool~b", [PoolID])), gauge, WorkersNum),
  +    notify("tcpkali.pools_num", gauge, PoolNum),
  +    lists:flatten(io_lib:format("~b.~b", [PoolID, WorkerID])).
   
   generate_filler(N, Id) ->
       Prefix = "\\{" ++ erlang:integer_to_list(Id),
  
positive.code:             {graph, #{title => "Traffic bitrate (aggregated)",
                        units => "bits/sec",
                        metrics => [
                                    {"tcpkali.traffic.bitrate.in", derived, #{resolver => traffic_in_resolver}}
  %                                  {"tcpkali.traffic.bitrate.out", derived, #{resolver => traffic_out_resolver}}
                                    ]}}
          ]}
      ].
  
  metric_by_name("tcpkali.latency.connect." ++ _ = Name) ->
      {group, "Tcpkali", [{graph, #{title => "Latency connect", units => "ms", metrics => [{Name, gauge}]}}]};
  metric_by_name("tcpkali.latency.message." ++ _ = Name) ->
      {group, "Tcpkali", [{graph, #{title => "Latency", units => "ms", metrics => [{Name, gauge}]}}]};
  metric_by_name("tcpkali.traffic.bitrate." ++ _ = Name) ->
      {group, "Tcpkali", [{graph, #{title => "Traffic bitrate", units => "bits/s", metrics => [{Name, gauge}]}}]};
  metric_by_name("tcpkali.connections.total." ++ _ = Name) ->
      {group, "Tcpkali", [{graph, #{title => "Connections total", units => "N", metrics => [{Name, gauge}]}}]};
  metric_by_name("tcpkali.traffic.msgs." ++ _ = Name) ->
      {group, "Tcpkali", [{graph, #{title => "Messages", units => "N", metrics => [{Name, counter}]}}]};
  metric_by_name("tcpkali.traffic.data." ++ _ = Name) ->
      {group, "Tcpkali", [{graph, #{title => "Traffic data", units => "bytes/s", metrics => [{Name, counter}]}}]};
  metric_by_name("tcpkali.connections.opened" ++ _ = Name) ->
      {group, "Tcpkali", [{graph, #{title => "Connections opened", units => "N", metrics => [{Name, counter}]}}]};
  metric_by_name(_) -> undefined.
  
  start(#state{executable = Exec} = State, Meta, Options) ->
  
negative.code:     json2cbor/4,
      encode/4,
      replace_expressions/2,
      replace_back/2,
      traffic_in_resolver/0,
      traffic_out_resolver/0,
      connections_in_resolver/0,
      connections_out_resolver/0
  ]).
  
  -define(Timeout, 5000).
  