Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristineTChen committed Feb 25, 2021
1 parent bed2d15 commit 47b860a
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions aerospike/datadog_checks/aerospike/aerospike.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,21 +170,6 @@ def check(self, _):

self.service_check(SERVICE_CHECK_UP, self.OK, tags=self._tags)

def collect_xdr(self):
# TODO: get list of datacenters. dcs command is deprecated
if self._required_datacenters:
for dc in self._required_datacenters:
data = self.get_info('get-stats:context=xdr;dc={}'.format(dc))
datacenter_tags = ['datacenter:{}'.format(dc)]
for item in data:
tags = ['datacenter_host:{}', 'datacenter_port:{}']
metric = item.split("=")
key = metric[0]
value = metric[1]
self.send(DATACENTER_METRIC_TYPE, key, value, tags)
else:
self.log.debug("No datacenters to collect XDR metrics from")

def collect_version(self):
try:
raw_version = self.get_info("build")[0]
Expand Down Expand Up @@ -243,6 +228,22 @@ def get_datacenters(self):

return datacenters

def collect_xdr(self):
# TODO: get list of datacenters. dcs command is deprecated
if self._required_datacenters:
for dc in self._required_datacenters:
datacenter_tags = ['datacenter:{}'.format(dc)]
pass
# data = self._run_command('get-stats:context=xdr;dc={}'.format(dc))
# for item in data:
# tags = ['datacenter_host:{}', 'datacenter_port:{}']
# metric = item.split("=")
# key = metric[0]
# value = metric[1]
# self.send(DATACENTER_METRIC_TYPE, key, value, tags)
else:
self.log.debug("No datacenters were specified to collect XDR metrics: %s", self._required_datacenters)

def get_client(self):
client_config = {'hosts': [self._host]}
if self._tls_config:
Expand Down

0 comments on commit 47b860a

Please sign in to comment.