Examples of Stats


Examples of com.sleepycat.je.jmx.plugin.Stats

                ObjectName name = new ObjectName(mBeanNamePrefix);
                mBeanCount = getContext().getMBeanServerConnection().
                    queryNames(name, null).size();

                if (mBeanCount > 0) {
                    Stats status =
                        new JEStats(getContext().getMBeanServerConnection());
                    tabs.put("JE Statistics", status);
                    stats.add(status);
                    status =
                        new RepJEStats(getContext().getMBeanServerConnection());
View Full Code Here

Examples of edu.cmu.sphinx.decoder.adaptation.Stats

        return null == result ? null : new SpeechResult(result);
    }
   
    public Stats createStats(int numClasses) {
        clusters = new ClusteredDensityFileData(context.getLoader(), numClasses);
        return new Stats(context.getLoader(), clusters);
    }
View Full Code Here

Examples of gov.nara.nwts.ftapp.stats.Stats

    try {
      BufferedReader br = new BufferedReader(new FileReader(selectedFile));
      int i=1000000;
      for(String line=br.readLine(); line!=null; line=br.readLine()){
        String key = ""+ (i++);
        Stats stats = new Stats(key);
        types.put(key, stats);
        Matcher m = test(line);
        setVals(m, stats, line);
      }
      br.close();
View Full Code Here

Examples of hudson.plugins.performance.IagoParser.Stats

  }
 
  @Test
  public void testParseValidFile() throws Exception {

    Stats stats1 = new IagoParser.Stats();
    stats1.setClientRequestLatencyMsAverage((long) 4);
    stats1.setClientRequestLatencyMsMaximum((long) 5);
    stats1.setClientRequestLatencyMsMinimum((long) 1);
    stats1.setClientSuccess((long) 10);
    stats1.setClientRequests((long) 10);
    stats1.setClientSendBytes((long) 9000);
   
    Stats stats2 = new IagoParser.Stats();
    stats2.setClientRequestLatencyMsAverage((long) 3);
    stats2.setClientRequestLatencyMsMaximum((long) 4);
    stats2.setClientRequestLatencyMsMinimum((long) 2);
    stats2.setClientSuccess((long) 12);
    stats2.setClientRequests((long) 13);
    stats2.setClientSendBytes((long) 12000);

 
    // Create a temp file.
    // We can move this to resources, but allow flexibility in
    // unit test to create on the fly
    File temp = File.createTempFile("parrot-server-stats", ".log");
    // Delete the file when program exits.
    temp.deleteOnExit();
 
    GsonBuilder objGsonBuilder = new GsonBuilder();
    Gson gson = objGsonBuilder.create();
    boolean exceptionOccured = false;
 
    // Write to temp file
    BufferedWriter out = null;
    try {
      out = new BufferedWriter(new FileWriter(temp));
   
    System.out.println(gson.toJson(stats1));
   
      out.write("INF [20140611-21:34:01.224] stats: " + gson.toJson(stats1));
      out.write("INF [20140611-21:35:01.111] stats: " + gson.toJson(stats2));
    } catch (IOException e) {
      exceptionOccured = true;
    } finally {
      if (out != null) {
        out.close();
      }
    }
    Assert.assertFalse(exceptionOccured);

 
    IagoParser parser = new IagoParser("","","");
    Collection<PerformanceReport> reports = parser.parse(new FreeStyleBuild(createFreeStyleProject()), Arrays.asList(temp), createTaskListener());
    Assert.assertEquals(1, reports.size());
 
    PerformanceReport report = (PerformanceReport) reports.toArray()[0];
 
    Assert.assertEquals((stats1.getClientRequestLatencyMsAverage() + stats2.getClientRequestLatencyMsAverage()) / 2, report.getAverage());
  }
View Full Code Here

