Examples of Stats


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

        Map<String, Collection<String[]>> mbeanStats = new TreeMap<String, Collection<String[]>>();
        try {
            AbstractName aname = new AbstractName(URI.create(abstractName));
            Boolean statisticsProvider = (Boolean) kernel.getAttribute(aname,
                    STATSPROVIDER_ATTRIB);
            Stats stats = (Stats) kernel.getAttribute(aname, STATS_ATTRIB);
            if (statisticsProvider.booleanValue() == true && (stats != null)) {
                String[] statisticNames = stats.getStatisticNames();
                for (int i = 0; i < statisticNames.length; i++) {
                    Statistic statistic = stats.getStatistic(statisticNames[i]);

                    Collection<String[]> mbeanStat = new ArrayList<String[]>();
                    String name = statistic.getName();
                    mbeanStat.add(new String[] { "Name", name });
                    // String className = statistic.getClass().getName();
View Full Code Here

Examples of javax.management.j2ee.statistics.Stats

                connector.resetStats();
                webModule.resetStats();
            }
            //System.out.println("******* NOW IS " + System.currentTimeMillis());
            Stats[] allStats = { webModule.getStats(), connector.getStats() };
            Stats stats;
            for (int j = 0; j < allStats.length; j++) {
                stats = allStats[j];
                Statistic[] stts = stats.getStatistics();
                Statistic aStts;
                String[] sttsNames = stats.getStatisticNames();
                for (int i = 0; i < sttsNames.length; i++) {
                    assertFalse(sttsNames[i].equals(stts[i].getName()));
                    aStts = stats.getStatistic(sttsNames[i]);
                    assertTrue("startTime was not set", aStts.getStartTime() != 0);
                    assertTrue("lastSampleTime was not set", 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

*/
public class StatsFormat implements DataFormat {

    public String format(Object data) {
        StringBuffer output = new StringBuffer();
        Stats stats = (Stats)data;
        for(Statistic statistic:stats.getStatistics()){
            output.append("Name: ");
            output.append(statistic.getName());
            output.append("\n");
            output.append("Description: ");
            output.append(statistic.getDescription());
View Full Code Here

Examples of javax.management.j2ee.statistics.Stats

        Map mbeanStats = new TreeMap();
        try {
            AbstractName aname = new AbstractName(URI.create(abstractName));
            Boolean statisticsProvider = (Boolean) kernel.getAttribute(aname,
                    STATSPROVIDER_ATTRIB);
            Stats stats = (Stats) kernel.getAttribute(aname, STATS_ATTRIB);
            if (statisticsProvider.booleanValue() == true && (stats != null)) {
                String[] statisticNames = stats.getStatisticNames();
                for (int i = 0; i < statisticNames.length; i++) {
                    Statistic statistic = stats.getStatistic(statisticNames[i]);

                    Collection mbeanStat = new ArrayList();
                    String name = statistic.getName();
                    mbeanStat.add(new String[] { "Name", name });
                    String className = statistic.getClass().getName();
View Full Code Here

Examples of javax.management.j2ee.statistics.Stats

                connector.resetStats();
                webModule.resetStats();
            }
            //System.out.println("******* NOW IS " + System.currentTimeMillis());
            Stats[] allStats = { webModule.getStats(), connector.getStats() };
            Stats stats;
            for (int j = 0; j < allStats.length; j++) {
                stats = allStats[j];
                Statistic[] stts = stats.getStatistics();
                Statistic aStts;
                String[] sttsNames = stats.getStatisticNames();
                for (int i = 0; i < sttsNames.length; i++) {
                    assertFalse(sttsNames[i].equals(stts[i].getName()));
                    aStts = stats.getStatistic(sttsNames[i]);
                    assertTrue("startTime was not set", aStts.getStartTime() != 0);
                    assertTrue("lastSampleTime was not set", aStts.getLastSampleTime() != 0);
                    //System.out.println("lastSampleTime = " + aStts.getLastSampleTime() + "  startTime = " + aStts.getStartTime());
                    //System.out.println(aStts);
                }
View Full Code Here

Examples of jeeves.server.resources.Stats

        return metricsRegistry.newGauge(DataSource.class, name,new Gauge<T>() {
            @Override
            public T value() {
                T finalValue;
                try {
                    T val = valueImpl(new Stats(context));
                    if(val == null) {
                        finalValue = defaultValue();
                    } else {
                        finalValue = val;
                    }
View Full Code Here

Examples of l2p.gameserver.skills.Stats

    {
      show("Некорректные данные", player);
      return;
    }
    String value = var[0];
    Stats stat = Stats.valueOfXml(value);
    StringBuilder dialog = new StringBuilder("<html><body>");
    dialog.append("<table><tr>");
    dialog.append("<td><button value=\"Back\" action=\"bypass -h scripts_commands.voiced.Help:showstats\" width=40 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    dialog.append("<td><button value=\"Refresh\" action=\"bypass -h scripts_commands.voiced.Help:showfuncs ").append(value).append("\" width=60 height=15 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_CT1.Button_DF\"></td>");
    dialog.append("</tr></table>");
    dialog.append("<br><center><font color=\"LEVEL\">Stat: ").append(stat).append("</font></center><br><br>");
    Calculator[] calculators = player.getCalculators();
    if(calculators == null || calculators.length == 0 || stat == null)
    {
      dialog.append("None");
    }
    else
    {
      Calculator c = calculators[stat.ordinal()];
      Func[] funcs = c.getFunctions();
      for(int i = 0; i < funcs.length; i++)
      {
        if(funcs[i]._funcOwner != null)
        {
View Full Code Here

Examples of lineage2.gameserver.stats.Stats

   * @param template StatTemplate
   * @param name String
   */
  protected void attachFunc(Element n, StatTemplate template, String name)
  {
    Stats stat = Stats.valueOfXml(n.attributeValue("stat"));
    String order = n.attributeValue("order");
    int ord = parseNumber(order).intValue();
    Condition applyCond = parseFirstCond(n);
    double val = 0;
    if (n.attributeValue("value") != null)
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.