当前位置: 首页>>代码示例>>Java>>正文


Java Metrics类代码示例

本文整理汇总了Java中org.mcstats.Metrics的典型用法代码示例。如果您正苦于以下问题:Java Metrics类的具体用法?Java Metrics怎么用?Java Metrics使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Metrics类属于org.mcstats包,在下文中一共展示了Metrics类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onEnable

import org.mcstats.Metrics; //导入依赖的package包/类
public void onEnable() {
	getConfig().options().copyDefaults(true);
	saveDefaultConfig();
	this.pluginconfig = new Config(this,getConfig());

	this.saveBlocks();
	this.saveMobs();
	this.saveTools();
	getBlocks();
	getMobs();
	getTools();

	/* enable metrics */
	if (pluginconfig.isMetrics()) {
		try {
			Metrics metrics = new Metrics(this);
			metrics.start();
		} catch (IOException e) {
			// Failed to submit the stats :-(
			MessageUtil.sendConsoleMessage("Failed to start Metrics!");
		}

	}


}
 
开发者ID:Ratismal,项目名称:Exchequer,代码行数:27,代码来源:Exchequer.java

示例2: setupMetrics

import org.mcstats.Metrics; //导入依赖的package包/类
/**
 * Setups metrics
 *
 * @throws IOException if fails
 */
private void setupMetrics() throws IOException {
	Metrics metrics = new Metrics(this);
	Metrics.Graph guildsAndUsersGraph = metrics.createGraph("Guilds and users");

	guildsAndUsersGraph.addPlotter(new Metrics.Plotter("Guilds") {
		@Override
		public int getValue() {
			return getGuildManager().getGuilds().size();
		}
	});

	guildsAndUsersGraph.addPlotter(new Metrics.Plotter("Users") {
		@Override
		public int getValue() {
			return getPlayerManager().getPlayers().size();
		}
	});

	metrics.start();
}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:26,代码来源:NovaGuilds.java

示例3: onEnable

