repo
stringlengths
7
54
path
stringlengths
4
223
func_name
stringlengths
1
134
original_string
stringlengths
75
104k
language
stringclasses
1 value
code
stringlengths
75
104k
code_tokens
listlengths
20
28.4k
docstring
stringlengths
1
46.3k
docstring_tokens
listlengths
1
1.66k
sha
stringlengths
40
40
url
stringlengths
87
315
partition
stringclasses
1 value
summary
stringlengths
4
350
obf_code
stringlengths
7.85k
764k
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/agent/requirements.py
requirements
def requirements(ctx): """Write the `requirements-agent-release.txt` file at the root of the repo listing all the Agent-based integrations pinned at the version they currently have in HEAD. """ echo_info('Freezing check releases') checks = get_valid_checks() checks.remove('datadog_checks_dev...
python
def requirements(ctx): """Write the `requirements-agent-release.txt` file at the root of the repo listing all the Agent-based integrations pinned at the version they currently have in HEAD. """ echo_info('Freezing check releases') checks = get_valid_checks() checks.remove('datadog_checks_dev...
[ "def", "requirements", "(", "ctx", ")", ":", "echo_info", "(", "'Freezing check releases'", ")", "checks", "=", "get_valid_checks", "(", ")", "checks", ".", "remove", "(", "'datadog_checks_dev'", ")", "entries", "=", "[", "]", "for", "check", "in", "checks", ...
Write the `requirements-agent-release.txt` file at the root of the repo listing all the Agent-based integrations pinned at the version they currently have in HEAD.
[ "Write", "the", "requirements", "-", "agent", "-", "release", ".", "txt", "file", "at", "the", "root", "of", "the", "repo", "listing", "all", "the", "Agent", "-", "based", "integrations", "pinned", "at", "the", "version", "they", "currently", "have", "in",...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/agent/requirements.py#L20-L46
train
Write the requirements - agent - release. txt file at the root of the repo .
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
nginx/datadog_checks/nginx/nginx.py
Nginx._nest_payload
def _nest_payload(self, keys, payload): """ Nest a payload in a dict under the keys contained in `keys` """ if len(keys) == 0: return payload return {keys[0]: self._nest_payload(keys[1:], payload)}
python
def _nest_payload(self, keys, payload): """ Nest a payload in a dict under the keys contained in `keys` """ if len(keys) == 0: return payload return {keys[0]: self._nest_payload(keys[1:], payload)}
[ "def", "_nest_payload", "(", "self", ",", "keys", ",", "payload", ")", ":", "if", "len", "(", "keys", ")", "==", "0", ":", "return", "payload", "return", "{", "keys", "[", "0", "]", ":", "self", ".", "_nest_payload", "(", "keys", "[", "1", ":", "...
Nest a payload in a dict under the keys contained in `keys`
[ "Nest", "a", "payload", "in", "a", "dict", "under", "the", "keys", "contained", "in", "keys" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/nginx/datadog_checks/nginx/nginx.py#L194-L201
train
Nest a payload in a dict under the keys contained in keys
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
nginx/datadog_checks/nginx/nginx.py
Nginx._flatten_json
def _flatten_json(cls, metric_base, val, tags): """ Recursively flattens the nginx json object. Returns the following: [(metric_name, value, tags)] """ output = [] if isinstance(val, dict): # Pull out the server as a tag instead of trying to read as a metric ...
python
def _flatten_json(cls, metric_base, val, tags): """ Recursively flattens the nginx json object. Returns the following: [(metric_name, value, tags)] """ output = [] if isinstance(val, dict): # Pull out the server as a tag instead of trying to read as a metric ...
[ "def", "_flatten_json", "(", "cls", ",", "metric_base", ",", "val", ",", "tags", ")", ":", "output", "=", "[", "]", "if", "isinstance", "(", "val", ",", "dict", ")", ":", "# Pull out the server as a tag instead of trying to read as a metric", "if", "'server'", "...
Recursively flattens the nginx json object. Returns the following: [(metric_name, value, tags)]
[ "Recursively", "flattens", "the", "nginx", "json", "object", ".", "Returns", "the", "following", ":", "[", "(", "metric_name", "value", "tags", ")", "]" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/nginx/datadog_checks/nginx/nginx.py#L275-L320
train
Recursively flattens the nginx json object. Returns the following list of tuples.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/agent/common.py
get_agent_tags
def get_agent_tags(since, to): """ Return a list of tags from integrations-core representing an Agent release, sorted by more recent first. """ agent_tags = sorted(parse_version_info(t) for t in git_tag_list(r'^\d+\.\d+\.\d+$')) # default value for `to` is the latest tag if to: to =...
python
def get_agent_tags(since, to): """ Return a list of tags from integrations-core representing an Agent release, sorted by more recent first. """ agent_tags = sorted(parse_version_info(t) for t in git_tag_list(r'^\d+\.\d+\.\d+$')) # default value for `to` is the latest tag if to: to =...
[ "def", "get_agent_tags", "(", "since", ",", "to", ")", ":", "agent_tags", "=", "sorted", "(", "parse_version_info", "(", "t", ")", "for", "t", "in", "git_tag_list", "(", "r'^\\d+\\.\\d+\\.\\d+$'", ")", ")", "# default value for `to` is the latest tag", "if", "to",...
Return a list of tags from integrations-core representing an Agent release, sorted by more recent first.
[ "Return", "a", "list", "of", "tags", "from", "integrations", "-", "core", "representing", "an", "Agent", "release", "sorted", "by", "more", "recent", "first", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/agent/common.py#L9-L28
train
Return a list of tags from integrations - core representing an Agent release sorted by recent first.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/run.py
run
def run(ctx, args): """Run commands in the proper repo.""" if not args: click.echo(ctx.get_help()) return with chdir(get_root()): result = run_command(args) ctx.exit(result.code)
python
def run(ctx, args): """Run commands in the proper repo.""" if not args: click.echo(ctx.get_help()) return with chdir(get_root()): result = run_command(args) ctx.exit(result.code)
[ "def", "run", "(", "ctx", ",", "args", ")", ":", "if", "not", "args", ":", "click", ".", "echo", "(", "ctx", ".", "get_help", "(", ")", ")", "return", "with", "chdir", "(", "get_root", "(", ")", ")", ":", "result", "=", "run_command", "(", "args"...
Run commands in the proper repo.
[ "Run", "commands", "in", "the", "proper", "repo", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/run.py#L15-L24
train
Run commands in the proper repo.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
teamcity/datadog_checks/teamcity/teamcity.py
TeamCityCheck._normalize_server_url
def _normalize_server_url(self, server): """ Check if the server URL starts with a HTTP or HTTPS scheme, fall back to http if not present """ server = server if server.startswith(("http://", "https://")) else "http://{}".format(server) return server
python
def _normalize_server_url(self, server): """ Check if the server URL starts with a HTTP or HTTPS scheme, fall back to http if not present """ server = server if server.startswith(("http://", "https://")) else "http://{}".format(server) return server
[ "def", "_normalize_server_url", "(", "self", ",", "server", ")", ":", "server", "=", "server", "if", "server", ".", "startswith", "(", "(", "\"http://\"", ",", "\"https://\"", ")", ")", "else", "\"http://{}\"", ".", "format", "(", "server", ")", "return", ...
Check if the server URL starts with a HTTP or HTTPS scheme, fall back to http if not present
[ "Check", "if", "the", "server", "URL", "starts", "with", "a", "HTTP", "or", "HTTPS", "scheme", "fall", "back", "to", "http", "if", "not", "present" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/teamcity/datadog_checks/teamcity/teamcity.py#L91-L96
train
Normalize the server URL.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
elastic/datadog_checks/elastic/elastic.py
ESCheck._get_es_version
def _get_es_version(self, config): """ Get the running version of elasticsearch. """ try: data = self._get_data(config.url, config, send_sc=False) # pre-release versions of elasticearch are suffixed with -rcX etc.. # peel that off so that the map below...
python
def _get_es_version(self, config): """ Get the running version of elasticsearch. """ try: data = self._get_data(config.url, config, send_sc=False) # pre-release versions of elasticearch are suffixed with -rcX etc.. # peel that off so that the map below...
[ "def", "_get_es_version", "(", "self", ",", "config", ")", ":", "try", ":", "data", "=", "self", ".", "_get_data", "(", "config", ".", "url", ",", "config", ",", "send_sc", "=", "False", ")", "# pre-release versions of elasticearch are suffixed with -rcX etc..", ...
Get the running version of elasticsearch.
[ "Get", "the", "running", "version", "of", "elasticsearch", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/elastic/datadog_checks/elastic/elastic.py#L100-L118
train
Get the running version of elasticsearch.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
elastic/datadog_checks/elastic/elastic.py
ESCheck._join_url
def _join_url(self, base, url, admin_forwarder=False): """ overrides `urlparse.urljoin` since it removes base url path https://docs.python.org/2/library/urlparse.html#urlparse.urljoin """ if admin_forwarder: return base + url else: return urljoin(b...
python
def _join_url(self, base, url, admin_forwarder=False): """ overrides `urlparse.urljoin` since it removes base url path https://docs.python.org/2/library/urlparse.html#urlparse.urljoin """ if admin_forwarder: return base + url else: return urljoin(b...
[ "def", "_join_url", "(", "self", ",", "base", ",", "url", ",", "admin_forwarder", "=", "False", ")", ":", "if", "admin_forwarder", ":", "return", "base", "+", "url", "else", ":", "return", "urljoin", "(", "base", ",", "url", ")" ]
overrides `urlparse.urljoin` since it removes base url path https://docs.python.org/2/library/urlparse.html#urlparse.urljoin
[ "overrides", "urlparse", ".", "urljoin", "since", "it", "removes", "base", "url", "path", "https", ":", "//", "docs", ".", "python", ".", "org", "/", "2", "/", "library", "/", "urlparse", ".", "html#urlparse", ".", "urljoin" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/elastic/datadog_checks/elastic/elastic.py#L120-L128
train
Join base url with url.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
elastic/datadog_checks/elastic/elastic.py
ESCheck._get_urls
def _get_urls(self, version, cluster_stats): """ Compute the URLs we need to hit depending on the running ES version """ pshard_stats_url = "/_stats" health_url = "/_cluster/health" if version >= [0, 90, 10]: pending_tasks_url = "/_cluster/pending_tasks" ...
python
def _get_urls(self, version, cluster_stats): """ Compute the URLs we need to hit depending on the running ES version """ pshard_stats_url = "/_stats" health_url = "/_cluster/health" if version >= [0, 90, 10]: pending_tasks_url = "/_cluster/pending_tasks" ...
[ "def", "_get_urls", "(", "self", ",", "version", ",", "cluster_stats", ")", ":", "pshard_stats_url", "=", "\"/_stats\"", "health_url", "=", "\"/_cluster/health\"", "if", "version", ">=", "[", "0", ",", "90", ",", "10", "]", ":", "pending_tasks_url", "=", "\"...
Compute the URLs we need to hit depending on the running ES version
[ "Compute", "the", "URLs", "we", "need", "to", "hit", "depending", "on", "the", "running", "ES", "version" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/elastic/datadog_checks/elastic/elastic.py#L165-L183
train
Compute the URLs we need to hit depending on the running ES version.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
elastic/datadog_checks/elastic/elastic.py
ESCheck._get_data
def _get_data(self, url, config, send_sc=True): """ Hit a given URL and return the parsed json """ # Load basic authentication configuration, if available. if config.username and config.password: auth = (config.username, config.password) else: auth...
python
def _get_data(self, url, config, send_sc=True): """ Hit a given URL and return the parsed json """ # Load basic authentication configuration, if available. if config.username and config.password: auth = (config.username, config.password) else: auth...
[ "def", "_get_data", "(", "self", ",", "url", ",", "config", ",", "send_sc", "=", "True", ")", ":", "# Load basic authentication configuration, if available.", "if", "config", ".", "username", "and", "config", ".", "password", ":", "auth", "=", "(", "config", "...
Hit a given URL and return the parsed json
[ "Hit", "a", "given", "URL", "and", "return", "the", "parsed", "json" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/elastic/datadog_checks/elastic/elastic.py#L185-L233
train
Get data from an ElasticSearch URL.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
elastic/datadog_checks/elastic/elastic.py
ESCheck._process_metric
def _process_metric(self, data, metric, xtype, path, xform=None, tags=None, hostname=None): """ data: dictionary containing all the stats metric: datadog metric path: corresponding path in data, flattened, e.g. thread_pool.bulk.queue xform: a lambda to apply to the numerical valu...
python
def _process_metric(self, data, metric, xtype, path, xform=None, tags=None, hostname=None): """ data: dictionary containing all the stats metric: datadog metric path: corresponding path in data, flattened, e.g. thread_pool.bulk.queue xform: a lambda to apply to the numerical valu...
[ "def", "_process_metric", "(", "self", ",", "data", ",", "metric", ",", "xtype", ",", "path", ",", "xform", "=", "None", ",", "tags", "=", "None", ",", "hostname", "=", "None", ")", ":", "value", "=", "data", "# Traverse the nested dictionaries", "for", ...
data: dictionary containing all the stats metric: datadog metric path: corresponding path in data, flattened, e.g. thread_pool.bulk.queue xform: a lambda to apply to the numerical value
[ "data", ":", "dictionary", "containing", "all", "the", "stats", "metric", ":", "datadog", "metric", "path", ":", "corresponding", "path", "in", "data", "flattened", "e", ".", "g", ".", "thread_pool", ".", "bulk", ".", "queue", "xform", ":", "a", "lambda", ...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/elastic/datadog_checks/elastic/elastic.py#L284-L308
train
Process a metric from the data dictionary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/utils/limiter.py
Limiter.reset
def reset(self): """ Resets state and uid set. To be called asap to free memory """ self.reached_limit = False self.count = 0 self.seen.clear()
python
def reset(self): """ Resets state and uid set. To be called asap to free memory """ self.reached_limit = False self.count = 0 self.seen.clear()
[ "def", "reset", "(", "self", ")", ":", "self", ".", "reached_limit", "=", "False", "self", ".", "count", "=", "0", "self", ".", "seen", ".", "clear", "(", ")" ]
Resets state and uid set. To be called asap to free memory
[ "Resets", "state", "and", "uid", "set", ".", "To", "be", "called", "asap", "to", "free", "memory" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/utils/limiter.py#L29-L35
train
Resets the state and uid set.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/utils/limiter.py
Limiter.is_reached
def is_reached(self, uid=None): """ is_reached is to be called for every object that counts towards the limit. - When called with no uid, the Limiter assumes this is a new object and unconditionally increments the counter (less CPU and memory usage). - When a given object can be ...
python
def is_reached(self, uid=None): """ is_reached is to be called for every object that counts towards the limit. - When called with no uid, the Limiter assumes this is a new object and unconditionally increments the counter (less CPU and memory usage). - When a given object can be ...
[ "def", "is_reached", "(", "self", ",", "uid", "=", "None", ")", ":", "if", "self", ".", "reached_limit", ":", "return", "True", "if", "uid", ":", "if", "uid", "in", "self", ".", "seen", ":", "return", "False", "self", ".", "count", "+=", "1", "self...
is_reached is to be called for every object that counts towards the limit. - When called with no uid, the Limiter assumes this is a new object and unconditionally increments the counter (less CPU and memory usage). - When a given object can be passed multiple times, a uid must be provided to ...
[ "is_reached", "is", "to", "be", "called", "for", "every", "object", "that", "counts", "towards", "the", "limit", ".", "-", "When", "called", "with", "no", "uid", "the", "Limiter", "assumes", "this", "is", "a", "new", "object", "and", "unconditionally", "in...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/utils/limiter.py#L37-L68
train
This method is called when the count of the object is exceeded the limit.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py
KafkaCheck._get_broker_offsets
def _get_broker_offsets(self, instance, topics): """ Fetch highwater offsets for each topic/partition from Kafka cluster. Do this for all partitions in the cluster because even if it has no consumers, we may want to measure whether producers are successfully producing. No need t...
python
def _get_broker_offsets(self, instance, topics): """ Fetch highwater offsets for each topic/partition from Kafka cluster. Do this for all partitions in the cluster because even if it has no consumers, we may want to measure whether producers are successfully producing. No need t...
[ "def", "_get_broker_offsets", "(", "self", ",", "instance", ",", "topics", ")", ":", "# Connect to Kafka", "highwater_offsets", "=", "{", "}", "topic_partitions_without_a_leader", "=", "[", "]", "topics_to_fetch", "=", "defaultdict", "(", "set", ")", "cli", "=", ...
Fetch highwater offsets for each topic/partition from Kafka cluster. Do this for all partitions in the cluster because even if it has no consumers, we may want to measure whether producers are successfully producing. No need to limit this for performance because fetching broker offsets ...
[ "Fetch", "highwater", "offsets", "for", "each", "topic", "/", "partition", "from", "Kafka", "cluster", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py#L291-L346
train
Get the highwater offsets for each topic and partition.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py
KafkaCheck._get_zk_path_children
def _get_zk_path_children(self, zk_conn, zk_path, name_for_error): """Fetch child nodes for a given Zookeeper path.""" children = [] try: children = zk_conn.get_children(zk_path) except NoNodeError: self.log.info('No zookeeper node at %s', zk_path) except ...
python
def _get_zk_path_children(self, zk_conn, zk_path, name_for_error): """Fetch child nodes for a given Zookeeper path.""" children = [] try: children = zk_conn.get_children(zk_path) except NoNodeError: self.log.info('No zookeeper node at %s', zk_path) except ...
[ "def", "_get_zk_path_children", "(", "self", ",", "zk_conn", ",", "zk_path", ",", "name_for_error", ")", ":", "children", "=", "[", "]", "try", ":", "children", "=", "zk_conn", ".", "get_children", "(", "zk_path", ")", "except", "NoNodeError", ":", "self", ...
Fetch child nodes for a given Zookeeper path.
[ "Fetch", "child", "nodes", "for", "a", "given", "Zookeeper", "path", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py#L396-L405
train
Fetch child nodes for a given Zookeeper path.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py
KafkaCheck._get_zk_consumer_offsets
def _get_zk_consumer_offsets(self, zk_hosts_ports, consumer_groups=None, zk_prefix=''): """ Fetch Consumer Group offsets from Zookeeper. Also fetch consumer_groups, topics, and partitions if not already specified in consumer_groups. :param dict consumer_groups: The consumer gro...
python
def _get_zk_consumer_offsets(self, zk_hosts_ports, consumer_groups=None, zk_prefix=''): """ Fetch Consumer Group offsets from Zookeeper. Also fetch consumer_groups, topics, and partitions if not already specified in consumer_groups. :param dict consumer_groups: The consumer gro...
[ "def", "_get_zk_consumer_offsets", "(", "self", ",", "zk_hosts_ports", ",", "consumer_groups", "=", "None", ",", "zk_prefix", "=", "''", ")", ":", "zk_consumer_offsets", "=", "{", "}", "# Construct the Zookeeper path pattern", "# /consumers/[groupId]/offsets/[topic]/[partit...
Fetch Consumer Group offsets from Zookeeper. Also fetch consumer_groups, topics, and partitions if not already specified in consumer_groups. :param dict consumer_groups: The consumer groups, topics, and partitions that you want to fetch offsets for. If consumer_groups is None, will...
[ "Fetch", "Consumer", "Group", "offsets", "from", "Zookeeper", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py#L407-L476
train
Fetch consumer group offsets from Zookeeper.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py
KafkaCheck._get_kafka_consumer_offsets
def _get_kafka_consumer_offsets(self, instance, consumer_groups): """ retrieve consumer offsets via the new consumer api. Offsets in this version are stored directly in kafka (__consumer_offsets topic) rather than in zookeeper """ consumer_offsets = {} topics = defaultdic...
python
def _get_kafka_consumer_offsets(self, instance, consumer_groups): """ retrieve consumer offsets via the new consumer api. Offsets in this version are stored directly in kafka (__consumer_offsets topic) rather than in zookeeper """ consumer_offsets = {} topics = defaultdic...
[ "def", "_get_kafka_consumer_offsets", "(", "self", ",", "instance", ",", "consumer_groups", ")", ":", "consumer_offsets", "=", "{", "}", "topics", "=", "defaultdict", "(", "set", ")", "cli", "=", "self", ".", "_get_kafka_client", "(", "instance", ")", "for", ...
retrieve consumer offsets via the new consumer api. Offsets in this version are stored directly in kafka (__consumer_offsets topic) rather than in zookeeper
[ "retrieve", "consumer", "offsets", "via", "the", "new", "consumer", "api", ".", "Offsets", "in", "this", "version", "are", "stored", "directly", "in", "kafka", "(", "__consumer_offsets", "topic", ")", "rather", "than", "in", "zookeeper" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py#L478-L504
train
retrieve consumer offsets via the new consumer api
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py
KafkaCheck._validate_explicit_consumer_groups
def _validate_explicit_consumer_groups(cls, val): """Validate any explicitly specified consumer groups. While the check does not require specifying consumer groups, if they are specified this method should be used to validate them. val = {'consumer_group': {'topic': [0, 1]}} ""...
python
def _validate_explicit_consumer_groups(cls, val): """Validate any explicitly specified consumer groups. While the check does not require specifying consumer groups, if they are specified this method should be used to validate them. val = {'consumer_group': {'topic': [0, 1]}} ""...
[ "def", "_validate_explicit_consumer_groups", "(", "cls", ",", "val", ")", ":", "assert", "isinstance", "(", "val", ",", "dict", ")", "for", "consumer_group", ",", "topics", "in", "iteritems", "(", "val", ")", ":", "assert", "isinstance", "(", "consumer_group",...
Validate any explicitly specified consumer groups. While the check does not require specifying consumer groups, if they are specified this method should be used to validate them. val = {'consumer_group': {'topic': [0, 1]}}
[ "Validate", "any", "explicitly", "specified", "consumer", "groups", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py#L548-L568
train
Validate any explicitly specified consumer groups.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py
KafkaCheck._send_event
def _send_event(self, title, text, tags, event_type, aggregation_key, severity='info'): """Emit an event to the Datadog Event Stream.""" event_dict = { 'timestamp': int(time()), 'source_type_name': self.SOURCE_TYPE_NAME, 'msg_title': title, 'event_type': e...
python
def _send_event(self, title, text, tags, event_type, aggregation_key, severity='info'): """Emit an event to the Datadog Event Stream.""" event_dict = { 'timestamp': int(time()), 'source_type_name': self.SOURCE_TYPE_NAME, 'msg_title': title, 'event_type': e...
[ "def", "_send_event", "(", "self", ",", "title", ",", "text", ",", "tags", ",", "event_type", ",", "aggregation_key", ",", "severity", "=", "'info'", ")", ":", "event_dict", "=", "{", "'timestamp'", ":", "int", "(", "time", "(", ")", ")", ",", "'source...
Emit an event to the Datadog Event Stream.
[ "Emit", "an", "event", "to", "the", "Datadog", "Event", "Stream", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kafka_consumer/datadog_checks/kafka_consumer/kafka_consumer.py#L570-L582
train
Emit an event to the Datadog Event Stream.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/dep.py
display_package_changes
def display_package_changes(pre_packages, post_packages, indent=''): """ Print packages that've been added, removed or changed """ # use package name to determine what's changed pre_package_names = {p.name: p for p in pre_packages} post_package_names = {p.name: p for p in post_packages} add...
python
def display_package_changes(pre_packages, post_packages, indent=''): """ Print packages that've been added, removed or changed """ # use package name to determine what's changed pre_package_names = {p.name: p for p in pre_packages} post_package_names = {p.name: p for p in post_packages} add...
[ "def", "display_package_changes", "(", "pre_packages", ",", "post_packages", ",", "indent", "=", "''", ")", ":", "# use package name to determine what's changed", "pre_package_names", "=", "{", "p", ".", "name", ":", "p", "for", "p", "in", "pre_packages", "}", "po...
Print packages that've been added, removed or changed
[ "Print", "packages", "that", "ve", "been", "added", "removed", "or", "changed" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/dep.py#L15-L48
train
Print packages that have been added removed or changed.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/dep.py
resolve
def resolve(checks, lazy, quiet): """Resolve transient dependencies for any number of checks. If you want to do this en masse, put `all`. """ root = get_root() if 'all' in checks: checks = os.listdir(root) for check_name in sorted(checks): pinned_reqs_file = os.path.join(root, c...
python
def resolve(checks, lazy, quiet): """Resolve transient dependencies for any number of checks. If you want to do this en masse, put `all`. """ root = get_root() if 'all' in checks: checks = os.listdir(root) for check_name in sorted(checks): pinned_reqs_file = os.path.join(root, c...
[ "def", "resolve", "(", "checks", ",", "lazy", ",", "quiet", ")", ":", "root", "=", "get_root", "(", ")", "if", "'all'", "in", "checks", ":", "checks", "=", "os", ".", "listdir", "(", "root", ")", "for", "check_name", "in", "sorted", "(", "checks", ...
Resolve transient dependencies for any number of checks. If you want to do this en masse, put `all`.
[ "Resolve", "transient", "dependencies", "for", "any", "number", "of", "checks", ".", "If", "you", "want", "to", "do", "this", "en", "masse", "put", "all", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/dep.py#L60-L86
train
Resolve transient dependencies for any number of checks.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/dep.py
pin
def pin(package, version, checks, marker, resolving, lazy, quiet): """Pin a dependency for all checks that require it. This can also resolve transient dependencies. Setting the version to `none` will remove the package. You can specify an unlimited number of additional checks to apply the pin for v...
python
def pin(package, version, checks, marker, resolving, lazy, quiet): """Pin a dependency for all checks that require it. This can also resolve transient dependencies. Setting the version to `none` will remove the package. You can specify an unlimited number of additional checks to apply the pin for v...
[ "def", "pin", "(", "package", ",", "version", ",", "checks", ",", "marker", ",", "resolving", ",", "lazy", ",", "quiet", ")", ":", "root", "=", "get_root", "(", ")", "package_name", "=", "package", ".", "lower", "(", ")", "version", "=", "version", "...
Pin a dependency for all checks that require it. This can also resolve transient dependencies. Setting the version to `none` will remove the package. You can specify an unlimited number of additional checks to apply the pin for via arguments.
[ "Pin", "a", "dependency", "for", "all", "checks", "that", "require", "it", ".", "This", "can", "also", "resolve", "transient", "dependencies", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/dep.py#L97-L144
train
Pin a dependency for all checks that require it.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/dep.py
freeze
def freeze(): """Combine all dependencies for the Agent's static environment.""" echo_waiting('Verifying collected packages...') catalog, errors = make_catalog() if errors: for error in errors: echo_failure(error) abort() static_file = get_agent_requirements() echo_...
python
def freeze(): """Combine all dependencies for the Agent's static environment.""" echo_waiting('Verifying collected packages...') catalog, errors = make_catalog() if errors: for error in errors: echo_failure(error) abort() static_file = get_agent_requirements() echo_...
[ "def", "freeze", "(", ")", ":", "echo_waiting", "(", "'Verifying collected packages...'", ")", "catalog", ",", "errors", "=", "make_catalog", "(", ")", "if", "errors", ":", "for", "error", "in", "errors", ":", "echo_failure", "(", "error", ")", "abort", "(",...
Combine all dependencies for the Agent's static environment.
[ "Combine", "all", "dependencies", "for", "the", "Agent", "s", "static", "environment", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/dep.py#L150-L168
train
Combine all dependencies for the Agent s static environment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/env/reload.py
reload_env
def reload_env(check, env): """Restart an Agent to detect environment changes.""" envs = get_configured_envs(check) if not envs: echo_failure('No active environments found for `{}`.'.format(check)) echo_info('See what is available to start via `ddev env ls {}`.'.format(check)) abort(...
python
def reload_env(check, env): """Restart an Agent to detect environment changes.""" envs = get_configured_envs(check) if not envs: echo_failure('No active environments found for `{}`.'.format(check)) echo_info('See what is available to start via `ddev env ls {}`.'.format(check)) abort(...
[ "def", "reload_env", "(", "check", ",", "env", ")", ":", "envs", "=", "get_configured_envs", "(", "check", ")", "if", "not", "envs", ":", "echo_failure", "(", "'No active environments found for `{}`.'", ".", "format", "(", "check", ")", ")", "echo_info", "(", ...
Restart an Agent to detect environment changes.
[ "Restart", "an", "Agent", "to", "detect", "environment", "changes", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/env/reload.py#L13-L41
train
Restart an Agent to detect environment changes.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
gitlab/datadog_checks/gitlab/gitlab.py
GitlabCheck._create_gitlab_prometheus_instance
def _create_gitlab_prometheus_instance(self, instance, init_config): """ Set up the gitlab instance so it can be used in OpenMetricsBaseCheck """ # Mapping from Prometheus metrics names to Datadog ones # For now it's a 1:1 mapping allowed_metrics = init_config.get('allowe...
python
def _create_gitlab_prometheus_instance(self, instance, init_config): """ Set up the gitlab instance so it can be used in OpenMetricsBaseCheck """ # Mapping from Prometheus metrics names to Datadog ones # For now it's a 1:1 mapping allowed_metrics = init_config.get('allowe...
[ "def", "_create_gitlab_prometheus_instance", "(", "self", ",", "instance", ",", "init_config", ")", ":", "# Mapping from Prometheus metrics names to Datadog ones", "# For now it's a 1:1 mapping", "allowed_metrics", "=", "init_config", ".", "get", "(", "'allowed_metrics'", ")", ...
Set up the gitlab instance so it can be used in OpenMetricsBaseCheck
[ "Set", "up", "the", "gitlab", "instance", "so", "it", "can", "be", "used", "in", "OpenMetricsBaseCheck" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/gitlab/datadog_checks/gitlab/gitlab.py#L63-L87
train
Create a gitlab instance based on the instance configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/prometheus/base_check.py
PrometheusScraper._submit_gauge
def _submit_gauge(self, metric_name, val, metric, custom_tags=None, hostname=None): """ Submit a metric as a gauge, additional tags provided will be added to the ones from the label provided via the metrics object. `custom_tags` is an array of 'tag:value' that will be added to the ...
python
def _submit_gauge(self, metric_name, val, metric, custom_tags=None, hostname=None): """ Submit a metric as a gauge, additional tags provided will be added to the ones from the label provided via the metrics object. `custom_tags` is an array of 'tag:value' that will be added to the ...
[ "def", "_submit_gauge", "(", "self", ",", "metric_name", ",", "val", ",", "metric", ",", "custom_tags", "=", "None", ",", "hostname", "=", "None", ")", ":", "_tags", "=", "self", ".", "_metric_tags", "(", "metric_name", ",", "val", ",", "metric", ",", ...
Submit a metric as a gauge, additional tags provided will be added to the ones from the label provided via the metrics object. `custom_tags` is an array of 'tag:value' that will be added to the metric when sending the gauge to Datadog.
[ "Submit", "a", "metric", "as", "a", "gauge", "additional", "tags", "provided", "will", "be", "added", "to", "the", "ones", "from", "the", "label", "provided", "via", "the", "metrics", "object", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/base_check.py#L32-L41
train
Submit a metric as a gauge
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
tokumx/datadog_checks/tokumx/vendor/pymongo/read_preferences.py
_validate_tag_sets
def _validate_tag_sets(tag_sets): """Validate tag sets for a MongoReplicaSetClient. """ if tag_sets is None: return tag_sets if not isinstance(tag_sets, list): raise TypeError(( "Tag sets %r invalid, must be a list") % (tag_sets,)) if len(tag_sets) == 0: raise Va...
python
def _validate_tag_sets(tag_sets): """Validate tag sets for a MongoReplicaSetClient. """ if tag_sets is None: return tag_sets if not isinstance(tag_sets, list): raise TypeError(( "Tag sets %r invalid, must be a list") % (tag_sets,)) if len(tag_sets) == 0: raise Va...
[ "def", "_validate_tag_sets", "(", "tag_sets", ")", ":", "if", "tag_sets", "is", "None", ":", "return", "tag_sets", "if", "not", "isinstance", "(", "tag_sets", ",", "list", ")", ":", "raise", "TypeError", "(", "(", "\"Tag sets %r invalid, must be a list\"", ")", ...
Validate tag sets for a MongoReplicaSetClient.
[ "Validate", "tag", "sets", "for", "a", "MongoReplicaSetClient", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/read_preferences.py#L42-L63
train
Validate the tag sets for a MongoReplicaSetClient.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
tokumx/datadog_checks/tokumx/vendor/pymongo/read_preferences.py
_validate_max_staleness
def _validate_max_staleness(max_staleness): """Validate max_staleness.""" if max_staleness == -1: return -1 if not isinstance(max_staleness, integer_types): raise TypeError(_invalid_max_staleness_msg(max_staleness)) if max_staleness <= 0: raise ValueError(_invalid_max_staleness...
python
def _validate_max_staleness(max_staleness): """Validate max_staleness.""" if max_staleness == -1: return -1 if not isinstance(max_staleness, integer_types): raise TypeError(_invalid_max_staleness_msg(max_staleness)) if max_staleness <= 0: raise ValueError(_invalid_max_staleness...
[ "def", "_validate_max_staleness", "(", "max_staleness", ")", ":", "if", "max_staleness", "==", "-", "1", ":", "return", "-", "1", "if", "not", "isinstance", "(", "max_staleness", ",", "integer_types", ")", ":", "raise", "TypeError", "(", "_invalid_max_staleness_...
Validate max_staleness.
[ "Validate", "max_staleness", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/read_preferences.py#L72-L83
train
Validate max_staleness.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
tokumx/datadog_checks/tokumx/vendor/pymongo/read_preferences.py
_ServerMode.document
def document(self): """Read preference as a document. """ doc = {'mode': self.__mongos_mode} if self.__tag_sets not in (None, [{}]): doc['tags'] = self.__tag_sets if self.__max_staleness != -1: doc['maxStalenessSeconds'] = self.__max_staleness retu...
python
def document(self): """Read preference as a document. """ doc = {'mode': self.__mongos_mode} if self.__tag_sets not in (None, [{}]): doc['tags'] = self.__tag_sets if self.__max_staleness != -1: doc['maxStalenessSeconds'] = self.__max_staleness retu...
[ "def", "document", "(", "self", ")", ":", "doc", "=", "{", "'mode'", ":", "self", ".", "__mongos_mode", "}", "if", "self", ".", "__tag_sets", "not", "in", "(", "None", ",", "[", "{", "}", "]", ")", ":", "doc", "[", "'tags'", "]", "=", "self", "...
Read preference as a document.
[ "Read", "preference", "as", "a", "document", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/read_preferences.py#L111-L119
train
Read preference as a document.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/config.py
config
def config(check): """Validate default configuration files.""" if check: checks = [check] else: checks = sorted(get_valid_checks()) files_failed = {} files_warned = {} num_files = 0 echo_waiting('Validating default configuration files...') for check in checks: c...
python
def config(check): """Validate default configuration files.""" if check: checks = [check] else: checks = sorted(get_valid_checks()) files_failed = {} files_warned = {} num_files = 0 echo_waiting('Validating default configuration files...') for check in checks: c...
[ "def", "config", "(", "check", ")", ":", "if", "check", ":", "checks", "=", "[", "check", "]", "else", ":", "checks", "=", "sorted", "(", "get_valid_checks", "(", ")", ")", "files_failed", "=", "{", "}", "files_warned", "=", "{", "}", "num_files", "=...
Validate default configuration files.
[ "Validate", "default", "configuration", "files", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/config.py#L18-L93
train
Validate default configuration files.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
ibm_mq/datadog_checks/ibm_mq/ibm_mq.py
IbmMqCheck.queue_manager_stats
def queue_manager_stats(self, queue_manager, tags): """ Get stats from the queue manager """ for mname, pymqi_value in iteritems(metrics.queue_manager_metrics()): try: m = queue_manager.inquire(pymqi_value) mname = '{}.queue_manager.{}'.format...
python
def queue_manager_stats(self, queue_manager, tags): """ Get stats from the queue manager """ for mname, pymqi_value in iteritems(metrics.queue_manager_metrics()): try: m = queue_manager.inquire(pymqi_value) mname = '{}.queue_manager.{}'.format...
[ "def", "queue_manager_stats", "(", "self", ",", "queue_manager", ",", "tags", ")", ":", "for", "mname", ",", "pymqi_value", "in", "iteritems", "(", "metrics", ".", "queue_manager_metrics", "(", ")", ")", ":", "try", ":", "m", "=", "queue_manager", ".", "in...
Get stats from the queue manager
[ "Get", "stats", "from", "the", "queue", "manager" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/ibm_mq/datadog_checks/ibm_mq/ibm_mq.py#L108-L121
train
Get stats from the queue manager
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
ibm_mq/datadog_checks/ibm_mq/ibm_mq.py
IbmMqCheck.queue_stats
def queue_stats(self, queue, tags): """ Grab stats from queues """ for mname, pymqi_value in iteritems(metrics.queue_metrics()): try: mname = '{}.queue.{}'.format(self.METRIC_PREFIX, mname) m = queue.inquire(pymqi_value) self.ga...
python
def queue_stats(self, queue, tags): """ Grab stats from queues """ for mname, pymqi_value in iteritems(metrics.queue_metrics()): try: mname = '{}.queue.{}'.format(self.METRIC_PREFIX, mname) m = queue.inquire(pymqi_value) self.ga...
[ "def", "queue_stats", "(", "self", ",", "queue", ",", "tags", ")", ":", "for", "mname", ",", "pymqi_value", "in", "iteritems", "(", "metrics", ".", "queue_metrics", "(", ")", ")", ":", "try", ":", "mname", "=", "'{}.queue.{}'", ".", "format", "(", "sel...
Grab stats from queues
[ "Grab", "stats", "from", "queues" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/ibm_mq/datadog_checks/ibm_mq/ibm_mq.py#L123-L141
train
Grab stats from queues 69
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/utils.py
get_version_string
def get_version_string(check_name): """ Get the version string for the given check. """ version = VERSION.search(read_version_file(check_name)) if version: return version.group(1)
python
def get_version_string(check_name): """ Get the version string for the given check. """ version = VERSION.search(read_version_file(check_name)) if version: return version.group(1)
[ "def", "get_version_string", "(", "check_name", ")", ":", "version", "=", "VERSION", ".", "search", "(", "read_version_file", "(", "check_name", ")", ")", "if", "version", ":", "return", "version", ".", "group", "(", "1", ")" ]
Get the version string for the given check.
[ "Get", "the", "version", "string", "for", "the", "given", "check", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/utils.py#L129-L135
train
Get the version string for the given check.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/utils.py
load_manifest
def load_manifest(check_name): """ Load the manifest file into a dictionary """ manifest_path = os.path.join(get_root(), check_name, 'manifest.json') if file_exists(manifest_path): return json.loads(read_file(manifest_path)) return {}
python
def load_manifest(check_name): """ Load the manifest file into a dictionary """ manifest_path = os.path.join(get_root(), check_name, 'manifest.json') if file_exists(manifest_path): return json.loads(read_file(manifest_path)) return {}
[ "def", "load_manifest", "(", "check_name", ")", ":", "manifest_path", "=", "os", ".", "path", ".", "join", "(", "get_root", "(", ")", ",", "check_name", ",", "'manifest.json'", ")", "if", "file_exists", "(", "manifest_path", ")", ":", "return", "json", "."...
Load the manifest file into a dictionary
[ "Load", "the", "manifest", "file", "into", "a", "dictionary" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/utils.py#L138-L145
train
Load the manifest file into a dictionary
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/utils.py
parse_agent_req_file
def parse_agent_req_file(contents): """ Returns a dictionary mapping {check-package-name --> pinned_version} from the given file contents. We can assume lines are in the form: datadog-active-directory==1.1.1; sys_platform == 'win32' """ catalog = OrderedDict() for line in contents.spli...
python
def parse_agent_req_file(contents): """ Returns a dictionary mapping {check-package-name --> pinned_version} from the given file contents. We can assume lines are in the form: datadog-active-directory==1.1.1; sys_platform == 'win32' """ catalog = OrderedDict() for line in contents.spli...
[ "def", "parse_agent_req_file", "(", "contents", ")", ":", "catalog", "=", "OrderedDict", "(", ")", "for", "line", "in", "contents", ".", "splitlines", "(", ")", ":", "toks", "=", "line", ".", "split", "(", "'=='", ",", "1", ")", "if", "len", "(", "to...
Returns a dictionary mapping {check-package-name --> pinned_version} from the given file contents. We can assume lines are in the form: datadog-active-directory==1.1.1; sys_platform == 'win32'
[ "Returns", "a", "dictionary", "mapping", "{", "check", "-", "package", "-", "name", "--", ">", "pinned_version", "}", "from", "the", "given", "file", "contents", ".", "We", "can", "assume", "lines", "are", "in", "the", "form", ":" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/utils.py#L161-L181
train
Parse the requirements file contents into a dictionary mapping check - package - name - > pinned_version.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mysql/datadog_checks/mysql/mysql.py
MySql._collect_dict
def _collect_dict(self, metric_type, field_metric_map, query, db, tags): """ Query status and get a dictionary back. Extract each field out of the dictionary and stuff it in the corresponding metric. query: show status... field_metric_map: {"Seconds_behind_master": "mysq...
python
def _collect_dict(self, metric_type, field_metric_map, query, db, tags): """ Query status and get a dictionary back. Extract each field out of the dictionary and stuff it in the corresponding metric. query: show status... field_metric_map: {"Seconds_behind_master": "mysq...
[ "def", "_collect_dict", "(", "self", ",", "metric_type", ",", "field_metric_map", ",", "query", ",", "db", ",", "tags", ")", ":", "try", ":", "with", "closing", "(", "db", ".", "cursor", "(", ")", ")", "as", "cursor", ":", "cursor", ".", "execute", "...
Query status and get a dictionary back. Extract each field out of the dictionary and stuff it in the corresponding metric. query: show status... field_metric_map: {"Seconds_behind_master": "mysqlSecondsBehindMaster"}
[ "Query", "status", "and", "get", "a", "dictionary", "back", ".", "Extract", "each", "field", "out", "of", "the", "dictionary", "and", "stuff", "it", "in", "the", "corresponding", "metric", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mysql/datadog_checks/mysql/mysql.py#L720-L755
train
Collect the dictionary of the current state of the object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mysql/datadog_checks/mysql/mysql.py
MySql._get_pid_file_variable
def _get_pid_file_variable(self, db): """ Get the `pid_file` variable """ pid_file = None try: with closing(db.cursor()) as cursor: cursor.execute("SHOW VARIABLES LIKE 'pid_file'") pid_file = cursor.fetchone()[1] except Exceptio...
python
def _get_pid_file_variable(self, db): """ Get the `pid_file` variable """ pid_file = None try: with closing(db.cursor()) as cursor: cursor.execute("SHOW VARIABLES LIKE 'pid_file'") pid_file = cursor.fetchone()[1] except Exceptio...
[ "def", "_get_pid_file_variable", "(", "self", ",", "db", ")", ":", "pid_file", "=", "None", "try", ":", "with", "closing", "(", "db", ".", "cursor", "(", ")", ")", "as", "cursor", ":", "cursor", ".", "execute", "(", "\"SHOW VARIABLES LIKE 'pid_file'\"", ")...
Get the `pid_file` variable
[ "Get", "the", "pid_file", "variable" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mysql/datadog_checks/mysql/mysql.py#L784-L796
train
Get the pid_file variable of MySQL.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mysql/datadog_checks/mysql/mysql.py
MySql._get_slave_status
def _get_slave_status(self, db, above_560, nonblocking): """ Retrieve the slaves' statuses using: 1. The `performance_schema.threads` table. Non-blocking, requires version > 5.6.0 2. The `information_schema.processlist` table. Blocking """ try: with closing(db...
python
def _get_slave_status(self, db, above_560, nonblocking): """ Retrieve the slaves' statuses using: 1. The `performance_schema.threads` table. Non-blocking, requires version > 5.6.0 2. The `information_schema.processlist` table. Blocking """ try: with closing(db...
[ "def", "_get_slave_status", "(", "self", ",", "db", ",", "above_560", ",", "nonblocking", ")", ":", "try", ":", "with", "closing", "(", "db", ".", "cursor", "(", ")", ")", "as", "cursor", ":", "if", "above_560", "and", "nonblocking", ":", "# Query `perfo...
Retrieve the slaves' statuses using: 1. The `performance_schema.threads` table. Non-blocking, requires version > 5.6.0 2. The `information_schema.processlist` table. Blocking
[ "Retrieve", "the", "slaves", "statuses", "using", ":", "1", ".", "The", "performance_schema", ".", "threads", "table", ".", "Non", "-", "blocking", "requires", "version", ">", "5", ".", "6", ".", "0", "2", ".", "The", "information_schema", ".", "processlis...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mysql/datadog_checks/mysql/mysql.py#L914-L937
train
Retrieve the slaves status using the process tables.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mapreduce/datadog_checks/mapreduce/mapreduce.py
MapReduceCheck._parse_general_counters
def _parse_general_counters(self, init_config): """ Return a dictionary for each job counter { counter_group_name: [ counter_name ] } } """ job_counter = {} if init_config.get('general_counters'): # Parse...
python
def _parse_general_counters(self, init_config): """ Return a dictionary for each job counter { counter_group_name: [ counter_name ] } } """ job_counter = {} if init_config.get('general_counters'): # Parse...
[ "def", "_parse_general_counters", "(", "self", ",", "init_config", ")", ":", "job_counter", "=", "{", "}", "if", "init_config", ".", "get", "(", "'general_counters'", ")", ":", "# Parse the custom metrics", "for", "counter_group", "in", "init_config", "[", "'gener...
Return a dictionary for each job counter { counter_group_name: [ counter_name ] } }
[ "Return", "a", "dictionary", "for", "each", "job", "counter", "{", "counter_group_name", ":", "[", "counter_name", "]", "}", "}" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mapreduce/datadog_checks/mapreduce/mapreduce.py#L181-L218
train
Parse the general counters from the init_config and return a dictionary for each job counter
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mapreduce/datadog_checks/mapreduce/mapreduce.py
MapReduceCheck._parse_job_specific_counters
def _parse_job_specific_counters(self, init_config): """ Return a dictionary for each job counter { job_name: { counter_group_name: [ counter_name ] } } } """ job_counter = {} if init_confi...
python
def _parse_job_specific_counters(self, init_config): """ Return a dictionary for each job counter { job_name: { counter_group_name: [ counter_name ] } } } """ job_counter = {} if init_confi...
[ "def", "_parse_job_specific_counters", "(", "self", ",", "init_config", ")", ":", "job_counter", "=", "{", "}", "if", "init_config", ".", "get", "(", "'job_specific_counters'", ")", ":", "# Parse the custom metrics", "for", "job", "in", "init_config", "[", "'job_s...
Return a dictionary for each job counter { job_name: { counter_group_name: [ counter_name ] } } }
[ "Return", "a", "dictionary", "for", "each", "job", "counter", "{", "job_name", ":", "{", "counter_group_name", ":", "[", "counter_name", "]", "}", "}", "}" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mapreduce/datadog_checks/mapreduce/mapreduce.py#L220-L273
train
Parse the job specific counters.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mapreduce/datadog_checks/mapreduce/mapreduce.py
MapReduceCheck._get_running_app_ids
def _get_running_app_ids(self, rm_address, auth, ssl_verify): """ Return a dictionary of {app_id: (app_name, tracking_url)} for the running MapReduce applications """ metrics_json = self._rest_request_to_json( rm_address, auth, ssl_verify, ...
python
def _get_running_app_ids(self, rm_address, auth, ssl_verify): """ Return a dictionary of {app_id: (app_name, tracking_url)} for the running MapReduce applications """ metrics_json = self._rest_request_to_json( rm_address, auth, ssl_verify, ...
[ "def", "_get_running_app_ids", "(", "self", ",", "rm_address", ",", "auth", ",", "ssl_verify", ")", ":", "metrics_json", "=", "self", ".", "_rest_request_to_json", "(", "rm_address", ",", "auth", ",", "ssl_verify", ",", "self", ".", "YARN_APPS_PATH", ",", "sel...
Return a dictionary of {app_id: (app_name, tracking_url)} for the running MapReduce applications
[ "Return", "a", "dictionary", "of", "{", "app_id", ":", "(", "app_name", "tracking_url", ")", "}", "for", "the", "running", "MapReduce", "applications" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mapreduce/datadog_checks/mapreduce/mapreduce.py#L275-L302
train
Get the running MapReduce applications.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mapreduce/datadog_checks/mapreduce/mapreduce.py
MapReduceCheck._mapreduce_job_metrics
def _mapreduce_job_metrics(self, running_apps, auth, ssl_verify, addl_tags): """ Get metrics for each MapReduce job. Return a dictionary for each MapReduce job { job_id: { 'job_name': job_name, 'app_name': app_name, 'user_name': user_name, ...
python
def _mapreduce_job_metrics(self, running_apps, auth, ssl_verify, addl_tags): """ Get metrics for each MapReduce job. Return a dictionary for each MapReduce job { job_id: { 'job_name': job_name, 'app_name': app_name, 'user_name': user_name, ...
[ "def", "_mapreduce_job_metrics", "(", "self", ",", "running_apps", ",", "auth", ",", "ssl_verify", ",", "addl_tags", ")", ":", "running_jobs", "=", "{", "}", "for", "app_name", ",", "tracking_url", "in", "itervalues", "(", "running_apps", ")", ":", "metrics_js...
Get metrics for each MapReduce job. Return a dictionary for each MapReduce job { job_id: { 'job_name': job_name, 'app_name': app_name, 'user_name': user_name, 'tracking_url': tracking_url }
[ "Get", "metrics", "for", "each", "MapReduce", "job", ".", "Return", "a", "dictionary", "for", "each", "MapReduce", "job", "{", "job_id", ":", "{", "job_name", ":", "job_name", "app_name", ":", "app_name", "user_name", ":", "user_name", "tracking_url", ":", "...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mapreduce/datadog_checks/mapreduce/mapreduce.py#L304-L352
train
Get metrics for each MapReduce job.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mapreduce/datadog_checks/mapreduce/mapreduce.py
MapReduceCheck._mapreduce_job_counters_metrics
def _mapreduce_job_counters_metrics(self, running_jobs, auth, ssl_verify, addl_tags): """ Get custom metrics specified for each counter """ for job_metrics in itervalues(running_jobs): job_name = job_metrics['job_name'] # Check if the job_name exist in the custom...
python
def _mapreduce_job_counters_metrics(self, running_jobs, auth, ssl_verify, addl_tags): """ Get custom metrics specified for each counter """ for job_metrics in itervalues(running_jobs): job_name = job_metrics['job_name'] # Check if the job_name exist in the custom...
[ "def", "_mapreduce_job_counters_metrics", "(", "self", ",", "running_jobs", ",", "auth", ",", "ssl_verify", ",", "addl_tags", ")", ":", "for", "job_metrics", "in", "itervalues", "(", "running_jobs", ")", ":", "job_name", "=", "job_metrics", "[", "'job_name'", "]...
Get custom metrics specified for each counter
[ "Get", "custom", "metrics", "specified", "for", "each", "counter" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mapreduce/datadog_checks/mapreduce/mapreduce.py#L354-L411
train
Get the custom metrics specified for each counter group and add them to the running jobs list
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mapreduce/datadog_checks/mapreduce/mapreduce.py
MapReduceCheck._mapreduce_task_metrics
def _mapreduce_task_metrics(self, running_jobs, auth, ssl_verify, addl_tags): """ Get metrics for each MapReduce task Return a dictionary of {task_id: 'tracking_url'} for each MapReduce task """ for job_stats in itervalues(running_jobs): metrics_json = self._rest_req...
python
def _mapreduce_task_metrics(self, running_jobs, auth, ssl_verify, addl_tags): """ Get metrics for each MapReduce task Return a dictionary of {task_id: 'tracking_url'} for each MapReduce task """ for job_stats in itervalues(running_jobs): metrics_json = self._rest_req...
[ "def", "_mapreduce_task_metrics", "(", "self", ",", "running_jobs", ",", "auth", ",", "ssl_verify", ",", "addl_tags", ")", ":", "for", "job_stats", "in", "itervalues", "(", "running_jobs", ")", ":", "metrics_json", "=", "self", ".", "_rest_request_to_json", "(",...
Get metrics for each MapReduce task Return a dictionary of {task_id: 'tracking_url'} for each MapReduce task
[ "Get", "metrics", "for", "each", "MapReduce", "task", "Return", "a", "dictionary", "of", "{", "task_id", ":", "tracking_url", "}", "for", "each", "MapReduce", "task" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mapreduce/datadog_checks/mapreduce/mapreduce.py#L413-L444
train
Get metrics for each MapReduce task
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mapreduce/datadog_checks/mapreduce/mapreduce.py
MapReduceCheck._set_metrics_from_json
def _set_metrics_from_json(self, metrics_json, metrics, tags): """ Parse the JSON response and set the metrics """ for status, (metric_name, metric_type) in iteritems(metrics): metric_status = metrics_json.get(status) if metric_status is not None: ...
python
def _set_metrics_from_json(self, metrics_json, metrics, tags): """ Parse the JSON response and set the metrics """ for status, (metric_name, metric_type) in iteritems(metrics): metric_status = metrics_json.get(status) if metric_status is not None: ...
[ "def", "_set_metrics_from_json", "(", "self", ",", "metrics_json", ",", "metrics", ",", "tags", ")", ":", "for", "status", ",", "(", "metric_name", ",", "metric_type", ")", "in", "iteritems", "(", "metrics", ")", ":", "metric_status", "=", "metrics_json", "....
Parse the JSON response and set the metrics
[ "Parse", "the", "JSON", "response", "and", "set", "the", "metrics" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mapreduce/datadog_checks/mapreduce/mapreduce.py#L446-L454
train
Parse the JSON response and set the metrics
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mapreduce/datadog_checks/mapreduce/mapreduce.py
MapReduceCheck._set_metric
def _set_metric(self, metric_name, metric_type, value, tags=None, device_name=None): """ Set a metric """ if metric_type == self.HISTOGRAM: self.histogram(metric_name, value, tags=tags, device_name=device_name) elif metric_type == self.INCREMENT: self.incr...
python
def _set_metric(self, metric_name, metric_type, value, tags=None, device_name=None): """ Set a metric """ if metric_type == self.HISTOGRAM: self.histogram(metric_name, value, tags=tags, device_name=device_name) elif metric_type == self.INCREMENT: self.incr...
[ "def", "_set_metric", "(", "self", ",", "metric_name", ",", "metric_type", ",", "value", ",", "tags", "=", "None", ",", "device_name", "=", "None", ")", ":", "if", "metric_type", "==", "self", ".", "HISTOGRAM", ":", "self", ".", "histogram", "(", "metric...
Set a metric
[ "Set", "a", "metric" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mapreduce/datadog_checks/mapreduce/mapreduce.py#L456-L465
train
Set a metric in the cache.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mapreduce/datadog_checks/mapreduce/mapreduce.py
MapReduceCheck._rest_request_to_json
def _rest_request_to_json(self, address, auth, ssl_verify, object_path, service_name, tags=None, *args, **kwargs): """ Query the given URL and return the JSON response """ response_json = None tags = [] if tags is None else tags service_check_tags = ['url:{}'.format(self...
python
def _rest_request_to_json(self, address, auth, ssl_verify, object_path, service_name, tags=None, *args, **kwargs): """ Query the given URL and return the JSON response """ response_json = None tags = [] if tags is None else tags service_check_tags = ['url:{}'.format(self...
[ "def", "_rest_request_to_json", "(", "self", ",", "address", ",", "auth", ",", "ssl_verify", ",", "object_path", ",", "service_name", ",", "tags", "=", "None", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "response_json", "=", "None", "tags", "="...
Query the given URL and return the JSON response
[ "Query", "the", "given", "URL", "and", "return", "the", "JSON", "response" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mapreduce/datadog_checks/mapreduce/mapreduce.py#L467-L529
train
Perform a REST request to the given URL and return the JSON response.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
agent_metrics/datadog_checks/agent_metrics/agent_metrics.py
AgentMetrics._psutil_config_to_stats
def _psutil_config_to_stats(self, instance): """ Reads `init_config` for `psutil` methods to call on the current process Calls those methods and stores the raw output :returns a dictionary of statistic_name: value """ process_metrics = instance.get('process_metrics', sel...
python
def _psutil_config_to_stats(self, instance): """ Reads `init_config` for `psutil` methods to call on the current process Calls those methods and stores the raw output :returns a dictionary of statistic_name: value """ process_metrics = instance.get('process_metrics', sel...
[ "def", "_psutil_config_to_stats", "(", "self", ",", "instance", ")", ":", "process_metrics", "=", "instance", ".", "get", "(", "'process_metrics'", ",", "self", ".", "init_config", ".", "get", "(", "'process_metrics'", ",", "None", ")", ")", "if", "not", "pr...
Reads `init_config` for `psutil` methods to call on the current process Calls those methods and stores the raw output :returns a dictionary of statistic_name: value
[ "Reads", "init_config", "for", "psutil", "methods", "to", "call", "on", "the", "current", "process", "Calls", "those", "methods", "and", "stores", "the", "raw", "output" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/agent_metrics/datadog_checks/agent_metrics/agent_metrics.py#L53-L75
train
Reads the init_config for the current process_metrics and returns the stats and the internal stats
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
agent_metrics/datadog_checks/agent_metrics/agent_metrics.py
AgentMetrics._register_psutil_metrics
def _register_psutil_metrics(self, stats, names_to_metric_types, tags=None): """ Saves sample metrics from psutil :param stats: a dictionary that looks like: { 'memory_info': OrderedDict([('rss', 24395776), ('vms', 144666624)]), 'io_counters': OrderedDict([('read_count...
python
def _register_psutil_metrics(self, stats, names_to_metric_types, tags=None): """ Saves sample metrics from psutil :param stats: a dictionary that looks like: { 'memory_info': OrderedDict([('rss', 24395776), ('vms', 144666624)]), 'io_counters': OrderedDict([('read_count...
[ "def", "_register_psutil_metrics", "(", "self", ",", "stats", ",", "names_to_metric_types", ",", "tags", "=", "None", ")", ":", "if", "tags", "is", "None", ":", "tags", "=", "[", "]", "base_metric", "=", "'datadog.agent.collector.{0}.{1}'", "# TODO: May have to ca...
Saves sample metrics from psutil :param stats: a dictionary that looks like: { 'memory_info': OrderedDict([('rss', 24395776), ('vms', 144666624)]), 'io_counters': OrderedDict([('read_count', 4536), ('write_count', 100), ...
[ "Saves", "sample", "metrics", "from", "psutil" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/agent_metrics/datadog_checks/agent_metrics/agent_metrics.py#L87-L117
train
Registers sample metrics from psutil.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/docker.py
get_container_ip
def get_container_ip(container_id_or_name): """Get a Docker container's IP address from its id or name.""" command = [ 'docker', 'inspect', '-f', '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}', container_id_or_name, ] return run_command(command, captu...
python
def get_container_ip(container_id_or_name): """Get a Docker container's IP address from its id or name.""" command = [ 'docker', 'inspect', '-f', '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}', container_id_or_name, ] return run_command(command, captu...
[ "def", "get_container_ip", "(", "container_id_or_name", ")", ":", "command", "=", "[", "'docker'", ",", "'inspect'", ",", "'-f'", ",", "'{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'", ",", "container_id_or_name", ",", "]", "return", "run_command", "(", "com...
Get a Docker container's IP address from its id or name.
[ "Get", "a", "Docker", "container", "s", "IP", "address", "from", "its", "id", "or", "name", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/docker.py#L20-L30
train
Get a Docker container s IP address from its id or name.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/docker.py
docker_run
def docker_run( compose_file=None, build=False, service_name=None, up=None, down=None, sleep=None, endpoints=None, log_patterns=None, conditions=None, env_vars=None, wrapper=None, ): """This utility provides a convenient way to safely set up and tear down Docker environme...
python
def docker_run( compose_file=None, build=False, service_name=None, up=None, down=None, sleep=None, endpoints=None, log_patterns=None, conditions=None, env_vars=None, wrapper=None, ): """This utility provides a convenient way to safely set up and tear down Docker environme...
[ "def", "docker_run", "(", "compose_file", "=", "None", ",", "build", "=", "False", ",", "service_name", "=", "None", ",", "up", "=", "None", ",", "down", "=", "None", ",", "sleep", "=", "None", ",", "endpoints", "=", "None", ",", "log_patterns", "=", ...
This utility provides a convenient way to safely set up and tear down Docker environments. :param compose_file: A path to a Docker compose file. A custom tear down is not required when using this. :type compose_file: ``str`` :param build: Whether or not to build images for when ``c...
[ "This", "utility", "provides", "a", "convenient", "way", "to", "safely", "set", "up", "and", "tear", "down", "Docker", "environments", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/docker.py#L45-L124
train
This utility is used to set up and tear down Docker environments.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
tokumx/datadog_checks/tokumx/vendor/bson/dbref.py
DBRef.as_doc
def as_doc(self): """Get the SON document representation of this DBRef. Generally not needed by application developers """ doc = SON([("$ref", self.collection), ("$id", self.id)]) if self.database is not None: doc["$db"] = self.database doc...
python
def as_doc(self): """Get the SON document representation of this DBRef. Generally not needed by application developers """ doc = SON([("$ref", self.collection), ("$id", self.id)]) if self.database is not None: doc["$db"] = self.database doc...
[ "def", "as_doc", "(", "self", ")", ":", "doc", "=", "SON", "(", "[", "(", "\"$ref\"", ",", "self", ".", "collection", ")", ",", "(", "\"$id\"", ",", "self", ".", "id", ")", "]", ")", "if", "self", ".", "database", "is", "not", "None", ":", "doc...
Get the SON document representation of this DBRef. Generally not needed by application developers
[ "Get", "the", "SON", "document", "representation", "of", "this", "DBRef", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/dbref.py#L93-L103
train
Returns the SON document representation of this DBRef.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
vsphere/datadog_checks/vsphere/cache_config.py
CacheConfig.clear
def clear(self): """ Reset the config object to its initial state """ with self._lock: self._config = { CacheConfig.Morlist: {'last': defaultdict(float), 'intl': {}}, CacheConfig.Metadata: {'last': defaultdict(float), 'intl': {}}, }
python
def clear(self): """ Reset the config object to its initial state """ with self._lock: self._config = { CacheConfig.Morlist: {'last': defaultdict(float), 'intl': {}}, CacheConfig.Metadata: {'last': defaultdict(float), 'intl': {}}, }
[ "def", "clear", "(", "self", ")", ":", "with", "self", ".", "_lock", ":", "self", ".", "_config", "=", "{", "CacheConfig", ".", "Morlist", ":", "{", "'last'", ":", "defaultdict", "(", "float", ")", ",", "'intl'", ":", "{", "}", "}", ",", "CacheConf...
Reset the config object to its initial state
[ "Reset", "the", "config", "object", "to", "its", "initial", "state" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/cache_config.py#L29-L37
train
Reset the config object to its initial state
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
vsphere/datadog_checks/vsphere/cache_config.py
CacheConfig.get_last
def get_last(self, type_, key): """ Notice: this will return the defaultdict default value also for keys that are not in the configuration, this is a tradeoff to keep the code simple. """ self._check_type(type_) with self._lock: return self._config[type_]['las...
python
def get_last(self, type_, key): """ Notice: this will return the defaultdict default value also for keys that are not in the configuration, this is a tradeoff to keep the code simple. """ self._check_type(type_) with self._lock: return self._config[type_]['las...
[ "def", "get_last", "(", "self", ",", "type_", ",", "key", ")", ":", "self", ".", "_check_type", "(", "type_", ")", "with", "self", ".", "_lock", ":", "return", "self", ".", "_config", "[", "type_", "]", "[", "'last'", "]", "[", "key", "]" ]
Notice: this will return the defaultdict default value also for keys that are not in the configuration, this is a tradeoff to keep the code simple.
[ "Notice", ":", "this", "will", "return", "the", "defaultdict", "default", "value", "also", "for", "keys", "that", "are", "not", "in", "the", "configuration", "this", "is", "a", "tradeoff", "to", "keep", "the", "code", "simple", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/cache_config.py#L44-L51
train
Get the last value for a given key in the configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
http_check/datadog_checks/http_check/utils.py
_get_ca_certs_paths
def _get_ca_certs_paths(): """ Get a list of possible paths containing certificates Check is installed via pip to: * Windows: embedded/lib/site-packages/datadog_checks/http_check * Linux: embedded/lib/python2.7/site-packages/datadog_checks/http_check Certificate is installed to: * embed...
python
def _get_ca_certs_paths(): """ Get a list of possible paths containing certificates Check is installed via pip to: * Windows: embedded/lib/site-packages/datadog_checks/http_check * Linux: embedded/lib/python2.7/site-packages/datadog_checks/http_check Certificate is installed to: * embed...
[ "def", "_get_ca_certs_paths", "(", ")", ":", "ca_certs", "=", "[", "]", "embedded_root", "=", "os", ".", "path", ".", "dirname", "(", "os", ".", "path", ".", "abspath", "(", "__file__", ")", ")", "for", "_", "in", "range", "(", "10", ")", ":", "if"...
Get a list of possible paths containing certificates Check is installed via pip to: * Windows: embedded/lib/site-packages/datadog_checks/http_check * Linux: embedded/lib/python2.7/site-packages/datadog_checks/http_check Certificate is installed to: * embedded/ssl/certs/cacert.pem walk up t...
[ "Get", "a", "list", "of", "possible", "paths", "containing", "certificates" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/http_check/datadog_checks/http_check/utils.py#L17-L53
train
Get a list of possible paths containing certificates
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/logos.py
logos
def logos(check): """Validate logo files. Specifying no check will validate all logos""" valid_checks = get_valid_integrations() if check: if check in valid_checks: checks = [check] else: echo_info('{} is not an integration.'.format(check)) return el...
python
def logos(check): """Validate logo files. Specifying no check will validate all logos""" valid_checks = get_valid_integrations() if check: if check in valid_checks: checks = [check] else: echo_info('{} is not an integration.'.format(check)) return el...
[ "def", "logos", "(", "check", ")", ":", "valid_checks", "=", "get_valid_integrations", "(", ")", "if", "check", ":", "if", "check", "in", "valid_checks", ":", "checks", "=", "[", "check", "]", "else", ":", "echo_info", "(", "'{} is not an integration.'", "."...
Validate logo files. Specifying no check will validate all logos
[ "Validate", "logo", "files", ".", "Specifying", "no", "check", "will", "validate", "all", "logos" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/logos.py#L20-L78
train
Validate logo files. Specifying no check will validate all logos.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
varnish/datadog_checks/varnish/varnish.py
Varnish._parse_varnishstat
def _parse_varnishstat(self, output, varnishstat_format, tags=None): """ The text option (-1) is not reliable enough when counters get large. VBE.media_video_prd_services_01(10.93.67.16,,8080).happy18446744073709551615 2 types of data, "a" for counter ("c" in newer versions of varnish),...
python
def _parse_varnishstat(self, output, varnishstat_format, tags=None): """ The text option (-1) is not reliable enough when counters get large. VBE.media_video_prd_services_01(10.93.67.16,,8080).happy18446744073709551615 2 types of data, "a" for counter ("c" in newer versions of varnish),...
[ "def", "_parse_varnishstat", "(", "self", ",", "output", ",", "varnishstat_format", ",", "tags", "=", "None", ")", ":", "tags", "=", "tags", "or", "[", "]", "# FIXME: this check is processing an unbounded amount of data", "# we should explicitly list the metrics we want to ...
The text option (-1) is not reliable enough when counters get large. VBE.media_video_prd_services_01(10.93.67.16,,8080).happy18446744073709551615 2 types of data, "a" for counter ("c" in newer versions of varnish), "i" for gauge ("g") https://github.com/varnish/Varnish-Cache/blob/master/include...
[ "The", "text", "option", "(", "-", "1", ")", "is", "not", "reliable", "enough", "when", "counters", "get", "large", ".", "VBE", ".", "media_video_prd_services_01", "(", "10", ".", "93", ".", "67", ".", "16", "8080", ")", ".", "happy18446744073709551615" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/varnish/datadog_checks/varnish/varnish.py#L199-L254
train
Parse the output of the varnishstat command and add it to the internal object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
varnish/datadog_checks/varnish/varnish.py
Varnish._parse_varnishadm
def _parse_varnishadm(self, output, tags): """ Parse out service checks from varnishadm. Example output: Backend b0 is Sick Current states good: 2 threshold: 3 window: 5 Average responsetime of good probes: 0.000000 Oldest ...
python
def _parse_varnishadm(self, output, tags): """ Parse out service checks from varnishadm. Example output: Backend b0 is Sick Current states good: 2 threshold: 3 window: 5 Average responsetime of good probes: 0.000000 Oldest ...
[ "def", "_parse_varnishadm", "(", "self", ",", "output", ",", "tags", ")", ":", "# Process status by backend.", "backends_by_status", "=", "defaultdict", "(", "list", ")", "for", "line", "in", "output", ".", "split", "(", "\"\\n\"", ")", ":", "backend", ",", ...
Parse out service checks from varnishadm. Example output: Backend b0 is Sick Current states good: 2 threshold: 3 window: 5 Average responsetime of good probes: 0.000000 Oldest Newest ============...
[ "Parse", "out", "service", "checks", "from", "varnishadm", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/varnish/datadog_checks/varnish/varnish.py#L256-L333
train
Parse out service checks from varnishadm output.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py
PrometheusScraperMixin.parse_metric_family
def parse_metric_family(self, response): """ Parse the MetricFamily from a valid requests.Response object to provide a MetricFamily object (see [0]) The text format uses iter_lines() generator. The protobuf format directly parse the response.content property searching for Prometheus me...
python
def parse_metric_family(self, response): """ Parse the MetricFamily from a valid requests.Response object to provide a MetricFamily object (see [0]) The text format uses iter_lines() generator. The protobuf format directly parse the response.content property searching for Prometheus me...
[ "def", "parse_metric_family", "(", "self", ",", "response", ")", ":", "if", "'application/vnd.google.protobuf'", "in", "response", ".", "headers", "[", "'Content-Type'", "]", ":", "n", "=", "0", "buf", "=", "response", ".", "content", "while", "n", "<", "len...
Parse the MetricFamily from a valid requests.Response object to provide a MetricFamily object (see [0]) The text format uses iter_lines() generator. The protobuf format directly parse the response.content property searching for Prometheus messages of type MetricFamily [0] delimited by a varint...
[ "Parse", "the", "MetricFamily", "from", "a", "valid", "requests", ".", "Response", "object", "to", "provide", "a", "MetricFamily", "object", "(", "see", "[", "0", "]", ")" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py#L167-L237
train
Parse the MetricFamily from a valid requests. Response object to provide a MetricFamily object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py
PrometheusScraperMixin._text_filter_input
def _text_filter_input(self, input_gen): """ Filters out the text input line by line to avoid parsing and processing metrics we know we don't want to process. This only works on `text/plain` payloads, and is an INTERNAL FEATURE implemented for the kubelet check :param input_get: ...
python
def _text_filter_input(self, input_gen): """ Filters out the text input line by line to avoid parsing and processing metrics we know we don't want to process. This only works on `text/plain` payloads, and is an INTERNAL FEATURE implemented for the kubelet check :param input_get: ...
[ "def", "_text_filter_input", "(", "self", ",", "input_gen", ")", ":", "for", "line", "in", "input_gen", ":", "for", "item", "in", "self", ".", "_text_filter_blacklist", ":", "if", "item", "in", "line", ":", "break", "else", ":", "# No blacklist matches, passin...
Filters out the text input line by line to avoid parsing and processing metrics we know we don't want to process. This only works on `text/plain` payloads, and is an INTERNAL FEATURE implemented for the kubelet check :param input_get: line generator :output: generator of filtered lines
[ "Filters", "out", "the", "text", "input", "line", "by", "line", "to", "avoid", "parsing", "and", "processing", "metrics", "we", "know", "we", "don", "t", "want", "to", "process", ".", "This", "only", "works", "on", "text", "/", "plain", "payloads", "and"...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py#L239-L253
train
Filter out the text input line by line to avoid parsing and processing metrics.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py
PrometheusScraperMixin.get_metric_value_by_labels
def get_metric_value_by_labels(messages, _metric, _m, metric_suffix): """ :param messages: dictionary as metric_name: {labels: {}, value: 10} :param _metric: dictionary as {labels: {le: '0.001', 'custom': 'value'}} :param _m: str as metric name :param metric_suffix: str must be i...
python
def get_metric_value_by_labels(messages, _metric, _m, metric_suffix): """ :param messages: dictionary as metric_name: {labels: {}, value: 10} :param _metric: dictionary as {labels: {le: '0.001', 'custom': 'value'}} :param _m: str as metric name :param metric_suffix: str must be i...
[ "def", "get_metric_value_by_labels", "(", "messages", ",", "_metric", ",", "_m", ",", "metric_suffix", ")", ":", "metric_name", "=", "'{}_{}'", ".", "format", "(", "_m", ",", "metric_suffix", ")", "expected_labels", "=", "set", "(", "[", "(", "k", ",", "v"...
:param messages: dictionary as metric_name: {labels: {}, value: 10} :param _metric: dictionary as {labels: {le: '0.001', 'custom': 'value'}} :param _m: str as metric name :param metric_suffix: str must be in (count or sum) :return: value of the metric_name matched by the labels
[ ":", "param", "messages", ":", "dictionary", "as", "metric_name", ":", "{", "labels", ":", "{}", "value", ":", "10", "}", ":", "param", "_metric", ":", "dictionary", "as", "{", "labels", ":", "{", "le", ":", "0", ".", "001", "custom", ":", "value", ...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py#L261-L281
train
Get the value of the metric_name matched by the labels in the _metric dictionary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py
PrometheusScraperMixin._extract_metric_from_map
def _extract_metric_from_map(self, _m, messages, obj_map, obj_help): """ Extracts MetricFamily objects from the maps generated by parsing the strings in _extract_metrics_from_string """ _obj = metrics_pb2.MetricFamily() _obj.name = _m _obj.type = self.METRIC_TYPES...
python
def _extract_metric_from_map(self, _m, messages, obj_map, obj_help): """ Extracts MetricFamily objects from the maps generated by parsing the strings in _extract_metrics_from_string """ _obj = metrics_pb2.MetricFamily() _obj.name = _m _obj.type = self.METRIC_TYPES...
[ "def", "_extract_metric_from_map", "(", "self", ",", "_m", ",", "messages", ",", "obj_map", ",", "obj_help", ")", ":", "_obj", "=", "metrics_pb2", ".", "MetricFamily", "(", ")", "_obj", ".", "name", "=", "_m", "_obj", ".", "type", "=", "self", ".", "ME...
Extracts MetricFamily objects from the maps generated by parsing the strings in _extract_metrics_from_string
[ "Extracts", "MetricFamily", "objects", "from", "the", "maps", "generated", "by", "parsing", "the", "strings", "in", "_extract_metrics_from_string" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py#L283-L356
train
Extracts the metric from the given object map.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py
PrometheusScraperMixin.scrape_metrics
def scrape_metrics(self, endpoint): """ Poll the data from prometheus and return the metrics as a generator. """ response = self.poll(endpoint) try: # no dry run if no label joins if not self.label_joins: self._dry_run = False e...
python
def scrape_metrics(self, endpoint): """ Poll the data from prometheus and return the metrics as a generator. """ response = self.poll(endpoint) try: # no dry run if no label joins if not self.label_joins: self._dry_run = False e...
[ "def", "scrape_metrics", "(", "self", ",", "endpoint", ")", ":", "response", "=", "self", ".", "poll", "(", "endpoint", ")", "try", ":", "# no dry run if no label joins", "if", "not", "self", ".", "label_joins", ":", "self", ".", "_dry_run", "=", "False", ...
Poll the data from prometheus and return the metrics as a generator.
[ "Poll", "the", "data", "from", "prometheus", "and", "return", "the", "metrics", "as", "a", "generator", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py#L358-L384
train
Scrape the metrics from prometheus and return the metrics as a generator.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py
PrometheusScraperMixin.process
def process(self, endpoint, **kwargs): """ Polls the data from prometheus and pushes them as gauges `endpoint` is the metrics endpoint to use to poll metrics from Prometheus Note that if the instance has a 'tags' attribute, it will be pushed automatically as additional custom ta...
python
def process(self, endpoint, **kwargs): """ Polls the data from prometheus and pushes them as gauges `endpoint` is the metrics endpoint to use to poll metrics from Prometheus Note that if the instance has a 'tags' attribute, it will be pushed automatically as additional custom ta...
[ "def", "process", "(", "self", ",", "endpoint", ",", "*", "*", "kwargs", ")", ":", "instance", "=", "kwargs", ".", "get", "(", "'instance'", ")", "if", "instance", ":", "kwargs", "[", "'custom_tags'", "]", "=", "instance", ".", "get", "(", "'tags'", ...
Polls the data from prometheus and pushes them as gauges `endpoint` is the metrics endpoint to use to poll metrics from Prometheus Note that if the instance has a 'tags' attribute, it will be pushed automatically as additional custom tags and added to the metrics
[ "Polls", "the", "data", "from", "prometheus", "and", "pushes", "them", "as", "gauges", "endpoint", "is", "the", "metrics", "endpoint", "to", "use", "to", "poll", "metrics", "from", "Prometheus" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py#L386-L399
train
Processes the metrics from Prometheus and pushes them as gauges
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py
PrometheusScraperMixin.process_metric
def process_metric(self, message, **kwargs): """ Handle a prometheus metric message according to the following flow: - search self.metrics_mapper for a prometheus.metric <--> datadog.metric mapping - call check method with the same name as the metric - log some info i...
python
def process_metric(self, message, **kwargs): """ Handle a prometheus metric message according to the following flow: - search self.metrics_mapper for a prometheus.metric <--> datadog.metric mapping - call check method with the same name as the metric - log some info i...
[ "def", "process_metric", "(", "self", ",", "message", ",", "*", "*", "kwargs", ")", ":", "# If targeted metric, store labels", "self", ".", "store_labels", "(", "message", ")", "if", "message", ".", "name", "in", "self", ".", "ignore_metrics", ":", "return", ...
Handle a prometheus metric message according to the following flow: - search self.metrics_mapper for a prometheus.metric <--> datadog.metric mapping - call check method with the same name as the metric - log some info if none of the above worked `send_histograms_buckets` is ...
[ "Handle", "a", "prometheus", "metric", "message", "according", "to", "the", "following", "flow", ":", "-", "search", "self", ".", "metrics_mapper", "for", "a", "prometheus", ".", "metric", "<", "--", ">", "datadog", ".", "metric", "mapping", "-", "call", "...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py#L437-L492
train
Process a metric message according to the above flow.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py
PrometheusScraperMixin.poll
def poll(self, endpoint, pFormat=PrometheusFormat.PROTOBUF, headers=None): """ Polls the metrics from the prometheus metrics endpoint provided. Defaults to the protobuf format, but can use the formats specified by the PrometheusFormat class. Custom headers can be added to the def...
python
def poll(self, endpoint, pFormat=PrometheusFormat.PROTOBUF, headers=None): """ Polls the metrics from the prometheus metrics endpoint provided. Defaults to the protobuf format, but can use the formats specified by the PrometheusFormat class. Custom headers can be added to the def...
[ "def", "poll", "(", "self", ",", "endpoint", ",", "pFormat", "=", "PrometheusFormat", ".", "PROTOBUF", ",", "headers", "=", "None", ")", ":", "if", "headers", "is", "None", ":", "headers", "=", "{", "}", "if", "'accept-encoding'", "not", "in", "headers",...
Polls the metrics from the prometheus metrics endpoint provided. Defaults to the protobuf format, but can use the formats specified by the PrometheusFormat class. Custom headers can be added to the default headers. Returns a valid requests.Response, raise requests.HTTPError if the statu...
[ "Polls", "the", "metrics", "from", "the", "prometheus", "metrics", "endpoint", "provided", ".", "Defaults", "to", "the", "protobuf", "format", "but", "can", "use", "the", "formats", "specified", "by", "the", "PrometheusFormat", "class", ".", "Custom", "headers",...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py#L494-L561
train
Polls the metrics from the prometheus metrics endpoint provided.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py
PrometheusScraperMixin._submit
def _submit( self, metric_name, message, send_histograms_buckets=True, send_monotonic_counter=False, custom_tags=None, hostname=None, ): """ For each metric in the message, report it as a gauge with all labels as tags except if a labels...
python
def _submit( self, metric_name, message, send_histograms_buckets=True, send_monotonic_counter=False, custom_tags=None, hostname=None, ): """ For each metric in the message, report it as a gauge with all labels as tags except if a labels...
[ "def", "_submit", "(", "self", ",", "metric_name", ",", "message", ",", "send_histograms_buckets", "=", "True", ",", "send_monotonic_counter", "=", "False", ",", "custom_tags", "=", "None", ",", "hostname", "=", "None", ",", ")", ":", "if", "message", ".", ...
For each metric in the message, report it as a gauge with all labels as tags except if a labels dict is passed, in which case keys are label names we'll extract and corresponding values are tag names we'll use (eg: {'node': 'node'}). Histograms generate a set of values instead of a unique metri...
[ "For", "each", "metric", "in", "the", "message", "report", "it", "as", "a", "gauge", "with", "all", "labels", "as", "tags", "except", "if", "a", "labels", "dict", "is", "passed", "in", "which", "case", "keys", "are", "label", "names", "we", "ll", "extr...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py#L563-L613
train
Submits a message to Datadog.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py
PrometheusScraperMixin._get_hostname
def _get_hostname(self, hostname, metric): """ If hostname is None, look at label_to_hostname setting """ if hostname is None and self.label_to_hostname is not None: for label in metric.label: if label.name == self.label_to_hostname: return...
python
def _get_hostname(self, hostname, metric): """ If hostname is None, look at label_to_hostname setting """ if hostname is None and self.label_to_hostname is not None: for label in metric.label: if label.name == self.label_to_hostname: return...
[ "def", "_get_hostname", "(", "self", ",", "hostname", ",", "metric", ")", ":", "if", "hostname", "is", "None", "and", "self", ".", "label_to_hostname", "is", "not", "None", ":", "for", "label", "in", "metric", ".", "label", ":", "if", "label", ".", "na...
If hostname is None, look at label_to_hostname setting
[ "If", "hostname", "is", "None", "look", "at", "label_to_hostname", "setting" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py#L615-L624
train
Get the hostname from the label_to_hostname setting.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py
PrometheusScraperMixin._submit_gauges_from_summary
def _submit_gauges_from_summary(self, name, metric, custom_tags=None, hostname=None): """ Extracts metrics from a prometheus summary metric and sends them as gauges """ if custom_tags is None: custom_tags = [] # summaries do not have a value attribute val = ge...
python
def _submit_gauges_from_summary(self, name, metric, custom_tags=None, hostname=None): """ Extracts metrics from a prometheus summary metric and sends them as gauges """ if custom_tags is None: custom_tags = [] # summaries do not have a value attribute val = ge...
[ "def", "_submit_gauges_from_summary", "(", "self", ",", "name", ",", "metric", ",", "custom_tags", "=", "None", ",", "hostname", "=", "None", ")", ":", "if", "custom_tags", "is", "None", ":", "custom_tags", "=", "[", "]", "# summaries do not have a value attribu...
Extracts metrics from a prometheus summary metric and sends them as gauges
[ "Extracts", "metrics", "from", "a", "prometheus", "summary", "metric", "and", "sends", "them", "as", "gauges" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py#L633-L662
train
Extracts metrics from a prometheus summary metric and sends them as gauges.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py
PrometheusScraperMixin._submit_gauges_from_histogram
def _submit_gauges_from_histogram( self, name, metric, send_histograms_buckets=True, custom_tags=None, hostname=None ): """ Extracts metrics from a prometheus histogram and sends them as gauges """ if custom_tags is None: custom_tags = [] # histograms do n...
python
def _submit_gauges_from_histogram( self, name, metric, send_histograms_buckets=True, custom_tags=None, hostname=None ): """ Extracts metrics from a prometheus histogram and sends them as gauges """ if custom_tags is None: custom_tags = [] # histograms do n...
[ "def", "_submit_gauges_from_histogram", "(", "self", ",", "name", ",", "metric", ",", "send_histograms_buckets", "=", "True", ",", "custom_tags", "=", "None", ",", "hostname", "=", "None", ")", ":", "if", "custom_tags", "is", "None", ":", "custom_tags", "=", ...
Extracts metrics from a prometheus histogram and sends them as gauges
[ "Extracts", "metrics", "from", "a", "prometheus", "histogram", "and", "sends", "them", "as", "gauges" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/prometheus/mixins.py#L664-L696
train
Extracts metrics from a prometheus histogram and sends them as gauges.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/github.py
get_auth_info
def get_auth_info(config=None): """ See if a personal access token was passed """ gh_config = (config or {}).get('github', {}) user = gh_config.get('user') or os.getenv('DD_GITHUB_USER') token = gh_config.get('token') or os.getenv('DD_GITHUB_TOKEN') if user and token: return user, to...
python
def get_auth_info(config=None): """ See if a personal access token was passed """ gh_config = (config or {}).get('github', {}) user = gh_config.get('user') or os.getenv('DD_GITHUB_USER') token = gh_config.get('token') or os.getenv('DD_GITHUB_TOKEN') if user and token: return user, to...
[ "def", "get_auth_info", "(", "config", "=", "None", ")", ":", "gh_config", "=", "(", "config", "or", "{", "}", ")", ".", "get", "(", "'github'", ",", "{", "}", ")", "user", "=", "gh_config", ".", "get", "(", "'user'", ")", "or", "os", ".", "geten...
See if a personal access token was passed
[ "See", "if", "a", "personal", "access", "token", "was", "passed" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/github.py#L17-L25
train
Get user and token from GitHub config
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/github.py
get_changelog_types
def get_changelog_types(pr_payload): """ Fetch the labels from the PR and process the ones related to the changelog. """ changelog_labels = [] for name in get_pr_labels(pr_payload): if name.startswith(CHANGELOG_LABEL_PREFIX): # only add the name, e.g. for `changelog/Added` it's j...
python
def get_changelog_types(pr_payload): """ Fetch the labels from the PR and process the ones related to the changelog. """ changelog_labels = [] for name in get_pr_labels(pr_payload): if name.startswith(CHANGELOG_LABEL_PREFIX): # only add the name, e.g. for `changelog/Added` it's j...
[ "def", "get_changelog_types", "(", "pr_payload", ")", ":", "changelog_labels", "=", "[", "]", "for", "name", "in", "get_pr_labels", "(", "pr_payload", ")", ":", "if", "name", ".", "startswith", "(", "CHANGELOG_LABEL_PREFIX", ")", ":", "# only add the name, e.g. fo...
Fetch the labels from the PR and process the ones related to the changelog.
[ "Fetch", "the", "labels", "from", "the", "PR", "and", "process", "the", "ones", "related", "to", "the", "changelog", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/github.py#L42-L52
train
Fetch the labels from the PR and process them.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/github.py
get_pr
def get_pr(pr_num, config=None, repo=DEFAULT_REPO, raw=False): """ Get the payload for the given PR number. Let exceptions bubble up. """ response = requests.get(PR_ENDPOINT.format(repo, pr_num), auth=get_auth_info(config)) if raw: return response else: response.raise_for_status...
python
def get_pr(pr_num, config=None, repo=DEFAULT_REPO, raw=False): """ Get the payload for the given PR number. Let exceptions bubble up. """ response = requests.get(PR_ENDPOINT.format(repo, pr_num), auth=get_auth_info(config)) if raw: return response else: response.raise_for_status...
[ "def", "get_pr", "(", "pr_num", ",", "config", "=", "None", ",", "repo", "=", "DEFAULT_REPO", ",", "raw", "=", "False", ")", ":", "response", "=", "requests", ".", "get", "(", "PR_ENDPOINT", ".", "format", "(", "repo", ",", "pr_num", ")", ",", "auth"...
Get the payload for the given PR number. Let exceptions bubble up.
[ "Get", "the", "payload", "for", "the", "given", "PR", "number", ".", "Let", "exceptions", "bubble", "up", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/github.py#L55-L65
train
Get the payload for the given PR number.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/github.py
parse_pr_numbers
def parse_pr_numbers(git_log_lines): """ Parse PR numbers from commit messages. At GitHub those have the format: `here is the message (#1234)` being `1234` the PR number. """ prs = [] for line in git_log_lines: pr_number = parse_pr_number(line) if pr_number: ...
python
def parse_pr_numbers(git_log_lines): """ Parse PR numbers from commit messages. At GitHub those have the format: `here is the message (#1234)` being `1234` the PR number. """ prs = [] for line in git_log_lines: pr_number = parse_pr_number(line) if pr_number: ...
[ "def", "parse_pr_numbers", "(", "git_log_lines", ")", ":", "prs", "=", "[", "]", "for", "line", "in", "git_log_lines", ":", "pr_number", "=", "parse_pr_number", "(", "line", ")", "if", "pr_number", ":", "prs", ".", "append", "(", "pr_number", ")", "return"...
Parse PR numbers from commit messages. At GitHub those have the format: `here is the message (#1234)` being `1234` the PR number.
[ "Parse", "PR", "numbers", "from", "commit", "messages", ".", "At", "GitHub", "those", "have", "the", "format", ":" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/github.py#L98-L111
train
Parse PR numbers from commit messages.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
tokumx/datadog_checks/tokumx/vendor/pymongo/periodic_executor.py
PeriodicExecutor.open
def open(self): """Start. Multiple calls have no effect. Not safe to call from multiple threads at once. """ with self._lock: if self._thread_will_exit: # If the background thread has read self._stopped as True # there is a chance that it has ...
python
def open(self): """Start. Multiple calls have no effect. Not safe to call from multiple threads at once. """ with self._lock: if self._thread_will_exit: # If the background thread has read self._stopped as True # there is a chance that it has ...
[ "def", "open", "(", "self", ")", ":", "with", "self", ".", "_lock", ":", "if", "self", ".", "_thread_will_exit", ":", "# If the background thread has read self._stopped as True", "# there is a chance that it has not yet exited. The call to", "# join should not block indefinitely ...
Start. Multiple calls have no effect. Not safe to call from multiple threads at once.
[ "Start", ".", "Multiple", "calls", "have", "no", "effect", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/periodic_executor.py#L53-L83
train
Start. Multiple calls have no effect.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/plugin/tox.py
tox_configure
def tox_configure(config): """ For more info, see: https://tox.readthedocs.io/en/latest/plugins.html For an example, see: https://github.com/tox-dev/tox-travis """ sections = config._cfg.sections # Cache these make_envconfig = None reader = None # Default to false so: # 1. we d...
python
def tox_configure(config): """ For more info, see: https://tox.readthedocs.io/en/latest/plugins.html For an example, see: https://github.com/tox-dev/tox-travis """ sections = config._cfg.sections # Cache these make_envconfig = None reader = None # Default to false so: # 1. we d...
[ "def", "tox_configure", "(", "config", ")", ":", "sections", "=", "config", ".", "_cfg", ".", "sections", "# Cache these", "make_envconfig", "=", "None", "reader", "=", "None", "# Default to false so:", "# 1. we don't affect other projects using tox", "# 2. check migratio...
For more info, see: https://tox.readthedocs.io/en/latest/plugins.html For an example, see: https://github.com/tox-dev/tox-travis
[ "For", "more", "info", "see", ":", "https", ":", "//", "tox", ".", "readthedocs", ".", "io", "/", "en", "/", "latest", "/", "plugins", ".", "html", "For", "an", "example", "see", ":", "https", ":", "//", "github", ".", "com", "/", "tox", "-", "de...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/plugin/tox.py#L15-L37
train
Configure the tox environment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
network/datadog_checks/network/network.py
Network._is_collect_cx_state_runnable
def _is_collect_cx_state_runnable(self, proc_location): """ Determine if collect_connection_state is set and can effectively run. If self._collect_cx_state is True and a custom proc_location is provided, the system cannot run `ss` or `netstat` over a custom proc_location :param ...
python
def _is_collect_cx_state_runnable(self, proc_location): """ Determine if collect_connection_state is set and can effectively run. If self._collect_cx_state is True and a custom proc_location is provided, the system cannot run `ss` or `netstat` over a custom proc_location :param ...
[ "def", "_is_collect_cx_state_runnable", "(", "self", ",", "proc_location", ")", ":", "if", "self", ".", "_collect_cx_state", "is", "False", ":", "return", "False", "if", "proc_location", "!=", "\"/proc\"", ":", "self", ".", "warning", "(", "\"Cannot collect connec...
Determine if collect_connection_state is set and can effectively run. If self._collect_cx_state is True and a custom proc_location is provided, the system cannot run `ss` or `netstat` over a custom proc_location :param proc_location: str :return: bool
[ "Determine", "if", "collect_connection_state", "is", "set", "and", "can", "effectively", "run", ".", "If", "self", ".", "_collect_cx_state", "is", "True", "and", "a", "custom", "proc_location", "is", "provided", "the", "system", "cannot", "run", "ss", "or", "n...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/network/datadog_checks/network/network.py#L261-L276
train
Determine if collect_connection_state is set and can effectively run.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
network/datadog_checks/network/network.py
Network._check_linux
def _check_linux(self, instance): """ _check_linux can be run inside a container and still collects the network metrics from the host For that procfs_path can be set to something like "/host/proc" When a custom procfs_path is set, the collect_connection_state option is ignored ""...
python
def _check_linux(self, instance): """ _check_linux can be run inside a container and still collects the network metrics from the host For that procfs_path can be set to something like "/host/proc" When a custom procfs_path is set, the collect_connection_state option is ignored ""...
[ "def", "_check_linux", "(", "self", ",", "instance", ")", ":", "proc_location", "=", "self", ".", "agentConfig", ".", "get", "(", "'procfs_path'", ",", "'/proc'", ")", ".", "rstrip", "(", "'/'", ")", "custom_tags", "=", "instance", ".", "get", "(", "'tag...
_check_linux can be run inside a container and still collects the network metrics from the host For that procfs_path can be set to something like "/host/proc" When a custom procfs_path is set, the collect_connection_state option is ignored
[ "_check_linux", "can", "be", "run", "inside", "a", "container", "and", "still", "collects", "the", "network", "metrics", "from", "the", "host", "For", "that", "procfs_path", "can", "be", "set", "to", "something", "like", "/", "host", "/", "proc", "When", "...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/network/datadog_checks/network/network.py#L278-L460
train
Private function to check if Linux is running.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
network/datadog_checks/network/network.py
Network._add_conntrack_stats_metrics
def _add_conntrack_stats_metrics(self, conntrack_path, tags): """ Parse the output of conntrack -S Add the parsed metrics """ try: output, _, _ = get_subprocess_output(["sudo", conntrack_path, "-S"], self.log) # conntrack -S sample: # cpu=0 fou...
python
def _add_conntrack_stats_metrics(self, conntrack_path, tags): """ Parse the output of conntrack -S Add the parsed metrics """ try: output, _, _ = get_subprocess_output(["sudo", conntrack_path, "-S"], self.log) # conntrack -S sample: # cpu=0 fou...
[ "def", "_add_conntrack_stats_metrics", "(", "self", ",", "conntrack_path", ",", "tags", ")", ":", "try", ":", "output", ",", "_", ",", "_", "=", "get_subprocess_output", "(", "[", "\"sudo\"", ",", "conntrack_path", ",", "\"-S\"", "]", ",", "self", ".", "lo...
Parse the output of conntrack -S Add the parsed metrics
[ "Parse", "the", "output", "of", "conntrack", "-", "S", "Add", "the", "parsed", "metrics" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/network/datadog_checks/network/network.py#L462-L487
train
Parse the output of conntrack - S and add the parsed metrics to the self. metrics
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
network/datadog_checks/network/network.py
Network._parse_linux_cx_state
def _parse_linux_cx_state(self, lines, tcp_states, state_col, protocol=None, ip_version=None): """ Parse the output of the command that retrieves the connection state (either `ss` or `netstat`) Returns a dict metric_name -> value """ metrics = {} for _, val in iteritems(s...
python
def _parse_linux_cx_state(self, lines, tcp_states, state_col, protocol=None, ip_version=None): """ Parse the output of the command that retrieves the connection state (either `ss` or `netstat`) Returns a dict metric_name -> value """ metrics = {} for _, val in iteritems(s...
[ "def", "_parse_linux_cx_state", "(", "self", ",", "lines", ",", "tcp_states", ",", "state_col", ",", "protocol", "=", "None", ",", "ip_version", "=", "None", ")", ":", "metrics", "=", "{", "}", "for", "_", ",", "val", "in", "iteritems", "(", "self", "....
Parse the output of the command that retrieves the connection state (either `ss` or `netstat`) Returns a dict metric_name -> value
[ "Parse", "the", "output", "of", "the", "command", "that", "retrieves", "the", "connection", "state", "(", "either", "ss", "or", "netstat", ")", "Returns", "a", "dict", "metric_name", "-", ">", "value" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/network/datadog_checks/network/network.py#L489-L509
train
Parse the output of the Linux CX state command.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
network/datadog_checks/network/network.py
Network._parse_solaris_netstat
def _parse_solaris_netstat(self, netstat_output): """ Return a mapping of network metrics by interface. For example: { interface: {'bytes_sent': 0, 'bytes_rcvd': 0, 'bytes_rcvd': 0, ... } } ...
python
def _parse_solaris_netstat(self, netstat_output): """ Return a mapping of network metrics by interface. For example: { interface: {'bytes_sent': 0, 'bytes_rcvd': 0, 'bytes_rcvd': 0, ... } } ...
[ "def", "_parse_solaris_netstat", "(", "self", ",", "netstat_output", ")", ":", "# Here's an example of the netstat output:", "#", "# link:0:net0:brdcstrcv 527336", "# link:0:net0:brdcstxmt 1595", "# link:0:net0:class net", "# link:0:net0:collisions 0", "# link:0:net0:crtime ...
Return a mapping of network metrics by interface. For example: { interface: {'bytes_sent': 0, 'bytes_rcvd': 0, 'bytes_rcvd': 0, ... } }
[ "Return", "a", "mapping", "of", "network", "metrics", "by", "interface", ".", "For", "example", ":", "{", "interface", ":", "{", "bytes_sent", ":", "0", "bytes_rcvd", ":", "0", "bytes_rcvd", ":", "0", "...", "}", "}" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/network/datadog_checks/network/network.py#L637-L731
train
Parse the Solaris network stat output.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
network/datadog_checks/network/network.py
Network._check_psutil
def _check_psutil(self, instance): """ Gather metrics about connections states and interfaces counters using psutil facilities """ custom_tags = instance.get('tags', []) if self._collect_cx_state: self._cx_state_psutil(tags=custom_tags) self._cx_count...
python
def _check_psutil(self, instance): """ Gather metrics about connections states and interfaces counters using psutil facilities """ custom_tags = instance.get('tags', []) if self._collect_cx_state: self._cx_state_psutil(tags=custom_tags) self._cx_count...
[ "def", "_check_psutil", "(", "self", ",", "instance", ")", ":", "custom_tags", "=", "instance", ".", "get", "(", "'tags'", ",", "[", "]", ")", "if", "self", ".", "_collect_cx_state", ":", "self", ".", "_cx_state_psutil", "(", "tags", "=", "custom_tags", ...
Gather metrics about connections states and interfaces counters using psutil facilities
[ "Gather", "metrics", "about", "connections", "states", "and", "interfaces", "counters", "using", "psutil", "facilities" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/network/datadog_checks/network/network.py#L733-L742
train
Gather metrics about connections states and interfaces counters using psutil facilities.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
network/datadog_checks/network/network.py
Network._cx_state_psutil
def _cx_state_psutil(self, tags=None): """ Collect metrics about connections state using psutil """ metrics = defaultdict(int) tags = [] if tags is None else tags for conn in psutil.net_connections(): protocol = self._parse_protocol_psutil(conn) st...
python
def _cx_state_psutil(self, tags=None): """ Collect metrics about connections state using psutil """ metrics = defaultdict(int) tags = [] if tags is None else tags for conn in psutil.net_connections(): protocol = self._parse_protocol_psutil(conn) st...
[ "def", "_cx_state_psutil", "(", "self", ",", "tags", "=", "None", ")", ":", "metrics", "=", "defaultdict", "(", "int", ")", "tags", "=", "[", "]", "if", "tags", "is", "None", "else", "tags", "for", "conn", "in", "psutil", ".", "net_connections", "(", ...
Collect metrics about connections state using psutil
[ "Collect", "metrics", "about", "connections", "state", "using", "psutil" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/network/datadog_checks/network/network.py#L744-L760
train
Collect metrics about connections state using psutil
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
network/datadog_checks/network/network.py
Network._cx_counters_psutil
def _cx_counters_psutil(self, tags=None): """ Collect metrics about interfaces counters using psutil """ tags = [] if tags is None else tags for iface, counters in iteritems(psutil.net_io_counters(pernic=True)): metrics = { 'bytes_rcvd': counters.bytes...
python
def _cx_counters_psutil(self, tags=None): """ Collect metrics about interfaces counters using psutil """ tags = [] if tags is None else tags for iface, counters in iteritems(psutil.net_io_counters(pernic=True)): metrics = { 'bytes_rcvd': counters.bytes...
[ "def", "_cx_counters_psutil", "(", "self", ",", "tags", "=", "None", ")", ":", "tags", "=", "[", "]", "if", "tags", "is", "None", "else", "tags", "for", "iface", ",", "counters", "in", "iteritems", "(", "psutil", ".", "net_io_counters", "(", "pernic", ...
Collect metrics about interfaces counters using psutil
[ "Collect", "metrics", "about", "interfaces", "counters", "using", "psutil" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/network/datadog_checks/network/network.py#L762-L776
train
Collect metrics about interfaces counters using psutil.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
network/datadog_checks/network/network.py
Network._parse_protocol_psutil
def _parse_protocol_psutil(self, conn): """ Returns a string describing the protocol for the given connection in the form `tcp4`, 'udp4` as in `self.cx_state_gauge` """ protocol = self.PSUTIL_TYPE_MAPPING.get(conn.type, '') family = self.PSUTIL_FAMILY_MAPPING.get(conn.fam...
python
def _parse_protocol_psutil(self, conn): """ Returns a string describing the protocol for the given connection in the form `tcp4`, 'udp4` as in `self.cx_state_gauge` """ protocol = self.PSUTIL_TYPE_MAPPING.get(conn.type, '') family = self.PSUTIL_FAMILY_MAPPING.get(conn.fam...
[ "def", "_parse_protocol_psutil", "(", "self", ",", "conn", ")", ":", "protocol", "=", "self", ".", "PSUTIL_TYPE_MAPPING", ".", "get", "(", "conn", ".", "type", ",", "''", ")", "family", "=", "self", ".", "PSUTIL_FAMILY_MAPPING", ".", "get", "(", "conn", ...
Returns a string describing the protocol for the given connection in the form `tcp4`, 'udp4` as in `self.cx_state_gauge`
[ "Returns", "a", "string", "describing", "the", "protocol", "for", "the", "given", "connection", "in", "the", "form", "tcp4", "udp4", "as", "in", "self", ".", "cx_state_gauge" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/network/datadog_checks/network/network.py#L778-L785
train
Returns a string describing the protocol for the given connection
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
PoolWorker.run
def run(self): """Process the work unit, or wait for sentinel to exit""" while True: self.running = True workunit = self._workq.get() if is_sentinel(workunit): # Got sentinel break # Run the job / sequence worku...
python
def run(self): """Process the work unit, or wait for sentinel to exit""" while True: self.running = True workunit = self._workq.get() if is_sentinel(workunit): # Got sentinel break # Run the job / sequence worku...
[ "def", "run", "(", "self", ")", ":", "while", "True", ":", "self", ".", "running", "=", "True", "workunit", "=", "self", ".", "_workq", ".", "get", "(", ")", "if", "is_sentinel", "(", "workunit", ")", ":", "# Got sentinel", "break", "# Run the job / sequ...
Process the work unit, or wait for sentinel to exit
[ "Process", "the", "work", "unit", "or", "wait", "for", "sentinel", "to", "exit" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L56-L67
train
Process the work unit or wait for sentinel to exit
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
Pool.apply
def apply(self, func, args=(), kwds=dict()): """Equivalent of the apply() builtin function. It blocks till the result is ready.""" return self.apply_async(func, args, kwds).get()
python
def apply(self, func, args=(), kwds=dict()): """Equivalent of the apply() builtin function. It blocks till the result is ready.""" return self.apply_async(func, args, kwds).get()
[ "def", "apply", "(", "self", ",", "func", ",", "args", "=", "(", ")", ",", "kwds", "=", "dict", "(", ")", ")", ":", "return", "self", ".", "apply_async", "(", "func", ",", "args", ",", "kwds", ")", ".", "get", "(", ")" ]
Equivalent of the apply() builtin function. It blocks till the result is ready.
[ "Equivalent", "of", "the", "apply", "()", "builtin", "function", ".", "It", "blocks", "till", "the", "result", "is", "ready", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L99-L102
train
Equivalent of the apply() builtin function. It blocks till is ready.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
Pool.map
def map(self, func, iterable, chunksize=None): """A parallel equivalent of the map() builtin function. It blocks till the result is ready. This method chops the iterable into a number of chunks which it submits to the process pool as separate tasks. The (approximate) size of the...
python
def map(self, func, iterable, chunksize=None): """A parallel equivalent of the map() builtin function. It blocks till the result is ready. This method chops the iterable into a number of chunks which it submits to the process pool as separate tasks. The (approximate) size of the...
[ "def", "map", "(", "self", ",", "func", ",", "iterable", ",", "chunksize", "=", "None", ")", ":", "return", "self", ".", "map_async", "(", "func", ",", "iterable", ",", "chunksize", ")", ".", "get", "(", ")" ]
A parallel equivalent of the map() builtin function. It blocks till the result is ready. This method chops the iterable into a number of chunks which it submits to the process pool as separate tasks. The (approximate) size of these chunks can be specified by setting chunksize to...
[ "A", "parallel", "equivalent", "of", "the", "map", "()", "builtin", "function", ".", "It", "blocks", "till", "the", "result", "is", "ready", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L104-L112
train
A parallel equivalent of the map function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
Pool.imap
def imap(self, func, iterable, chunksize=1): """ An equivalent of itertools.imap(). The chunksize argument is the same as the one used by the map() method. For very long iterables using a large value for chunksize can make make the job complete much faster than using the...
python
def imap(self, func, iterable, chunksize=1): """ An equivalent of itertools.imap(). The chunksize argument is the same as the one used by the map() method. For very long iterables using a large value for chunksize can make make the job complete much faster than using the...
[ "def", "imap", "(", "self", ",", "func", ",", "iterable", ",", "chunksize", "=", "1", ")", ":", "collector", "=", "OrderedResultCollector", "(", "as_iterator", "=", "True", ")", "self", ".", "_create_sequences", "(", "func", ",", "iterable", ",", "chunksiz...
An equivalent of itertools.imap(). The chunksize argument is the same as the one used by the map() method. For very long iterables using a large value for chunksize can make make the job complete much faster than using the default value of 1. Also if chunksize is 1 then the nex...
[ "An", "equivalent", "of", "itertools", ".", "imap", "()", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L114-L130
train
A generator function that returns the result of the function func over the given iterable.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
Pool.imap_unordered
def imap_unordered(self, func, iterable, chunksize=1): """The same as imap() except that the ordering of the results from the returned iterator should be considered arbitrary. (Only when there is only one worker process is the order guaranteed to be "correct".)""" collector = Uno...
python
def imap_unordered(self, func, iterable, chunksize=1): """The same as imap() except that the ordering of the results from the returned iterator should be considered arbitrary. (Only when there is only one worker process is the order guaranteed to be "correct".)""" collector = Uno...
[ "def", "imap_unordered", "(", "self", ",", "func", ",", "iterable", ",", "chunksize", "=", "1", ")", ":", "collector", "=", "UnorderedResultCollector", "(", ")", "self", ".", "_create_sequences", "(", "func", ",", "iterable", ",", "chunksize", ",", "collecto...
The same as imap() except that the ordering of the results from the returned iterator should be considered arbitrary. (Only when there is only one worker process is the order guaranteed to be "correct".)
[ "The", "same", "as", "imap", "()", "except", "that", "the", "ordering", "of", "the", "results", "from", "the", "returned", "iterator", "should", "be", "considered", "arbitrary", ".", "(", "Only", "when", "there", "is", "only", "one", "worker", "process", "...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L132-L139
train
The same as imap except that the order of the results is arbitrary.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
Pool.apply_async
def apply_async(self, func, args=(), kwds=dict(), callback=None): """A variant of the apply() method which returns an ApplyResult object. If callback is specified then it should be a callable which accepts a single argument. When the result becomes ready, callback is applied to ...
python
def apply_async(self, func, args=(), kwds=dict(), callback=None): """A variant of the apply() method which returns an ApplyResult object. If callback is specified then it should be a callable which accepts a single argument. When the result becomes ready, callback is applied to ...
[ "def", "apply_async", "(", "self", ",", "func", ",", "args", "=", "(", ")", ",", "kwds", "=", "dict", "(", ")", ",", "callback", "=", "None", ")", ":", "assert", "not", "self", ".", "_closed", "# No lock here. We assume it's atomic...", "apply_result", "="...
A variant of the apply() method which returns an ApplyResult object. If callback is specified then it should be a callable which accepts a single argument. When the result becomes ready, callback is applied to it (unless the call failed). callback should complete immediately sin...
[ "A", "variant", "of", "the", "apply", "()", "method", "which", "returns", "an", "ApplyResult", "object", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L141-L154
train
A variant of the apply method which returns an ApplyResult object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
Pool.map_async
def map_async(self, func, iterable, chunksize=None, callback=None): """A variant of the map() method which returns a ApplyResult object. If callback is specified then it should be a callable which accepts a single argument. When the result becomes ready callback is applied to it...
python
def map_async(self, func, iterable, chunksize=None, callback=None): """A variant of the map() method which returns a ApplyResult object. If callback is specified then it should be a callable which accepts a single argument. When the result becomes ready callback is applied to it...
[ "def", "map_async", "(", "self", ",", "func", ",", "iterable", ",", "chunksize", "=", "None", ",", "callback", "=", "None", ")", ":", "apply_result", "=", "ApplyResult", "(", "callback", "=", "callback", ")", "collector", "=", "OrderedResultCollector", "(", ...
A variant of the map() method which returns a ApplyResult object. If callback is specified then it should be a callable which accepts a single argument. When the result becomes ready callback is applied to it (unless the call failed). callback should complete immediately since o...
[ "A", "variant", "of", "the", "map", "()", "method", "which", "returns", "a", "ApplyResult", "object", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L156-L168
train
A variant of the map method which returns a ApplyResult object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
Pool.terminate
def terminate(self): """Stops the worker processes immediately without completing outstanding work. When the pool object is garbage collected terminate() will be called immediately.""" self.close() # Clearing the job queue try: while 1: self._...
python
def terminate(self): """Stops the worker processes immediately without completing outstanding work. When the pool object is garbage collected terminate() will be called immediately.""" self.close() # Clearing the job queue try: while 1: self._...
[ "def", "terminate", "(", "self", ")", ":", "self", ".", "close", "(", ")", "# Clearing the job queue", "try", ":", "while", "1", ":", "self", ".", "_workq", ".", "get_nowait", "(", ")", "except", "queue", ".", "Empty", ":", "pass", "# Send one sentinel for...
Stops the worker processes immediately without completing outstanding work. When the pool object is garbage collected terminate() will be called immediately.
[ "Stops", "the", "worker", "processes", "immediately", "without", "completing", "outstanding", "work", ".", "When", "the", "pool", "object", "is", "garbage", "collected", "terminate", "()", "will", "be", "called", "immediately", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L207-L223
train
Stops the worker processes immediately without completing any outstanding work.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
Pool._create_sequences
def _create_sequences(self, func, iterable, chunksize, collector=None): """ Create the WorkUnit objects to process and pushes them on the work queue. Each work unit is meant to process a slice of iterable of size chunksize. If collector is specified, then the ApplyResult objects ...
python
def _create_sequences(self, func, iterable, chunksize, collector=None): """ Create the WorkUnit objects to process and pushes them on the work queue. Each work unit is meant to process a slice of iterable of size chunksize. If collector is specified, then the ApplyResult objects ...
[ "def", "_create_sequences", "(", "self", ",", "func", ",", "iterable", ",", "chunksize", ",", "collector", "=", "None", ")", ":", "assert", "not", "self", ".", "_closed", "# No lock here. We assume it's atomic...", "sequences", "=", "[", "]", "results", "=", "...
Create the WorkUnit objects to process and pushes them on the work queue. Each work unit is meant to process a slice of iterable of size chunksize. If collector is specified, then the ApplyResult objects associated with the jobs will notify collector when their result becomes ready. ...
[ "Create", "the", "WorkUnit", "objects", "to", "process", "and", "pushes", "them", "on", "the", "work", "queue", ".", "Each", "work", "unit", "is", "meant", "to", "process", "a", "slice", "of", "iterable", "of", "size", "chunksize", ".", "If", "collector", ...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L231-L264
train
Create the work unit objects to process and push them onto the work queue.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
Job.process
def process(self): """ Call the function with the args/kwds and tell the ApplyResult that its result is ready. Correctly handles the exceptions happening during the execution of the function """ try: result = self._func(*self._args, **self._kwds) excep...
python
def process(self): """ Call the function with the args/kwds and tell the ApplyResult that its result is ready. Correctly handles the exceptions happening during the execution of the function """ try: result = self._func(*self._args, **self._kwds) excep...
[ "def", "process", "(", "self", ")", ":", "try", ":", "result", "=", "self", ".", "_func", "(", "*", "self", ".", "_args", ",", "*", "*", "self", ".", "_kwds", ")", "except", ":", "self", ".", "_result", ".", "_set_exception", "(", ")", "else", ":...
Call the function with the args/kwds and tell the ApplyResult that its result is ready. Correctly handles the exceptions happening during the execution of the function
[ "Call", "the", "function", "with", "the", "args", "/", "kwds", "and", "tell", "the", "ApplyResult", "that", "its", "result", "is", "ready", ".", "Correctly", "handles", "the", "exceptions", "happening", "during", "the", "execution", "of", "the", "function" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L291-L302
train
Process the result of the function.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
ApplyResult.get
def get(self, timeout=None): """ Returns the result when it arrives. If timeout is not None and the result does not arrive within timeout seconds then TimeoutError is raised. If the remote call raised an exception then that exception will be reraised by get(). """ ...
python
def get(self, timeout=None): """ Returns the result when it arrives. If timeout is not None and the result does not arrive within timeout seconds then TimeoutError is raised. If the remote call raised an exception then that exception will be reraised by get(). """ ...
[ "def", "get", "(", "self", ",", "timeout", "=", "None", ")", ":", "if", "not", "self", ".", "wait", "(", "timeout", ")", ":", "raise", "TimeoutError", "(", "\"Result not available within %fs\"", "%", "timeout", ")", "if", "self", ".", "_success", ":", "r...
Returns the result when it arrives. If timeout is not None and the result does not arrive within timeout seconds then TimeoutError is raised. If the remote call raised an exception then that exception will be reraised by get().
[ "Returns", "the", "result", "when", "it", "arrives", ".", "If", "timeout", "is", "not", "None", "and", "the", "result", "does", "not", "arrive", "within", "timeout", "seconds", "then", "TimeoutError", "is", "raised", ".", "If", "the", "remote", "call", "ra...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L349-L360
train
Returns the result when it arrives within timeout seconds.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
ApplyResult.wait
def wait(self, timeout=None): """Waits until the result is available or until timeout seconds pass.""" self._event.wait(timeout) return self._event.isSet()
python
def wait(self, timeout=None): """Waits until the result is available or until timeout seconds pass.""" self._event.wait(timeout) return self._event.isSet()
[ "def", "wait", "(", "self", ",", "timeout", "=", "None", ")", ":", "self", ".", "_event", ".", "wait", "(", "timeout", ")", "return", "self", ".", "_event", ".", "isSet", "(", ")" ]
Waits until the result is available or until timeout seconds pass.
[ "Waits", "until", "the", "result", "is", "available", "or", "until", "timeout", "seconds", "pass", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L362-L366
train
Waits until the result is available or until timeout is reached.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
ApplyResult._set_value
def _set_value(self, value): """Called by a Job object to tell the result is ready, and provides the value of this result. The object will become ready and successful. The collector's notify_ready() method will be called, and the callback method too""" assert not self.ready() ...
python
def _set_value(self, value): """Called by a Job object to tell the result is ready, and provides the value of this result. The object will become ready and successful. The collector's notify_ready() method will be called, and the callback method too""" assert not self.ready() ...
[ "def", "_set_value", "(", "self", ",", "value", ")", ":", "assert", "not", "self", ".", "ready", "(", ")", "self", ".", "_data", "=", "value", "self", ".", "_success", "=", "True", "self", ".", "_event", ".", "set", "(", ")", "if", "self", ".", "...
Called by a Job object to tell the result is ready, and provides the value of this result. The object will become ready and successful. The collector's notify_ready() method will be called, and the callback method too
[ "Called", "by", "a", "Job", "object", "to", "tell", "the", "result", "is", "ready", "and", "provides", "the", "value", "of", "this", "result", ".", "The", "object", "will", "become", "ready", "and", "successful", ".", "The", "collector", "s", "notify_ready...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L379-L394
train
Set the value of the result of this object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
ApplyResult._set_exception
def _set_exception(self): """Called by a Job object to tell that an exception occured during the processing of the function. The object will become ready but not successful. The collector's notify_ready() method will be called, but NOT the callback method""" assert not self.ready...
python
def _set_exception(self): """Called by a Job object to tell that an exception occured during the processing of the function. The object will become ready but not successful. The collector's notify_ready() method will be called, but NOT the callback method""" assert not self.ready...
[ "def", "_set_exception", "(", "self", ")", ":", "assert", "not", "self", ".", "ready", "(", ")", "self", ".", "_data", "=", "sys", ".", "exc_info", "(", ")", "self", ".", "_success", "=", "False", "self", ".", "_event", ".", "set", "(", ")", "if", ...
Called by a Job object to tell that an exception occured during the processing of the function. The object will become ready but not successful. The collector's notify_ready() method will be called, but NOT the callback method
[ "Called", "by", "a", "Job", "object", "to", "tell", "that", "an", "exception", "occured", "during", "the", "processing", "of", "the", "function", ".", "The", "object", "will", "become", "ready", "but", "not", "successful", ".", "The", "collector", "s", "no...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L396-L406
train
Sets the exception of the object to be raised by the job.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py
UnorderedResultCollector._get_result
def _get_result(self, idx, timeout=None): """Called by the CollectorIterator object to retrieve the result's values one after another, in the order the results have become available. \param idx The index of the result we want, wrt collector's order \param timeout integer telling ...
python
def _get_result(self, idx, timeout=None): """Called by the CollectorIterator object to retrieve the result's values one after another, in the order the results have become available. \param idx The index of the result we want, wrt collector's order \param timeout integer telling ...
[ "def", "_get_result", "(", "self", ",", "idx", ",", "timeout", "=", "None", ")", ":", "self", ".", "_cond", ".", "acquire", "(", ")", "try", ":", "if", "idx", ">=", "self", ".", "_expected", ":", "raise", "IndexError", "elif", "idx", "<", "len", "(...
Called by the CollectorIterator object to retrieve the result's values one after another, in the order the results have become available. \param idx The index of the result we want, wrt collector's order \param timeout integer telling how long to wait (in seconds) for the result ...
[ "Called", "by", "the", "CollectorIterator", "object", "to", "retrieve", "the", "result", "s", "values", "one", "after", "another", "in", "the", "order", "the", "results", "have", "become", "available", ".", "\\", "param", "idx", "The", "index", "of", "the", ...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/libs/thread_pool.py#L514-L540
train
Returns the values of the resultset at the given index
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...