RuntimeTools / appmetrics

Node Application Metrics provides a foundational infrastructure for collecting resource and performance monitoring data for Node.js-based applications.
https://developer.ibm.com/open/node-application-metrics/
Apache License 2.0
978 stars 127 forks source link

mysql2 probe #541

Open realhidden opened 6 years ago

realhidden commented 6 years ago

Adds a new mysql2 probe (for package https://www.npmjs.com/package/mysql2), the mysql2 package is compatible with the original mysql one, so I used the same code and emitting 'mysql' data to be 100% compatible with the original probe and the appmetrics-dash.

codecov-io commented 6 years ago

Codecov Report

Merging #541 into master will decrease coverage by 0.3%. The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #541      +/-   ##
==========================================
- Coverage    58.5%   58.19%   -0.31%     
==========================================
  Files          48       49       +1     
  Lines        2947     2983      +36     
==========================================
+ Hits         1724     1736      +12     
- Misses       1223     1247      +24
Impacted Files Coverage Δ
probes/mysql2-probe.js 33.33% <33.33%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7a856a9...1c8f21e. Read the comment docs.

sjanuary commented 6 years ago

@realhidden - thank you for the contribution. Please read https://github.com/RuntimeTools/appmetrics/blob/master/CONTRIBUTING.md for instructions on how to contribute to appmetrics - your first PR needs to add your name into AUTHORS.md as an indication that you agree to the Contributor Licence Agreement.

It doesn't seem like we have a test for the mysql probe at the moment, would you be interested in adding one for this new probe? Tests under https://github.com/RuntimeTools/appmetrics/tree/master/tests/probes are not run by default if they require something like an external database but they are useful when writing new probes, testing changes to a probe and fixing bugs.