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

Support 'float' and 'java.lang.Float' #76

Merged
merged 4 commits into from
Oct 16, 2015
Merged

Support 'float' and 'java.lang.Float' #76

merged 4 commits into from
Oct 16, 2015

Conversation

yannmh
Copy link
Member

@yannmh yannmh commented Oct 13, 2015

Summary

Support float and java.lang.Float attribute types as simple JMX attributes. Assert the support of these attribute types with tests.

Changes

Support float and java.lang.Float

Support float and java.lang.Float attribute types as simple JMX attributes.

TestCommon to refactor JUnit tests

Introduce a TestCommon parent class to refactor JUnit tests.
Features:

  • One-liner registerMBean method
  • One-liner initApplication nethod
  • Automatically unregister MBeans after execution of every test
  • More eye candies

assertMetric and assertCoverage methods

Add two new methods to TestCommon test class to refactor JUnit tests.

  • assertMetric: assert that a specific metric was collected
  • assertCoverage: assert that all -excluding JVM related- metrics were
    tested.

Refactor TestApp tests.

Attribute types coverage

Assert the support of these attribute types with tests.

Support 'float' and 'java.lang.Float' attribute types as simple JMX
attrbutes.
Introduce a `TestCommon` parent class to refactor JUnit tests.
Features:
* One-liner `registerMBean` method
* One-liner `initApplication` nethod
* Automatically unregister MBeans after execution of every test
* More eye candies
Add two new methods to `TestCommon` test class to refactor JUnit tests.
* `assertMetric`: assert that a specific metric was collected
* `assertCoverage`: assert that all -excluding JVM related- metrics were
tested.

Refactor `TestApp` tests.
@yannmh yannmh added this to the 5.6.0 milestone Oct 13, 2015

mbs.unregisterMBean(includeObjectName);
// First filter 27 = 13 metrics from java.lang + 14 metrics implicitly defined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

28 = 13 + 15 😉

@olivielpeau
Copy link
Member

Love the refactoring of the tests ❤️

Looks great, just tiny comments/indentation to fix, apart from that :shipit:

@yannmh
Copy link
Member Author

yannmh commented Oct 16, 2015

Thanks for the review @olivielpeau 🔢 ➕ 🔢

Assert `java.lang.Float` attribute type support.
yannmh added a commit that referenced this pull request Oct 16, 2015
Support 'float' and 'java.lang.Float'
@yannmh yannmh merged commit c1e13f3 into master Oct 16, 2015
@yannmh yannmh deleted the yann/float branch October 16, 2015 13:48
yannmh added a commit to DataDog/dd-agent that referenced this pull request Nov 3, 2015
**Changes**
* [BUGFIX] Fix bean name matching logic: `OR`→`AND`. See [#81][]
* [FEATURE] Support `float` and `java.lang.Float` attribute types as
* simple JMX attributes. See [#76][]
* [FEATURE] Support Cassandra > 2.2 metric name structure
* (CASSANDRA-4009). See [#79][]
* [FEATURE] Support custom JMX Service URL to connect to, on a
* per-instance basis. See [#80][]
* [IMPROVEMENT] Assign generic alias if not defined. See [#78][]

<!--- The following link definition list is generated by PimpMyChangelog
--->
[#76]: DataDog/jmxfetch#76
[#78]: DataDog/jmxfetch#78
[#79]: DataDog/jmxfetch#79
[#80]: DataDog/jmxfetch#80
[#81]: DataDog/jmxfetch#81
urosgruber pushed a commit to urosgruber/dd-agent that referenced this pull request Dec 23, 2015
**Changes**
* [BUGFIX] Fix bean name matching logic: `OR`→`AND`. See [DataDog#81][]
* [FEATURE] Support `float` and `java.lang.Float` attribute types as
* simple JMX attributes. See [DataDog#76][]
* [FEATURE] Support Cassandra > 2.2 metric name structure
* (CASSANDRA-4009). See [DataDog#79][]
* [FEATURE] Support custom JMX Service URL to connect to, on a
* per-instance basis. See [DataDog#80][]
* [IMPROVEMENT] Assign generic alias if not defined. See [DataDog#78][]

<!--- The following link definition list is generated by PimpMyChangelog
--->
[DataDog#76]: DataDog/jmxfetch#76
[DataDog#78]: DataDog/jmxfetch#78
[DataDog#79]: DataDog/jmxfetch#79
[DataDog#80]: DataDog/jmxfetch#80
[DataDog#81]: DataDog/jmxfetch#81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants