Added Graph "Shop Type" to Statistics Page (Still Testing)

This commit is contained in:
Eric 2015-09-16 21:16:21 +02:00
parent 375c37b7dc
commit 49530f806d
2 changed files with 34 additions and 1 deletions

View File

@ -2,7 +2,7 @@
name: ShopChest name: ShopChest
main: de.epiceric.shopchest.ShopChest main: de.epiceric.shopchest.ShopChest
version: 1.6.0 version: 1.6.0.1
author: EpicEric author: EpicEric
website: https://www.spigotmc.org/resources/shopchest.11431/ website: https://www.spigotmc.org/resources/shopchest.11431/
depend: [Vault] depend: [Vault]

View File

@ -39,6 +39,8 @@ import de.epiceric.shopchest.interfaces.jsonbuilder.JsonBuilder_R1;
import de.epiceric.shopchest.interfaces.jsonbuilder.JsonBuilder_R2; import de.epiceric.shopchest.interfaces.jsonbuilder.JsonBuilder_R2;
import de.epiceric.shopchest.interfaces.jsonbuilder.JsonBuilder_R3; import de.epiceric.shopchest.interfaces.jsonbuilder.JsonBuilder_R3;
import de.epiceric.shopchest.utils.Metrics; import de.epiceric.shopchest.utils.Metrics;
import de.epiceric.shopchest.utils.Metrics.Graph;
import de.epiceric.shopchest.utils.Metrics.Plotter;
import de.epiceric.shopchest.utils.ShopUtils; import de.epiceric.shopchest.utils.ShopUtils;
import de.epiceric.shopchest.utils.UpdateChecker; import de.epiceric.shopchest.utils.UpdateChecker;
import net.milkbowl.vault.economy.Economy; import net.milkbowl.vault.economy.Economy;
@ -104,6 +106,37 @@ public class ShopChest extends JavaPlugin{
try { try {
Metrics metrics = new Metrics(this); Metrics metrics = new Metrics(this);
Graph shopType = metrics.createGraph("Shop Type");
shopType.addPlotter(new Plotter("Infinite") {
@Override
public int getValue() {
int value = 0;
for (Shop shop : ShopUtils.getShops()) {
if (shop.isInfinite()) value++;
}
return value;
}
});
shopType.addPlotter(new Plotter("Normal") {
@Override
public int getValue() {
int value = 0;
for (Shop shop : ShopUtils.getShops()) {
if (!shop.isInfinite()) value++;
}
return value;
}
});
metrics.start(); metrics.start();
} catch (IOException e) { } catch (IOException e) {
logger.severe("Could not submit stats."); logger.severe("Could not submit stats.");