Examples of TimeStatistic


Examples of eu.ha3.easy.TimeStatistic

  private void whenUninitializedAction()
  {
    if (this.mod.isInitialized())
      return;
   
    TimeStatistic stat = new TimeStatistic();
    this.mod.initializeAndEnable();
    this.mod.getChatter().printChat(
      ChatColorsSimple.COLOR_BRIGHTGREEN, "Loading for the first time (" + stat.getSecondsAsString(2) + "s)");
  }
View Full Code Here

Examples of eu.ha3.easy.TimeStatistic

 
  private void whenWantsForcing()
  {
    if (!this.mod.isActivated() && this.mod.isInitialized())
    {
      TimeStatistic stat = new TimeStatistic();
      this.mod.reloadEverything();
      this.mod.activate();
      this.mod.getChatter().printChat(
        ChatColorsSimple.COLOR_BRIGHTGREEN, "Reloading expansions (" + stat.getSecondsAsString(2) + "s)");
    }
    else if (!this.mod.isInitialized())
    {
      whenUninitializedAction();
    }
View Full Code Here

Examples of eu.ha3.easy.TimeStatistic

    util().registerPrivateGetter("isJumping", EntityLivingBase.class, -1, "isJumping", "field_70703_bu", "bd");
    util().registerPrivateGetter("isInWeb", Entity.class, -1, "isInWeb", "field_70134_J", "J");
   
    ((OperatorCaster) op()).setTickEnabled(true);
   
    TimeStatistic timeMeasure = new TimeStatistic(Locale.ENGLISH);
    this.userControl = new UserControl(this);
    this.expansionManager =
      new ExpansionManager(new File(util().getModsFolder(), "matmos/expansions_r27_userconfig/"), this);
   
    // Create default configuration
    this.updateNotifier.fillDefaults(this.config);
    this.config.setProperty("world.height", 256);
    this.config.setProperty("dump.sheets.enabled", false);
    this.config.setProperty("start.enabled", true);
    this.config.setProperty("reversed.controls", false);
    this.config.setProperty("sound.autopreview", true);
    this.config.setProperty("globalvolume.scale", 1f);
    this.config.setProperty("key.code", 65);
    this.config.setProperty("useroptions.altitudes.high", true);
    this.config.setProperty("useroptions.altitudes.low", true);
    this.config.setProperty("useroptions.biome.override", -1);
    this.config.setProperty("debug.mode", 0);
    this.config.setProperty("minecraftsound.ambient.volume", 1f);
    this.config.commit();
   
    // Load configuration from source
    try
    {
      this.config.setSource(new File(util().getModsFolder(), "matmos/userconfig.cfg").getCanonicalPath());
      this.config.load();
    }
    catch (IOException e)
    {
      e.printStackTrace();
      throw new RuntimeException("Error caused config not to work: " + e.getMessage());
    }
   
    this.expansionManager.setVolumeAndUpdate(this.config.getFloat("globalvolume.scale"));
    resetAmbientVolume();
   
    this.updateNotifier.loadConfig(this.config);
   
    // This registers stuff to Minecraft (key bindings...)
    this.userControl.load();
   
    MAtLog.info("Took " + timeMeasure.getSecondsAsString(3) + " seconds to setup MAtmos base.");
   
    if (this.config.getBoolean("start.enabled"))
    {
      initializeAndEnable();
    }
View Full Code Here

Examples of eu.ha3.easy.TimeStatistic

      return;
   
    this.expansionManager.deactivate();
    this.expansionManager.dispose();
   
    TimeStatistic stat = new TimeStatistic(Locale.ENGLISH);
   
    this.dataGatherer = new ModularDataGatherer(this);
    this.dataGatherer.load();
    this.visualDebugger = new VisualDebugger(this, this.dataGatherer);
    this.expansionManager.setData(this.dataGatherer.getData());
    this.expansionManager.setCollector(this.dataGatherer);
    this.expansionManager.loadExpansions();
   
    this.hasResourcePacks = true;
    if (this.expansionManager.getExpansions().size() == 0)
    {
      MAtResourcePackDealer dealer = new MAtResourcePackDealer();
      if (dealer.findResourcePacks().size() == 0)
      {
        this.hasResourcePacks = false;
        this.hasDisabledResourcePacks = dealer.findDisabledResourcePacks().size() > 0;
      }
    }
   
    MAtLog.info("Expansions loaded (" + stat.getSecondsAsString(1) + "s).");
  }
