Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drilldown Pie - not working as expected #55

Closed
NiklasEi opened this issue Mar 14, 2018 · 4 comments
Closed

Drilldown Pie - not working as expected #55

NiklasEi opened this issue Mar 14, 2018 · 4 comments

Comments

@NiklasEi
Copy link

NiklasEi commented Mar 14, 2018

Following scenario:
I have a plugin that has some number of inventory games. Every server can have different games and a different amount of games. Now I'd like to have a drilldown pie with the number of games on the first stage and the games distribution of all servers with the same number of games on the second stage.

        metrics.addCustomChart(new Metrics.DrilldownPie("games_drill_down", () -> {
            Map<String, Map<String, Integer>> map = new HashMap<>();
            Map<String, Integer> entry = new HashMap<>();
            for (String gameID : getPluginManager().getGames().keySet()) {
                entry.put(getOriginalGameName(gameID), 1);
            }
            map.put(String.valueOf(getPluginManager().getGames().size()), entry);
            return map;
        }));

I would expect that every plugin instance gets a weight of 1 for the first stage (it's 1 time n games). So if I have 4 servers with different numbers of plugins every server gets 25% of the cake. But instead, with the code above, the value on the first stage is given by the number of games (screenshots).

I am not 100% sure that this is an issue. Maybe you want the drilldown pie to act like this, but I was ecpecting a different behaviour.

@Bastian
Copy link
Owner

Bastian commented Mar 14, 2018

Hey, thank you for the report.

Maybe you want the drilldown pie to act like this, but I was ecpecting a different behaviour.

The current behavior is exactly how it is supposed to work: The first stage just shows the amount of elements in the second stage. There are probably use-cases for both behaviors.
I don't know your plugin, so maybe I'm wrong, but wouldn't it make more sense to have the game type in the first stage and the number of games in the second stage?

@NiklasEi
Copy link
Author

I would mostly be interested in what games servers are running, if they only have a small amount of games installed. That would be a use-case for the behavior I was expecting. If I use the game names on the first stage I would have to click through all games and look at the second stages to get that kind of information.

I tried finding other usages for the implemented behavior and looked through the top 20 plugins, but was unable to find a custom Drilldown Pie. Do you have an example?

The two default Drilldown Pies (java version and operating system) are identical in both behaviors, since they always have only one entry per server.

@Bastian
Copy link
Owner

Bastian commented Mar 24, 2018

I'm not sure if there's any plugin which depends on the current behavior. I'll take a look, if I maybe can implement some kind of flag, which allows you to decide which behavior you want.

@NiklasEi
Copy link
Author

I'll close this since I no longer need it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants