Package org.apache.uima.ducc.cli

Examples of org.apache.uima.ducc.cli.ServiceStatistics


        Options options = new Options();
        addOptions(options);

        CommandLineParser parser = new PosixParser();
        CommandLine commandLine = null;
        IServiceStatistics default_statistics = new ServiceStatistics(false, false, "<N/A>");

    try {
      commandLine = parser.parse(options, args);
    } catch (ParseException e) {
            print("Cannot parse command line:", e);
View Full Code Here


        return Long.reverseBytes(stat1);
    }

    public ServiceStatistics getStatistics()
    {
        ServiceStatistics stats = new ServiceStatistics(false, false,"<NA>");
        try {
            Socket sock = new Socket(host, Integer.parseInt(port));
            InputStream sock_in = sock.getInputStream();
           
            DataInputStream dis = new DataInputStream(sock_in);

            long stat1 = readLong(dis);
            long stat2 = readLong(dis);
            long stat3 = readLong(dis);
            long stat4 = readLong(dis);

            stats.setAlive(true);
            stats.setHealthy(true);
            stats.setInfo"S1[" + stat1 +
                            "] S2[" + stat2 +
                            "] S3[" + stat3 +
                            "] S4[" + stat4 +
                            "]"
                            );
        } catch ( Throwable t) {
          t.printStackTrace();
            stats.setInfo(t.getMessage());
        }
        return stats;       
    }
View Full Code Here

    {
        try {
      CustomPing cp = new CustomPing();
      cp.init(null, args[0]);
      for ( int i = 0; i < 10; i++ ) {
          ServiceStatistics stats = cp.getStatistics();
          System.out.println(stats);
          Thread.sleep(2000);
      }
      cp.stop();
    } catch (InterruptedException e) {
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.cli.ServiceStatistics

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.