View Full Code Here

Examples of eu.ha3.easy.TimeStatistic

  }
 
  @Override
  public void process()
  {
    TimeStatistic stat = new TimeStatistic();
    for (String requiredModule : this.iteratedThroughModules)
    {
      this.watch.reset();
      try
      {
        this.modules.get(requiredModule).process();
      }
      catch (Exception e)
      {
        e.printStackTrace();
        IDontKnowHowToCode.whoops__printExceptionToChat(this.mod.getChatter(), e, requiredModule.hashCode());
      }
      this.watch.stop();
      if (this.watch.getMilliseconds() > 50 && this.mod.isDebugMode())
      {
        MAtLog.warning("WARNING: Module " + requiredModule + " took " + stat.getMilliseconds() + "ms!!!");
      }
    }
   
    this.ticksPassed = this.ticksPassed + 1;
   
View Full Code Here

Examples of eu.ha3.easy.TimeStatistic

      return;
   
    if (!this.isSuccessfullyBuilt && this.agent != null)
    {
      MAtLog.info("Building expansion " + getName() + "...");
      TimeStatistic stat = new TimeStatistic(Locale.ENGLISH);
      buildKnowledge();
      if (this.isSuccessfullyBuilt)
      {
        MAtLog.info("Expansion " + getName() + " built (" + stat.getSecondsAsString(3) + "s).");
      }
      else
      {
        MAtLog.warning("Expansion "
          + getName() + " failed to build!!! (" + stat.getSecondsAsString(3) + "s).");
      }
    }
   
    if (this.collector != null)
    {
View Full Code Here

Examples of javax.management.j2ee.statistics.TimeStatistic

                    if (statistic instanceof CountStatistic) {
                        CountStatistic cStat = (CountStatistic) statistic;
                        long count = cStat.getCount();
                        mbeanStat.add(new String[] { "Count", Long.toString(count) });
                    } else if (statistic instanceof TimeStatistic) {
                        TimeStatistic tStat = (TimeStatistic) statistic;
                        long count = tStat.getCount();
                        mbeanStat.add(new String[] { "Count", Long.toString(count) });
                        String maxTime = TimeUtils.formatDuration(tStat.getMaxTime());
                        mbeanStat.add(new String[] { "Max Time", maxTime });
                        String minTime = TimeUtils.formatDuration(tStat.getMinTime());
                        mbeanStat.add(new String[] { "Min Time", minTime });
                        long totalTime = tStat.getTotalTime();
                        mbeanStat.add(new String[] { "Total Time", Long.toString(totalTime) });
                    } else if (statistic instanceof BoundedRangeStatistic) {
                        BoundedRangeStatistic brStat = (BoundedRangeStatistic) statistic;
                        long upperBound = brStat.getUpperBound();
                        mbeanStat.add(new String[] { "Upper Bound", Long.toString(upperBound) });
View Full Code Here

Examples of javax.management.j2ee.statistics.TimeStatistic

                        CountStatistic cStat = (CountStatistic) statistic;
                        long count = cStat.getCount();
                        mbeanStat.add(new String[] { "Count",
                                Long.toString(count) });
                    } else if (statistic instanceof TimeStatistic) {
                        TimeStatistic tStat = (TimeStatistic) statistic;
                        long count = tStat.getCount();
                        mbeanStat.add(new String[] { "Count",
                                Long.toString(count) });
                        String maxTime = TimeUtils.formatDuration(tStat.getMaxTime());
                        mbeanStat.add(new String[] { "Max Time",
                                maxTime });
                        String minTime = TimeUtils.formatDuration(tStat.getMinTime());
                        mbeanStat.add(new String[] { "Min Time",
                                minTime });
                        long totalTime = tStat.getTotalTime();
                        mbeanStat.add(new String[] { "Total Time",
                                Long.toString(totalTime) });
                    } else if (statistic instanceof BoundedRangeStatistic) {
                        BoundedRangeStatistic brStat = (BoundedRangeStatistic) statistic;
                        long upperBound = brStat.getUpperBound();
View Full Code Here

Examples of javax.management.j2ee.statistics.TimeStatistic

                        CountStatistic cStat = (CountStatistic) statistic;
                        long count = cStat.getCount();
                        mbeanStat.add(new String[] { "Count",
                                Long.toString(count) });
                    } else if (statistic instanceof TimeStatistic) {
                        TimeStatistic tStat = (TimeStatistic) statistic;
                        long count = tStat.getCount();
                        mbeanStat.add(new String[] { "Count",
                                Long.toString(count) });
                        Date maxTime = new Date(tStat.getMaxTime());
                        mbeanStat.add(new String[] { "Max Time",
                                maxTime.toString() });
                        Date minTime = new Date(tStat.getMinTime());
                        mbeanStat.add(new String[] { "Min Time",
                                minTime.toString() });
                        long totalTime = tStat.getTotalTime();
                        mbeanStat.add(new String[] { "Total Time",
                                Long.toString(totalTime) });
                    } else if (statistic instanceof BoundedRangeStatistic) {
                        BoundedRangeStatistic brStat = (BoundedRangeStatistic) statistic;
                        long upperBound = brStat.getUpperBound();
View Full Code Here

Examples of javax.management.j2ee.statistics.TimeStatistic

                        statMap.put("Description", stat.getDescription());
                        statMap.put("StartTime", df.format(new Date(stat.getStartTime())));
                        statMap.put("LastSampleTime", df.format(new Date(stat.getLastSampleTime())));
                        statMap.put("Details", "");
                    } else if (stats[i] instanceof TimeStatistic) {
                        TimeStatistic stat = (TimeStatistic)stats[i];
                        statMap.put("Name", stat.getName());
                        statMap.put("Value", stat.getCount() + " " + stat.getUnit());
                        statMap.put("Description", stat.getDescription());
                        statMap.put("StartTime", df.format(new Date(stat.getStartTime())));
                        statMap.put("LastSampleTime", df.format(new Date(stat.getLastSampleTime())));
                        statMap.put("Details",
                                GuiUtil.getMessage("monitoring.MaxTime")+": " + stat.getMaxTime() + " " + stat.getUnit() + "<br/>" +
                                GuiUtil.getMessage("monitoring.MinTime")+": " + stat.getMinTime() + " " + stat.getUnit() + "<br/>" +
                                GuiUtil.getMessage("monitoring.TotalTime")+": " + stat.getTotalTime() + " " + stat.getUnit()+ "<br/>");
                    } else if (stats[i] instanceof StringStatistic) {
                        StringStatistic stat = (StringStatistic)stats[i];
                        statMap.put("Name", stat.getName());
                        statMap.put("Value", stat.getCurrent());
                        statMap.put("Description", stat.getDescription());
                        statMap.put("StartTime", df.format(new Date(stat.getStartTime())));
                        statMap.put("LastSampleTime", df.format(new Date(stat.getLastSampleTime())));
                        statMap.put("Details", "");
                    } else if (stats[i] instanceof Statistic) {
                        statMap.put("Name", stats[i].getName());
                        statMap.put("Value", stats[i].getUnit());
                        statMap.put("Description", stats[i].getDescription());
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.