Examples of io.fabric8.insight.camel.profiler.Stats

    }

    private void print(Map<ProcessorDefinition<?>, Stats> statistics, Stats parent, String indent) {
        for (Map.Entry<ProcessorDefinition<?>, Stats> e : statistics.entrySet()) {
            ProcessorDefinition<?> p = e.getKey();
            Stats s = e.getValue();
            if (s.getParent() == parent) {
                String name = indent + p.toString();
                if (name.length() > DESCRIPTION_LENGTH) {
                    name = name.substring(0, DESCRIPTION_LENGTH - 4) + "...]";
                } else {
                    while (name.length() < DESCRIPTION_LENGTH) {
                        name += " ";
                    }
                }
                long count = s.getCount();
                long self = s.getSelf();
                long total = s.getTotal();
                System.out.println(String.format("%s %8d %8d %8d %8d",
                        name,
                        count,
                        TimeUnit.MILLISECONDS.convert(self, TimeUnit.NANOSECONDS),
                        TimeUnit.MILLISECONDS.convert(total, TimeUnit.NANOSECONDS),
View Full Code Here

Examples of javax.management.j2ee.statistics.Stats

     * @return HashMap
     * @throws Exception
     */
    public static HashMap getStats(String objectName) throws Exception {
        HashMap statsMap = new HashMap();
        Stats stats = (Stats)mbServer.getAttribute(new ObjectName(objectName), "stats");
        String[] sttsName = stats.getStatisticNames();
        Statistic[] stts = stats.getStatistics();
        for(int i = 0; i < sttsName.length; i++) {
            Statistic aStat = stats.getStatistic(sttsName[i]);
            if(aStat instanceof RangeStatistic) {
                Long current = new Long(((RangeStatistic)aStat).getCurrent());
                Long high = new Long(((RangeStatistic)aStat).getHighWaterMark());
                Long low = new Long(((RangeStatistic)aStat).getLowWaterMark());
                statsMap.put(stts[i].getName() + " Current", current);
View Full Code Here

Examples of javax.management.j2ee.statistics.Stats

        // for each mbean name
        for(Iterator<String> it = mbeans.iterator(); it.hasNext(); ) {
            ArrayList<String> mbeanStatsList = new ArrayList<String>();
            String mbeanName = it.next();
            try {
                Stats stats = (Stats)mbServer.getAttribute(new ObjectName(mbeanName), "stats");
                String[] sttsName = stats.getStatisticNames();
                Statistic[] stts = stats.getStatistics();
                for(int i = 0; i < sttsName.length; i++) {
                    Statistic aStat = stats.getStatistic(sttsName[i]);
                    if(aStat instanceof RangeStatistic) {
                        mbeanStatsList.add(stts[i].getName() + " Current");
                        mbeanStatsList.add(stts[i].getName() + " Max");
                        mbeanStatsList.add(stts[i].getName() + " Min");
                    } else if(aStat instanceof CountStatistic) {
View Full Code Here

Examples of javax.management.j2ee.statistics.Stats

                    .openConnection();
            BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            assertEquals(HttpURLConnection.HTTP_OK, connection.getResponseCode());
            assertEquals("Hello World", reader.readLine());
           
            Stats stats = component.getStats();
            Statistic[] stts = stats.getStatistics();
            Statistic aStts;
            String[] sttsNames = stats.getStatisticNames();
            for (int i = 0; i < sttsNames.length; i++) {
                // check that the names match the getter methods
                String sttsName = sttsNames[i];
                assertFalse(sttsName.equals(stts[i].getName()));
                try {
                stats.getClass().getMethod("get" + sttsName, new Class[0]);
                } catch (NoSuchMethodException e) {
              continue; // ignore this statistics for now, JSR77.6.10.1.1
                }
                aStts = stats.getStatistic(sttsName);
                assertTrue("startTime was not set for " + sttsName, aStts.getStartTime() != 0);
                assertTrue("lastSampleTime was not set for " + sttsName, aStts.getLastSampleTime() != 0);
                /*System.out.println("              lastSampleTime = " + aStts.getLastSampleTime() +
                  "  startTime = " + aStts.getStartTime());
                System.out.println(aStts);*/
 
View Full Code Here

Examples of javax.management.j2ee.statistics.Stats

     * @throws Exception
     */
    @RolesAllowed("mejbuser")
    public static HashMap<String, Long> getStats(String objectName) throws Exception {
        HashMap<String, Long> statsMap = new HashMap<String, Long>();
        Stats stats = (Stats)mejb.getAttribute(new ObjectName(objectName), "stats");
        String[] sttsName = stats.getStatisticNames();
        Statistic[] stts = stats.getStatistics();
        for(int i = 0; i < sttsName.length; i++) {
            Statistic aStat = stats.getStatistic(sttsName[i]);
            if(aStat instanceof RangeStatistic) {
                Long current = new Long(((RangeStatistic)aStat).getCurrent());
                Long high = new Long(((RangeStatistic)aStat).getHighWaterMark());
                Long low = new Long(((RangeStatistic)aStat).getLowWaterMark());
                statsMap.put(stts[i].getName() + " Current", current);
View Full Code Here

Examples of javax.management.j2ee.statistics.Stats

        // for each mbean name
        for(Iterator<String> it = mbeans.iterator(); it.hasNext(); ) {
            ArrayList<String> mbeanStatsList = new ArrayList<String>();
            String mbeanName = it.next();
            try {
                Stats stats = (Stats)mejb.getAttribute(new ObjectName(mbeanName), "stats");
                String[] sttsName = stats.getStatisticNames();
                Statistic[] stts = stats.getStatistics();
                for(int i = 0; i < sttsName.length; i++) {
                    Statistic aStat = stats.getStatistic(sttsName[i]);
                    if(aStat instanceof RangeStatistic) {
                        mbeanStatsList.add(stts[i].getName() + " Current");
                        mbeanStatsList.add(stts[i].getName() + " Max");
                        mbeanStatsList.add(stts[i].getName() + " Min");
                    } else if(aStat instanceof CountStatistic) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.