This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2019-05-28 12:05:26,872 <DEBUG> <main > <[]> <{}> < org.javacord.core.DiscordApiBuilderDelegateImpl> Creating shard 1 of 1 | |
2019-05-28 12:05:27,114 <DEBUG> <acord - Central ExecutorService - 2> <[]> <{shard=0}> < org.javacord.core.util.rest.RestRequest> Trying to send GET request to https://discordapp.com/api/v6/gateway | |
2019-05-28 12:05:27,382 <DEBUG> <acord - Central ExecutorService - 2> <[]> <{shard=0}> < org.javacord.core.util.rest.RestRequest> Sent GET request to https://discordapp.com/api/v6/gateway and received status code 200 with body {"url": "wss://gateway.discord.gg"} | |
2019-05-28 12:05:27,388 <DEBUG> <acord - Central ExecutorService - 2> <[]> <{shard=0}> < org.javacord.core.util.ratelimit.RatelimitManager> Calculated an offset of -383 to the Discord time. | |
2019-05-28 12:05:28,363 <DEBUG> <ReadingThread > <[]> <{shard=0}> <javacord.core.util.gateway.DiscordWebSocketAdapter> Received HELLO packet | |
2019-05-28 12:05:28,374 <DEBUG> <Rea |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.bstats; | |
import org.json.simple.JSONArray; | |
import org.json.simple.JSONObject; | |
import javax.net.ssl.HttpsURLConnection; | |
import java.io.BufferedReader; | |
import java.io.ByteArrayOutputStream; | |
import java.io.DataOutputStream; | |
import java.io.IOException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onEnable() { | |
Metrics metrics = new Metrics(this); | |
// A simple bar chart for only one bar per category | |
metrics.addCustomChart(new SimpleBarChart("exampleBar", new Callable<Map<String, Integer>>() { | |
@Override | |
public Map<String, Integer> call() throws Exception { | |
Map<String, Integer> map = new HashMap<>(); | |
map.put("Feature 1", 1); | |
return map; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onEnable() { | |
Metrics metrics = new Metrics(this); | |
metrics.addCustomChart(new DrilldownPie("java_version", () -> { | |
Map<String, Map<String, Integer>> map = new HashMap<>(); | |
String javaVersion = System.getProperty("java.version"); | |
Map<String, Integer> entry = new HashMap<>(); | |
entry.put(javaVersion, 1); | |
if (javaVersion.startsWith("1.7")) { | |
map.put("Java 1.7", entry); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.bstats; | |
import org.json.simple.JSONArray; | |
import org.json.simple.JSONObject; | |
import javax.net.ssl.HttpsURLConnection; | |
import java.io.ByteArrayOutputStream; | |
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import java.net.URL; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onEnable() { | |
// All you have to do is adding this line in your onEnable method: | |
Metrics metrics = new Metrics(this); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~invalid~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Plugin(id = "exampleplugin", name = "ExamplePlugin", version = "1.0") | |
public class Main { | |
@Inject | |
private Metrics metrics; | |
@Listener | |
public void onServerStart(GameStartedServerEvent event) { | |
// No need to call a constructor or any method. | |
// The metrics field gets initialised using @Inject :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~invalid~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onEnable() { | |
Metrics metrics = new Metrics(this); | |
metrics.addCustomChart(new MultiLineChart("players_and_servers", new Callable<Map<String, Integer>>() { | |
@Override | |
public Map<String, Integer> call() throws Exception { | |
Map<String, Integer> valueMap = new HashMap<>(); | |
valueMap.put("servers", 1); | |
valueMap.put("players", Bukkit.getOnlinePlayers().size()); | |
return valueMap; |
NewerOlder