@Override
    public void doMain(String[] args) throws Exception {
        CommandLine commandLine = getCommandLine(args);

        String item = commandLine.getOptionValue("item", null);
        String configFile = commandLine.getOptionValue("config");

        Properties props = ResourceUtils.getResourceAsProperties(configFile);
        MetaClientConfig metaClientConfig = new MetaClientConfig();
        String host = props.getProperty("hostName");
        if (StringUtils.isBlank(host)) {
            host = "localhost";
        }
        String serverUrl = "meta://" + host + ":" + props.getProperty("serverPort");
        metaClientConfig.setServerUrl(serverUrl);
        metaClientConfig.setZkConfig(initZkConfig(props));
        MetaMessageSessionFactory sessionFactory = new MetaMessageSessionFactory(metaClientConfig);

        sessionFactory.getRemotingClient().connect(serverUrl);
        sessionFactory.getRemotingClient().awaitReadyInterrupt(serverUrl);

        BooleanCommand resp =
                (BooleanCommand) sessionFactory.getRemotingClient().invokeToGroup(serverUrl, new StatsCommand(0, item));
        if (resp != null) {
            System.out.println(resp.getErrorMsg());
        }
        sessionFactory.shutdown();
    }
Usage: stats -config configFilePath -item item

@author apple
metamorphosis-tools/src/main/java/com/taobao/metamorphosis/tools/shell/BrokerStatsTool.java