Package org.mcstats

Examples of org.mcstats.Metrics


      }
      if (War.war.getWarzones().size() > 0) {
        War.war.log("Warzones ready.", Level.INFO);
        final int zones = War.war.getWarzones().size();
        try {
          Metrics metrics = new Metrics(War.war);
          Graph warzoneCount = metrics.createGraph("Warzones");
          warzoneCount.addPlotter(new FixedPlotter("Count", zones));
          Graph language = metrics.createGraph("Language");
          String langName = War.war.getLoadedLocale().getDisplayLanguage(Locale.ENGLISH);
          if (langName.isEmpty()) {
            langName = "English";
          }
          language.addPlotter(new PlotterEnabled(langName));
          Graph plugins = metrics.createGraph("Extensions");
          if (War.war.isSpoutServer()) {
            plugins.addPlotter(new PlotterEnabled("Spout"));
          }
          if (War.war.isTagServer()) {
            plugins.addPlotter(new PlotterEnabled("TagAPI"));
          }
          if (Bukkit.getPluginManager().isPluginEnabled("WorldEdit")) {
            plugins.addPlotter(new PlotterEnabled("WorldEdit"));
          }
          plugins.addPlotter(new PlotterEnabled("War")); // of course
          metrics.start();
        } catch (IOException ignored) {
        }
      }
    }
  }
View Full Code Here


        }
    }

    private void setupMetrics() {
        try {
            Metrics m = new Metrics(this);

            Metrics.Graph envGraph = m.createGraph("worlds_by_env");
            for (Environment env : Environment.values())
                envGraph.addPlotter(new EnvironmentPlotter(this, env));

            m.addCustomData(new Metrics.Plotter("Loaded worlds") {
                @Override
                public int getValue() {
                    return getMVWorldManager().getMVWorlds().size();
                }
            });
            m.addCustomData(new Metrics.Plotter("Total number of worlds") {
                @Override
                public int getValue() {
                    return getMVWorldManager().getMVWorlds().size()
                            + getMVWorldManager().getUnloadedWorlds().size();
                }
            });

            Set<String> gens = new HashSet<String>();
            for (MultiverseWorld w : this.getMVWorldManager().getMVWorlds())
                gens.add(w.getGenerator());
            gens.remove(null);
            gens.remove("null");
            Metrics.Graph genGraph = m.createGraph("custom_gens");
            for (String gen : gens)
                genGraph.addPlotter(new GeneratorPlotter(this, gen));

            m.start();
            log(Level.FINE, "Metrics have run!");
        } catch (IOException e) {
            log(Level.WARNING, "There was an issue while enabling metrics: " + e.getMessage());
        }
    }
View Full Code Here

  protected PieChartGraph playedMapsTracker = null;

  private void setupPluginMetrics()
    throws IOException
  {
    Metrics metrics = new Metrics(this);

    Set<String> mapNames = Sets.newHashSet();
    for (AutoRefMap map : AutoRefMap.getRemoteMaps())
      mapNames.add(map.getName());

    Graph gMaps = metrics.createGraph("Most Popular Maps");
    playedMapsTracker = new PieChartGraph(gMaps, mapNames);

    metrics.start();
  }
View Full Code Here

        server.getScheduler().runTaskTimerAsynchronously(this, runnable, startTime, repetitionTime);
    }

    private void startStatistics() {
        try {
            new Metrics(this).start();
        } catch (IOException ex) {
            ChestShop.getBukkitLogger().severe("There was an error while submitting statistics.");
        }
    }
View Full Code Here

    public PermissionsMetrics(PermissionsPlugin plugin) {
        this.plugin = plugin;
    }

    public void start() throws IOException {
        metrics = new Metrics(plugin);

        // don't bother with the rest if it's off
        if (metrics.isOptOut()) return;

        setupFeaturesUsed();
View Full Code Here

TOP

Related Classes of org.mcstats.Metrics

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.