import org.mcstats.Metrics; //导入依赖的package包/类
@Override
public void onEnable() {
    saveDefaultConfig();
    plugin = this;
    DEListener listener = new DEListener();
    getServer().getPluginManager().registerEvents(listener, plugin);
    boolean isBroadcast = getConfig().getBoolean("config.broadcast.use");
    if (isBroadcast) {
        DEThread deThread = new DEThread();
        deThread.start();
    }
    Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + "梦梦家高性能服务器出租");
    Bukkit.getConsoleSender().sendMessage(ChatColor.GREEN + "淘宝店 http://shop105595113.taobao.com");
    try {
        Metrics metrics = new Metrics(this);
        metrics.start();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
开发者ID:caoli5288,项目名称:DoubleExp,代码行数:21,代码来源:DEMain.java

示例4: setupMetrics

import org.mcstats.Metrics; //导入依赖的package包/类
private void setupMetrics()
{
    if (getConfig().getBoolean("MetricsEnabled"))
    {
        try
        {
            Metrics metrics = new Metrics(this);
            metrics.start();
            getLogger().info("Metrics connection established.");
        }
        catch (IOException e)
        {
            getLogger().severe("Failed to connect to mcstats.org!");
        }
    }
}
 
开发者ID:ColonelHedgehog,项目名称:Equestrian-Dash,代码行数:17,代码来源:EquestrianDash.java

示例5: onEnable

import org.mcstats.Metrics; //导入依赖的package包/类
public void onEnable() {
    plugin = this;
    parkoursManager = new ParkoursManager();
    timesManager = new TimesManager();
    playersManager = new PlayersManager();

    loadConfigs();

    setupMysql();

    getCommand("parkour").setExecutor(new PlayersCommands());
    getServer().getPluginManager().registerEvents(new PlayersListeners(), this);

    parkoursManager.loadParkours();
    timesManager.loadTimes();
    Lobby.load();

    try {
        new Metrics(this).start();
    } catch (IOException e) {
        e.printStackTrace();
    }
}
 
开发者ID:monowii,项目名称:mwParkour2,代码行数:24,代码来源:Parkour2.java

示例6: addArena

import org.mcstats.Metrics; //导入依赖的package包/类
public void addArena(final Arena arena) {
    arenasBeingPlayedGraph.addPlotter(new Metrics.Plotter(arena.getGame().getName() + " : " + arena.getName()) {
        @Override
        public int getValue() {
            if (arena.getStatus() == ArenaStatus.RUNNING) {
                return 1;
            } else {
                return 0;
            }
        }
    });
    playersInArenasGraph.addPlotter(new Metrics.Plotter(arena.getGame().getName() + " : " + arena.getName()) {
        @Override
        public int getValue() {
            return arena.getPlayers().size();
        }
    });
}
 
开发者ID:UltimateGames,项目名称:UltimateGames,代码行数:19,代码来源:MetricsManager.java

示例7: removeArena

import org.mcstats.Metrics; //导入依赖的package包/类
public void removeArena(final Arena arena) {
    arenasBeingPlayedGraph.removePlotter(new Metrics.Plotter(arena.getGame().getName() + " : " + arena.getName()) {
        @Override
        public int getValue() {
            if (arena.getStatus() == ArenaStatus.RUNNING) {
                return 1;
            } else {
                return 0;
            }
        }
    });
    playersInArenasGraph.removePlotter(new Metrics.Plotter(arena.getGame().getName() + " : " + arena.getName()) {
        @Override
        public int getValue() {
            return arena.getPlayers().size();
        }
    });
}
 
开发者ID:UltimateGames,项目名称:UltimateGames,代码行数:19,代码来源:MetricsManager.java

示例8: setQuestAmount

import org.mcstats.Metrics; //导入依赖的package包/类
private static void setQuestAmount(){
	Graph graph = metrics.createGraph("Average amount of quests");
	int range = 0;
	int interval = 5;
	for(int i = 0; i < questAmount + 1; i++){
		range = interval * i;
		if(questAmount > range && questAmount <= range + interval){
			break;
		}
	}
	graph.addPlotter(new Metrics.Plotter((range + 1) + "-" + (range + interval)){
		@Override
		public int getValue() {
			return 1;
		}
	});
}
 
开发者ID:Randehh,项目名称:EpicQuest,代码行数:18,代码来源:MetricsHandler.java

示例9: setTaskAmount

import org.mcstats.Metrics; //导入依赖的package包/类
private static void setTaskAmount() {
	Graph graph = metrics.createGraph("Average amount of tasks");
	int range = 0;
	int interval = 10;
	for(int i = 0; i < taskAmount + 1; i++){
		range = interval * i;
		if(taskAmount > range && taskAmount <= range + interval){
			break;
		}
	}
	graph.addPlotter(new Metrics.Plotter((range + 1) + "-" + (range + interval)){
		@Override
		public int getValue() {
			return 1;
		}
	});
}
 
开发者ID:Randehh,项目名称:EpicQuest,代码行数:18,代码来源:MetricsHandler.java

示例10: onEnable

import org.mcstats.Metrics; //导入依赖的package包/类
@Override
public void onEnable() {
    try {
        Metrics metrics = new Metrics(this);
        metrics.start();
    } catch (IOException e) {
        // Failed to submit the stats :-(
    }
    System.out.println(getServer().getBukkitVersion());

    LoadConfig();
}
 
开发者ID:loveyanbei,项目名称:MazePlugin,代码行数:13,代码来源:MazePlugin.java

示例11: initMetrics

import org.mcstats.Metrics; //导入依赖的package包/类
public void initMetrics() throws IOException {
    Metrics metrics = new Metrics(this);

    Metrics.Graph enabledModes = metrics.createGraph("Enabled Services");

    enabledModes.addPlotter(new Metrics.Plotter("Google Drive") {
        @Override
        public int getValue() {
            return Config.isGoogleEnabled() ? 1 : 0;
        }
    });

    enabledModes.addPlotter(new Metrics.Plotter("OneDrive") {
        @Override
        public int getValue() {
            return Config.isOnedriveEnabled() ? 1 : 0;
        }
    });

    enabledModes.addPlotter(new Metrics.Plotter("FTP") {
        @Override
        public int getValue() {
            return Config.isFtpEnabled() ? 1 : 0;
        }
    });

    enabledModes.addPlotter(new Metrics.Plotter("None") {
        @Override
        public int getValue() {
            return Config.isOnedriveEnabled() || Config.isGoogleEnabled() || Config.isFtpEnabled() ? 0 : 1;
        }
    });

    metrics.start();
}
 
开发者ID:Ratismal,项目名称:DriveBackup,代码行数:36,代码来源:DriveBackup.java

示例12: startMetrics

import org.mcstats.Metrics; //导入依赖的package包/类
protected void startMetrics () {
    try {
        Metrics metrics = new Metrics(this);
        metrics.start();
    } catch (IOException e) {
        getLogger().warning("Failed to start metrics.");
    }
}
 
开发者ID:jmshal,项目名称:meloooncensor,代码行数:9,代码来源:MelooonCensor.java

示例13: setupMetrics

import org.mcstats.Metrics; //导入依赖的package包/类
/**
 * Automatically sets up MC-Stats Metrics for you
 */ 
public void setupMetrics() {
	try {
		Metrics metrics = new Metrics(plugin);
		metrics.start();
	} catch (IOException e) {
	}
}
 
开发者ID:TheBusyBiscuit,项目名称:CS-CoreLib,代码行数:11,代码来源:PluginUtils.java

示例14: onEnable

import org.mcstats.Metrics; //导入依赖的package包/类
@Override
public void onEnable() {
	getOrRegisterDownloadPerm();
	
	getServer().getPluginManager().registerEvents(this, this);
	
	try {
		class StringPlotter extends Plotter {
			public StringPlotter(String str) {
				super(str);
			}
			
			@Override
			public int getValue() {
				return 1;
			}
		}
		
		Metrics metrics = new Metrics(this);
		
		Graph factionsVersionGraph = metrics.createGraph("factionsVersion");
		String factionsVersion = getProvidingPlugin(Factions.class)
				.getDescription().getFullName();
		factionsVersionGraph.addPlotter(new StringPlotter(factionsVersion));
		
		Graph massiveCoreVersionGraph = metrics.createGraph("massiveCoreVersion");
		String massiveCoreVersion = getProvidingPlugin(MassiveCore.class)
				.getDescription().getFullName();
		massiveCoreVersionGraph.addPlotter(new StringPlotter(massiveCoreVersion));
		
		Graph wdlcVersionGraph = metrics.createGraph("wdlcompanionVersion");
		String wdlcVersion = getProvidingPlugin(IRangeProducer.class)
				.getDescription().getFullName();
		wdlcVersionGraph.addPlotter(new StringPlotter(wdlcVersion));
		
		metrics.start();
	} catch (Exception e) {
		getLogger().warning("Failed to start PluginMetrics :(");
	}
}
 
开发者ID:Pokechu22,项目名称:WDLCompanion-Factions,代码行数:41,代码来源:FactionsSupportPlugin.java

示例15: initMetrics

import org.mcstats.Metrics; //导入依赖的package包/类
public void initMetrics() {
    if (getConfig().getBoolean("enable-metrics")) {
        try {
            Metrics metrics = new Metrics(this);
            metrics.start();
        } catch (IOException ex) {
            ex.printStackTrace();
            getLogger().severe("Failed to enable Plugin Metrics!");
        }
    }
}
 
开发者ID:caseif,项目名称:Steel,代码行数:12,代码来源:SteelMain.java


注:本文中的org.mcstats.Metrics类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。