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

fix(counter): replaced the unit of the latency + other #5139

Conversation

omercier
Copy link
Contributor

@omercier omercier commented Aug 12, 2024

Description

  • refactored the help
  • removed some unimplemented options
  • changed the latency unit from ms to µs

REFS: CTOR-760

Fixes #4894

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Functionality enhancement or optimization (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software

How this pull request can be tested ?

Quick and (very) dirty way to test it: rewrite the execute() sub from connector.pm to

sub execute {
    my ($self, %options) = @_;
    return JSON->new->utf8->decode('{"identity":"client-123456789","data":{"domain-987654":{"name":"XXXX","cluster_domcompmgr":{"latencyAvgRead":4873,"throughputRead":641991025,"iopsRead":16599,"iopsWrite":8232,"congestion":0,"oio":150.5,"latencyAvgWrite":287,"throughputWrite":159102785.5}}},"short_message":"OK","extra_message":"","vmware_connector_version":"3.2.5","code":0}');
}

Resulted in these results below.

No filtering, no threshold

centreon_plugins.pl --plugin=apps::vmware::connector::plugin --mode=vsan-cluster-usage --connector-hostname=toto
OK: Cluster 'XXXX' vsan backend read IOPS: 16599, write IOPS: 8232, congestions: 0, outstanding IO: 150.5 | 'cluster.vsan.backend.read.usage.iops'=16599iops;;;0; 'cluster.vsan.backend.write.usage.iops'=8232iops;;;0; 'cluster.vsan.backend.congestions.count'=0;;;0; 'cluster.vsan.backend.outstanding.io.count'=150.5;;;0; 'cluster.vsan.backend.throughput.read.bytespersecond'=641991025B/s;;;0; 'cluster.vsan.backend.throughput.write.bytespersecond'=159102785.5B/s;;;0; 'cluster.vsan.backend.latency.read.milliseconds'=4873µs;;;0; 'cluster.vsan.backend.latency.write.milliseconds'=287µs;;;0;

No filtering, with threshold

perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin --mode=vsan-cluster-usage --connector-hostname=toto --warning-backend-latency-read=1000
WARNING: Cluster 'XXXX' vsan backend read latency: 4873 µs | 'cluster.vsan.backend.read.usage.iops'=16599iops;;;0; 'cluster.vsan.backend.write.usage.iops'=8232iops;;;0; 'cluster.vsan.backend.congestions.count'=0;;;0; 'cluster.vsan.backend.outstanding.io.count'=150.5;;;0; 'cluster.vsan.backend.throughput.read.bytespersecond'=641991025B/s;;;0; 'cluster.vsan.backend.throughput.write.bytespersecond'=159102785.5B/s;;;0; 'cluster.vsan.backend.latency.read.milliseconds'=4873µs;0:1000;;0; 'cluster.vsan.backend.latency.write.milliseconds'=287µs;;;0;

With filtering, with threshold

perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin --mode=vsan-cluster-usage --connector-hostname=toto --warning-backend-latency-read=1000 --cluster-name=^X.*X$
WARNING: Cluster 'XXXX' vsan backend read latency: 4873 µs | 'cluster.vsan.backend.read.usage.iops'=16599iops;;;0; 'cluster.vsan.backend.write.usage.iops'=8232iops;;;0; 'cluster.vsan.backend.congestions.count'=0;;;0; 'cluster.vsan.backend.outstanding.io.count'=150.5;;;0; 'cluster.vsan.backend.throughput.read.bytespersecond'=641991025B/s;;;0; 'cluster.vsan.backend.throughput.write.bytespersecond'=159102785.5B/s;;;0; 'cluster.vsan.backend.latency.read.milliseconds'=4873µs;0:1000;;0; 'cluster.vsan.backend.latency.write.milliseconds'=287µs;;;0;

With bad filtering

centreon_plugins.pl --plugin=apps::vmware::connector::plugin --mode=vsan-cluster-usage --connector-hostname=toto --warning-backend-latency-read=1000 --cluster-name=^X$
UNKNOWN: No clusters found matching /^X$/ 

Checklist

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have rebased my development branch on the base branch (develop).
  • I have implemented automated tests related to my commits.
  • I have reviewed all the help messages in all the .pm files I have modified.
    • All sentences begin with a capital letter.
    • All sentences are terminated by a period.
    • I am able to understand all the help messages, if not, exchange with the PO or TW to rewrite them.

@omercier omercier force-pushed the CTOR-760-Plugin-apps-vmware-connector-Mode-vsan-cluster-usage-wrong-unit-for-cluster-vsan-backend-latency branch from 3ec396c to a1f265a Compare September 5, 2024 12:02
- refactored the help
- removed unimplemented option
- changed the latency unit from ms to µs

- fix spell
@omercier omercier force-pushed the CTOR-760-Plugin-apps-vmware-connector-Mode-vsan-cluster-usage-wrong-unit-for-cluster-vsan-backend-latency branch from a1f265a to 0d0bfa8 Compare September 5, 2024 13:56
@omercier omercier marked this pull request as ready for review September 5, 2024 15:02
@omercier omercier requested review from a team as code owners September 5, 2024 15:02
…e-vsan-cluster-usage-wrong-unit-for-cluster-vsan-backend-latency
@omercier omercier merged commit 95bff5f into develop Sep 17, 2024
21 checks passed
@omercier omercier deleted the CTOR-760-Plugin-apps-vmware-connector-Mode-vsan-cluster-usage-wrong-unit-for-cluster-vsan-backend-latency branch September 17, 2024 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants