jmxtrans / jmxtrans-agent

Java Agent based JMX metrics exporter.
MIT License
179 stars 110 forks source link

Question: 2 Query constructors assume attribute name as the resultAlias #38

Closed maheshkelkar closed 8 years ago

maheshkelkar commented 9 years ago

Following 2 constructors for Query assume resultAlias as the attributeName.

This works fine if we are polling limited set of attributes and attribute names are self-explanatory. However, with the #34 we are allowing capability to export all the attributes and that IMO makes this assumption unnecessary.

If user does not specify the resultAlias, then we can rely on ResultNameStrategy to generate the appropriate name comprised of <objectname>.<attribute-name>.

    /**
     * @see #Query(String, String, String, Integer, String, String, ResultNameStrategy)
     */
    public Query(@Nonnull String objectName, @Nullable String attribute, @Nonnull ResultNameStrategy resultNameStrategy) {
        this(objectName, attribute, null, null, null, attribute, resultNameStrategy);
    }

    /**
     * @see #Query(String, String, String, Integer, String, String, ResultNameStrategy)
     */
    public Query(@Nonnull String objectName, @Nullable String attribute, int position, @Nonnull ResultNameStrategy resultNameStrategy) {
        this(objectName, attribute, null, position, null, attribute, resultNameStrategy);
    }

Sponsored by: Lookout, Inc.

maheshkelkar commented 9 years ago

@cyrille-leclerc please let me know your thoughts on this.

cyrille-leclerc commented 9 years ago

@maheshkelkar I am super busy with my day job (CloudBees).

Can you be patient? I could more easily work on this next week.

Sorry, Cyrille

maheshkelkar commented 9 years ago

@cyrille-leclerc Sure, I understand. But, whenever you take a look, please respond to all the issues & pull requests (i.e. in bulk), so that we can make good progress.

Also, dont forget about it :)

kerlandsson commented 8 years ago

I'm closing this due to its age and the many changes since its report.