anchor.diff:  clear_history(Name) ->
       catch folsom_metrics:delete_metric(Name),
       new_history(Name).
  -
  
positive.code:          new_history/1, get_history/2, sum/2, clear_history/1
          ]).
  
  
  -define(DEF_SNMP_AGENT, "test/snmp-agent/ARIA-MIB").
  -define(env_snmp_agent(Server),
          case application:get_env(Server, snmp_agent) of
              {ok, SNMPAgent} -> SNMPAgent;
              _ -> ?DEF_SNMP_AGENT
          end).
  
  %%--------------------------------------------------------------------
  
negative.code: -spec(start_link(atom()) ->
               ok | {error, any()}).
  start_link(Application) ->
      case ?env_snmp_agent(Application) of
          [] ->
              ok;
          SNMPAgent ->
              application:start(leo_statistics),
              application:start(snmp),
  
              case catch snmpa:load_mibs(snmp_master_agent, [SNMPAgent]) of
                  ok ->
                      %% folsom
                      ChildSpec1 = {folsom,
                                    {folsom_sup, start_link, []},
                                    permanent, 2000, supervisor, [folsom]},
                      {ok, _} = supervisor:start_child(leo_statistics_sup, ChildSpec1),
  
                      %% request-counter
                      ChildSpec2 = {leo_statistics_req_counter,
                                    {leo_statistics_req_counter, start_link, []},
                                    permanent, 2000, worker, [leo_statistics_req_counter]},
                      {ok, _} = supervisor:start_child(leo_statistics_sup, ChildSpec2),
                      ok;
                  Error ->
                      Error
              end
      end.
  
  -spec(start_link(atom(), integer()) ->
               ok | {error, any()}).
  