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 | tokumx/datadog_checks/tokumx/vendor/bson/__init__.py | BSON.decode | def decode(self, codec_options=DEFAULT_CODEC_OPTIONS):
"""Decode this BSON data.
By default, returns a BSON document represented as a Python
:class:`dict`. To use a different :class:`MutableMapping` class,
configure a :class:`~bson.codec_options.CodecOptions`::
>>> import c... | python | def decode(self, codec_options=DEFAULT_CODEC_OPTIONS):
"""Decode this BSON data.
By default, returns a BSON document represented as a Python
:class:`dict`. To use a different :class:`MutableMapping` class,
configure a :class:`~bson.codec_options.CodecOptions`::
>>> import c... | [
"def",
"decode",
"(",
"self",
",",
"codec_options",
"=",
"DEFAULT_CODEC_OPTIONS",
")",
":",
"if",
"not",
"isinstance",
"(",
"codec_options",
",",
"CodecOptions",
")",
":",
"raise",
"_CODEC_OPTIONS_TYPE_ERROR",
"return",
"_bson_to_dict",
"(",
"self",
",",
"codec_op... | Decode this BSON data.
By default, returns a BSON document represented as a Python
:class:`dict`. To use a different :class:`MutableMapping` class,
configure a :class:`~bson.codec_options.CodecOptions`::
>>> import collections # From Python standard library.
>>> import... | [
"Decode",
"this",
"BSON",
"data",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/bson/__init__.py#L978-L1021 | train | Decode this BSON data. | 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/stubs/_util.py | subprocess_output | def subprocess_output(command, raise_on_empty_output):
"""
This is a stub to allow a check requiring `Popen` to run without an Agent (e.g. during tests or development),
it's not supposed to be used anywhere outside the `datadog_checks.utils` package.
"""
# Use tempfile, allowing a larger amount of ... | python | def subprocess_output(command, raise_on_empty_output):
"""
This is a stub to allow a check requiring `Popen` to run without an Agent (e.g. during tests or development),
it's not supposed to be used anywhere outside the `datadog_checks.utils` package.
"""
# Use tempfile, allowing a larger amount of ... | [
"def",
"subprocess_output",
"(",
"command",
",",
"raise_on_empty_output",
")",
":",
"# Use tempfile, allowing a larger amount of memory. The subprocess.Popen",
"# docs warn that the data read is buffered in memory. They suggest not to",
"# use subprocess.PIPE if the data size is large or unlimit... | This is a stub to allow a check requiring `Popen` to run without an Agent (e.g. during tests or development),
it's not supposed to be used anywhere outside the `datadog_checks.utils` package. | [
"This",
"is",
"a",
"stub",
"to",
"allow",
"a",
"check",
"requiring",
"Popen",
"to",
"run",
"without",
"an",
"Agent",
"(",
"e",
".",
"g",
".",
"during",
"tests",
"or",
"development",
")",
"it",
"s",
"not",
"supposed",
"to",
"be",
"used",
"anywhere",
"... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/stubs/_util.py#L13-L33 | train | Returns the output of a command in a random order. | 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/helpers.py | _index_list | def _index_list(key_or_list, direction=None):
"""Helper to generate a list of (key, direction) pairs.
Takes such a list, or a single key, or a single key and direction.
"""
if direction is not None:
return [(key_or_list, direction)]
else:
if isinstance(key_or_list, string_type):
... | python | def _index_list(key_or_list, direction=None):
"""Helper to generate a list of (key, direction) pairs.
Takes such a list, or a single key, or a single key and direction.
"""
if direction is not None:
return [(key_or_list, direction)]
else:
if isinstance(key_or_list, string_type):
... | [
"def",
"_index_list",
"(",
"key_or_list",
",",
"direction",
"=",
"None",
")",
":",
"if",
"direction",
"is",
"not",
"None",
":",
"return",
"[",
"(",
"key_or_list",
",",
"direction",
")",
"]",
"else",
":",
"if",
"isinstance",
"(",
"key_or_list",
",",
"stri... | Helper to generate a list of (key, direction) pairs.
Takes such a list, or a single key, or a single key and direction. | [
"Helper",
"to",
"generate",
"a",
"list",
"of",
"(",
"key",
"direction",
")",
"pairs",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/helpers.py#L52-L65 | train | Helper to generate a list of ( key direction ) pairs. | 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/helpers.py | _unpack_response | def _unpack_response(response,
cursor_id=None,
codec_options=_UNICODE_REPLACE_CODEC_OPTIONS):
"""Unpack a response from the database.
Check the response for errors and unpack, returning a dictionary
containing the response data.
Can raise CursorNotFound, NotMa... | python | def _unpack_response(response,
cursor_id=None,
codec_options=_UNICODE_REPLACE_CODEC_OPTIONS):
"""Unpack a response from the database.
Check the response for errors and unpack, returning a dictionary
containing the response data.
Can raise CursorNotFound, NotMa... | [
"def",
"_unpack_response",
"(",
"response",
",",
"cursor_id",
"=",
"None",
",",
"codec_options",
"=",
"_UNICODE_REPLACE_CODEC_OPTIONS",
")",
":",
"response_flag",
"=",
"struct",
".",
"unpack",
"(",
"\"<i\"",
",",
"response",
"[",
":",
"4",
"]",
")",
"[",
"0"... | Unpack a response from the database.
Check the response for errors and unpack, returning a dictionary
containing the response data.
Can raise CursorNotFound, NotMasterError, ExecutionTimeout, or
OperationFailure.
:Parameters:
- `response`: byte string as returned from the database
- `... | [
"Unpack",
"a",
"response",
"from",
"the",
"database",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/helpers.py#L95-L145 | train | Unpack a response from the database into a dictionary of items. | 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/helpers.py | _check_command_response | def _check_command_response(response, msg=None, allowable_errors=None,
parse_write_concern_error=False):
"""Check the response to a command for errors.
"""
if "ok" not in response:
# Server didn't recognize our message as a command.
raise OperationFailure(response... | python | def _check_command_response(response, msg=None, allowable_errors=None,
parse_write_concern_error=False):
"""Check the response to a command for errors.
"""
if "ok" not in response:
# Server didn't recognize our message as a command.
raise OperationFailure(response... | [
"def",
"_check_command_response",
"(",
"response",
",",
"msg",
"=",
"None",
",",
"allowable_errors",
"=",
"None",
",",
"parse_write_concern_error",
"=",
"False",
")",
":",
"if",
"\"ok\"",
"not",
"in",
"response",
":",
"# Server didn't recognize our message as a comman... | Check the response to a command for errors. | [
"Check",
"the",
"response",
"to",
"a",
"command",
"for",
"errors",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/helpers.py#L148-L210 | train | Check the response to a 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 | tokumx/datadog_checks/tokumx/vendor/pymongo/helpers.py | _first_batch | def _first_batch(sock_info, db, coll, query, ntoreturn,
slave_ok, codec_options, read_preference, cmd, listeners):
"""Simple query helper for retrieving a first (and possibly only) batch."""
query = _Query(
0, db, coll, 0, query, None, codec_options,
read_preference, ntoreturn, ... | python | def _first_batch(sock_info, db, coll, query, ntoreturn,
slave_ok, codec_options, read_preference, cmd, listeners):
"""Simple query helper for retrieving a first (and possibly only) batch."""
query = _Query(
0, db, coll, 0, query, None, codec_options,
read_preference, ntoreturn, ... | [
"def",
"_first_batch",
"(",
"sock_info",
",",
"db",
",",
"coll",
",",
"query",
",",
"ntoreturn",
",",
"slave_ok",
",",
"codec_options",
",",
"read_preference",
",",
"cmd",
",",
"listeners",
")",
":",
"query",
"=",
"_Query",
"(",
"0",
",",
"db",
",",
"c... | Simple query helper for retrieving a first (and possibly only) batch. | [
"Simple",
"query",
"helper",
"for",
"retrieving",
"a",
"first",
"(",
"and",
"possibly",
"only",
")",
"batch",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/helpers.py#L253-L294 | train | Simple query helper for retrieving a first batch of objects. | 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/helpers.py | _check_write_command_response | def _check_write_command_response(results):
"""Backward compatibility helper for write command error handling.
"""
errors = [res for res in results
if "writeErrors" in res[1] or "writeConcernError" in res[1]]
if errors:
# If multiple batches had errors
# raise from the last... | python | def _check_write_command_response(results):
"""Backward compatibility helper for write command error handling.
"""
errors = [res for res in results
if "writeErrors" in res[1] or "writeConcernError" in res[1]]
if errors:
# If multiple batches had errors
# raise from the last... | [
"def",
"_check_write_command_response",
"(",
"results",
")",
":",
"errors",
"=",
"[",
"res",
"for",
"res",
"in",
"results",
"if",
"\"writeErrors\"",
"in",
"res",
"[",
"1",
"]",
"or",
"\"writeConcernError\"",
"in",
"res",
"[",
"1",
"]",
"]",
"if",
"errors",... | Backward compatibility helper for write command error handling. | [
"Backward",
"compatibility",
"helper",
"for",
"write",
"command",
"error",
"handling",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/helpers.py#L297-L323 | train | Check if the response from the write command is correct. | 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/helpers.py | _fields_list_to_dict | def _fields_list_to_dict(fields, option_name):
"""Takes a sequence of field names and returns a matching dictionary.
["a", "b"] becomes {"a": 1, "b": 1}
and
["a.b.c", "d", "a.c"] becomes {"a.b.c": 1, "d": 1, "a.c": 1}
"""
if isinstance(fields, collections.Mapping):
return fields
... | python | def _fields_list_to_dict(fields, option_name):
"""Takes a sequence of field names and returns a matching dictionary.
["a", "b"] becomes {"a": 1, "b": 1}
and
["a.b.c", "d", "a.c"] becomes {"a.b.c": 1, "d": 1, "a.c": 1}
"""
if isinstance(fields, collections.Mapping):
return fields
... | [
"def",
"_fields_list_to_dict",
"(",
"fields",
",",
"option_name",
")",
":",
"if",
"isinstance",
"(",
"fields",
",",
"collections",
".",
"Mapping",
")",
":",
"return",
"fields",
"if",
"isinstance",
"(",
"fields",
",",
"collections",
".",
"Sequence",
")",
":",... | Takes a sequence of field names and returns a matching dictionary.
["a", "b"] becomes {"a": 1, "b": 1}
and
["a.b.c", "d", "a.c"] becomes {"a.b.c": 1, "d": 1, "a.c": 1} | [
"Takes",
"a",
"sequence",
"of",
"field",
"names",
"and",
"returns",
"a",
"matching",
"dictionary",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/helpers.py#L326-L346 | train | Takes a sequence of field names and returns a matching 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 | tokumx/datadog_checks/tokumx/vendor/pymongo/helpers.py | _handle_exception | def _handle_exception():
"""Print exceptions raised by subscribers to stderr."""
# Heavily influenced by logging.Handler.handleError.
# See note here:
# https://docs.python.org/3.4/library/sys.html#sys.__stderr__
if sys.stderr:
einfo = sys.exc_info()
try:
traceback.print... | python | def _handle_exception():
"""Print exceptions raised by subscribers to stderr."""
# Heavily influenced by logging.Handler.handleError.
# See note here:
# https://docs.python.org/3.4/library/sys.html#sys.__stderr__
if sys.stderr:
einfo = sys.exc_info()
try:
traceback.print... | [
"def",
"_handle_exception",
"(",
")",
":",
"# Heavily influenced by logging.Handler.handleError.",
"# See note here:",
"# https://docs.python.org/3.4/library/sys.html#sys.__stderr__",
"if",
"sys",
".",
"stderr",
":",
"einfo",
"=",
"sys",
".",
"exc_info",
"(",
")",
"try",
":... | Print exceptions raised by subscribers to stderr. | [
"Print",
"exceptions",
"raised",
"by",
"subscribers",
"to",
"stderr",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/helpers.py#L349-L363 | train | Print exceptions raised by subscribers to stderr. | 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState._create_kubernetes_state_prometheus_instance | def _create_kubernetes_state_prometheus_instance(self, instance):
"""
Set up the kubernetes_state instance so it can be used in OpenMetricsBaseCheck
"""
ksm_instance = deepcopy(instance)
endpoint = instance.get('kube_state_url')
if endpoint is None:
raise Chec... | python | def _create_kubernetes_state_prometheus_instance(self, instance):
"""
Set up the kubernetes_state instance so it can be used in OpenMetricsBaseCheck
"""
ksm_instance = deepcopy(instance)
endpoint = instance.get('kube_state_url')
if endpoint is None:
raise Chec... | [
"def",
"_create_kubernetes_state_prometheus_instance",
"(",
"self",
",",
"instance",
")",
":",
"ksm_instance",
"=",
"deepcopy",
"(",
"instance",
")",
"endpoint",
"=",
"instance",
".",
"get",
"(",
"'kube_state_url'",
")",
"if",
"endpoint",
"is",
"None",
":",
"rai... | Set up the kubernetes_state instance so it can be used in OpenMetricsBaseCheck | [
"Set",
"up",
"the",
"kubernetes_state",
"instance",
"so",
"it",
"can",
"be",
"used",
"in",
"OpenMetricsBaseCheck"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L99-L271 | train | Create the kubernetes_state instance so it can be used in OpenMetricsBaseCheck | 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState._condition_to_service_check | def _condition_to_service_check(self, sample, sc_name, mapping, tags=None):
"""
Some metrics contains conditions, labels that have "condition" as name and "true", "false", or "unknown"
as value. The metric value is expected to be a gauge equal to 0 or 1 in this case.
For example:
... | python | def _condition_to_service_check(self, sample, sc_name, mapping, tags=None):
"""
Some metrics contains conditions, labels that have "condition" as name and "true", "false", or "unknown"
as value. The metric value is expected to be a gauge equal to 0 or 1 in this case.
For example:
... | [
"def",
"_condition_to_service_check",
"(",
"self",
",",
"sample",
",",
"sc_name",
",",
"mapping",
",",
"tags",
"=",
"None",
")",
":",
"if",
"bool",
"(",
"sample",
"[",
"self",
".",
"SAMPLE_VALUE",
"]",
")",
"is",
"False",
":",
"return",
"# Ignore if gauge ... | Some metrics contains conditions, labels that have "condition" as name and "true", "false", or "unknown"
as value. The metric value is expected to be a gauge equal to 0 or 1 in this case.
For example:
metric {
label { name: "condition", value: "true"
}
# other labe... | [
"Some",
"metrics",
"contains",
"conditions",
"labels",
"that",
"have",
"condition",
"as",
"name",
"and",
"true",
"false",
"or",
"unknown",
"as",
"value",
".",
"The",
"metric",
"value",
"is",
"expected",
"to",
"be",
"a",
"gauge",
"equal",
"to",
"0",
"or",
... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L273-L296 | train | This function evaluates the sample and sends a service check based on the condition. | 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState._condition_to_tag_check | def _condition_to_tag_check(self, sample, base_sc_name, mapping, scraper_config, tags=None):
"""
Metrics from kube-state-metrics have changed
For example:
kube_node_status_condition{condition="Ready",node="ip-172-33-39-189.eu-west-1.compute",status="true"} 1
kube_node_status_cond... | python | def _condition_to_tag_check(self, sample, base_sc_name, mapping, scraper_config, tags=None):
"""
Metrics from kube-state-metrics have changed
For example:
kube_node_status_condition{condition="Ready",node="ip-172-33-39-189.eu-west-1.compute",status="true"} 1
kube_node_status_cond... | [
"def",
"_condition_to_tag_check",
"(",
"self",
",",
"sample",
",",
"base_sc_name",
",",
"mapping",
",",
"scraper_config",
",",
"tags",
"=",
"None",
")",
":",
"if",
"bool",
"(",
"sample",
"[",
"self",
".",
"SAMPLE_VALUE",
"]",
")",
"is",
"False",
":",
"re... | Metrics from kube-state-metrics have changed
For example:
kube_node_status_condition{condition="Ready",node="ip-172-33-39-189.eu-west-1.compute",status="true"} 1
kube_node_status_condition{condition="OutOfDisk",node="ip-172-33-57-130.eu-west-1.compute",status="false"} 1
metric {
... | [
"Metrics",
"from",
"kube",
"-",
"state",
"-",
"metrics",
"have",
"changed",
"For",
"example",
":",
"kube_node_status_condition",
"{",
"condition",
"=",
"Ready",
"node",
"=",
"ip",
"-",
"172",
"-",
"33",
"-",
"39",
"-",
"189",
".",
"eu",
"-",
"west",
"-... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L298-L328 | train | This function evaluates the sample and sends a service check based on the condition. | 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState._format_tag | def _format_tag(self, name, value, scraper_config):
"""
Lookups the labels_mapper table to see if replacing the tag name is
necessary, then returns a "name:value" tag string
"""
return '%s:%s' % (scraper_config['labels_mapper'].get(name, name), value) | python | def _format_tag(self, name, value, scraper_config):
"""
Lookups the labels_mapper table to see if replacing the tag name is
necessary, then returns a "name:value" tag string
"""
return '%s:%s' % (scraper_config['labels_mapper'].get(name, name), value) | [
"def",
"_format_tag",
"(",
"self",
",",
"name",
",",
"value",
",",
"scraper_config",
")",
":",
"return",
"'%s:%s'",
"%",
"(",
"scraper_config",
"[",
"'labels_mapper'",
"]",
".",
"get",
"(",
"name",
",",
"name",
")",
",",
"value",
")"
] | Lookups the labels_mapper table to see if replacing the tag name is
necessary, then returns a "name:value" tag string | [
"Lookups",
"the",
"labels_mapper",
"table",
"to",
"see",
"if",
"replacing",
"the",
"tag",
"name",
"is",
"necessary",
"then",
"returns",
"a",
"name",
":",
"value",
"tag",
"string"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L356-L361 | train | Formats a tag name and value for the scraper 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState._label_to_tag | def _label_to_tag(self, name, labels, scraper_config, tag_name=None):
"""
Search for `name` in labels name and returns corresponding tag string.
Tag name is label name if not specified.
Returns None if name was not found.
"""
value = labels.get(name)
if value:
... | python | def _label_to_tag(self, name, labels, scraper_config, tag_name=None):
"""
Search for `name` in labels name and returns corresponding tag string.
Tag name is label name if not specified.
Returns None if name was not found.
"""
value = labels.get(name)
if value:
... | [
"def",
"_label_to_tag",
"(",
"self",
",",
"name",
",",
"labels",
",",
"scraper_config",
",",
"tag_name",
"=",
"None",
")",
":",
"value",
"=",
"labels",
".",
"get",
"(",
"name",
")",
"if",
"value",
":",
"return",
"self",
".",
"_format_tag",
"(",
"tag_na... | Search for `name` in labels name and returns corresponding tag string.
Tag name is label name if not specified.
Returns None if name was not found. | [
"Search",
"for",
"name",
"in",
"labels",
"name",
"and",
"returns",
"corresponding",
"tag",
"string",
".",
"Tag",
"name",
"is",
"label",
"name",
"if",
"not",
"specified",
".",
"Returns",
"None",
"if",
"name",
"was",
"not",
"found",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L363-L373 | train | Returns a tag string corresponding to the given label 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState.kube_pod_status_phase | def kube_pod_status_phase(self, metric, scraper_config):
""" Phase a pod is in. """
metric_name = scraper_config['namespace'] + '.pod.status_phase'
status_phase_counter = Counter()
for sample in metric.samples:
# Counts aggregated cluster-wide to avoid no-data issues on pod ... | python | def kube_pod_status_phase(self, metric, scraper_config):
""" Phase a pod is in. """
metric_name = scraper_config['namespace'] + '.pod.status_phase'
status_phase_counter = Counter()
for sample in metric.samples:
# Counts aggregated cluster-wide to avoid no-data issues on pod ... | [
"def",
"kube_pod_status_phase",
"(",
"self",
",",
"metric",
",",
"scraper_config",
")",
":",
"metric_name",
"=",
"scraper_config",
"[",
"'namespace'",
"]",
"+",
"'.pod.status_phase'",
"status_phase_counter",
"=",
"Counter",
"(",
")",
"for",
"sample",
"in",
"metric... | Phase a pod is in. | [
"Phase",
"a",
"pod",
"is",
"in",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L387-L402 | train | A metric that counts how many times a pod is in a certain phase. | 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState.kube_cronjob_next_schedule_time | def kube_cronjob_next_schedule_time(self, metric, scraper_config):
""" Time until the next schedule """
# Used as a service check so that one can be alerted if the cronjob's next schedule is in the past
check_basename = scraper_config['namespace'] + '.cronjob.on_schedule_check'
curr_time... | python | def kube_cronjob_next_schedule_time(self, metric, scraper_config):
""" Time until the next schedule """
# Used as a service check so that one can be alerted if the cronjob's next schedule is in the past
check_basename = scraper_config['namespace'] + '.cronjob.on_schedule_check'
curr_time... | [
"def",
"kube_cronjob_next_schedule_time",
"(",
"self",
",",
"metric",
",",
"scraper_config",
")",
":",
"# Used as a service check so that one can be alerted if the cronjob's next schedule is in the past",
"check_basename",
"=",
"scraper_config",
"[",
"'namespace'",
"]",
"+",
"'.c... | Time until the next schedule | [
"Time",
"until",
"the",
"next",
"schedule"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L448-L466 | train | Time until the next schedule | 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState.kube_node_status_condition | def kube_node_status_condition(self, metric, scraper_config):
""" The ready status of a cluster node. v1.0+"""
base_check_name = scraper_config['namespace'] + '.node'
metric_name = scraper_config['namespace'] + '.nodes.by_condition'
by_condition_counter = Counter()
for sample in... | python | def kube_node_status_condition(self, metric, scraper_config):
""" The ready status of a cluster node. v1.0+"""
base_check_name = scraper_config['namespace'] + '.node'
metric_name = scraper_config['namespace'] + '.nodes.by_condition'
by_condition_counter = Counter()
for sample in... | [
"def",
"kube_node_status_condition",
"(",
"self",
",",
"metric",
",",
"scraper_config",
")",
":",
"base_check_name",
"=",
"scraper_config",
"[",
"'namespace'",
"]",
"+",
"'.node'",
"metric_name",
"=",
"scraper_config",
"[",
"'namespace'",
"]",
"+",
"'.nodes.by_condi... | The ready status of a cluster node. v1.0+ | [
"The",
"ready",
"status",
"of",
"a",
"cluster",
"node",
".",
"v1",
".",
"0",
"+"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L514-L539 | train | The ready status of a cluster node. v1. 0 + | 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState.kube_node_status_ready | def kube_node_status_ready(self, metric, scraper_config):
""" The ready status of a cluster node (legacy)"""
service_check_name = scraper_config['namespace'] + '.node.ready'
for sample in metric.samples:
node_tag = self._label_to_tag("node", sample[self.SAMPLE_LABELS], scraper_config... | python | def kube_node_status_ready(self, metric, scraper_config):
""" The ready status of a cluster node (legacy)"""
service_check_name = scraper_config['namespace'] + '.node.ready'
for sample in metric.samples:
node_tag = self._label_to_tag("node", sample[self.SAMPLE_LABELS], scraper_config... | [
"def",
"kube_node_status_ready",
"(",
"self",
",",
"metric",
",",
"scraper_config",
")",
":",
"service_check_name",
"=",
"scraper_config",
"[",
"'namespace'",
"]",
"+",
"'.node.ready'",
"for",
"sample",
"in",
"metric",
".",
"samples",
":",
"node_tag",
"=",
"self... | The ready status of a cluster node (legacy) | [
"The",
"ready",
"status",
"of",
"a",
"cluster",
"node",
"(",
"legacy",
")"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L541-L551 | train | The ready status of a cluster node. | 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState.kube_node_status_network_unavailable | def kube_node_status_network_unavailable(self, metric, scraper_config):
""" Whether the node is in a network unavailable state (legacy)"""
service_check_name = scraper_config['namespace'] + '.node.network_unavailable'
for sample in metric.samples:
node_tag = self._label_to_tag("node"... | python | def kube_node_status_network_unavailable(self, metric, scraper_config):
""" Whether the node is in a network unavailable state (legacy)"""
service_check_name = scraper_config['namespace'] + '.node.network_unavailable'
for sample in metric.samples:
node_tag = self._label_to_tag("node"... | [
"def",
"kube_node_status_network_unavailable",
"(",
"self",
",",
"metric",
",",
"scraper_config",
")",
":",
"service_check_name",
"=",
"scraper_config",
"[",
"'namespace'",
"]",
"+",
"'.node.network_unavailable'",
"for",
"sample",
"in",
"metric",
".",
"samples",
":",
... | Whether the node is in a network unavailable state (legacy) | [
"Whether",
"the",
"node",
"is",
"in",
"a",
"network",
"unavailable",
"state",
"(",
"legacy",
")"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L589-L599 | train | Whether the node is in a network unavailable 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState.kube_node_spec_unschedulable | def kube_node_spec_unschedulable(self, metric, scraper_config):
""" Whether a node can schedule new pods. """
metric_name = scraper_config['namespace'] + '.node.status'
statuses = ('schedulable', 'unschedulable')
if metric.type in METRIC_TYPES:
for sample in metric.samples:
... | python | def kube_node_spec_unschedulable(self, metric, scraper_config):
""" Whether a node can schedule new pods. """
metric_name = scraper_config['namespace'] + '.node.status'
statuses = ('schedulable', 'unschedulable')
if metric.type in METRIC_TYPES:
for sample in metric.samples:
... | [
"def",
"kube_node_spec_unschedulable",
"(",
"self",
",",
"metric",
",",
"scraper_config",
")",
":",
"metric_name",
"=",
"scraper_config",
"[",
"'namespace'",
"]",
"+",
"'.node.status'",
"statuses",
"=",
"(",
"'schedulable'",
",",
"'unschedulable'",
")",
"if",
"met... | Whether a node can schedule new pods. | [
"Whether",
"a",
"node",
"can",
"schedule",
"new",
"pods",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L601-L616 | train | Whether a node can schedule new pods. | 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState.kube_resourcequota | def kube_resourcequota(self, metric, scraper_config):
""" Quota and current usage by resource type. """
metric_base_name = scraper_config['namespace'] + '.resourcequota.{}.{}'
suffixes = {'used': 'used', 'hard': 'limit'}
if metric.type in METRIC_TYPES:
for sample in metric.sa... | python | def kube_resourcequota(self, metric, scraper_config):
""" Quota and current usage by resource type. """
metric_base_name = scraper_config['namespace'] + '.resourcequota.{}.{}'
suffixes = {'used': 'used', 'hard': 'limit'}
if metric.type in METRIC_TYPES:
for sample in metric.sa... | [
"def",
"kube_resourcequota",
"(",
"self",
",",
"metric",
",",
"scraper_config",
")",
":",
"metric_base_name",
"=",
"scraper_config",
"[",
"'namespace'",
"]",
"+",
"'.resourcequota.{}.{}'",
"suffixes",
"=",
"{",
"'used'",
":",
"'used'",
",",
"'hard'",
":",
"'limi... | Quota and current usage by resource type. | [
"Quota",
"and",
"current",
"usage",
"by",
"resource",
"type",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L618-L632 | train | Quota and current usage by resource type. | 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState.kube_limitrange | def kube_limitrange(self, metric, scraper_config):
""" Resource limits by consumer type. """
# type's cardinality's low: https://github.com/kubernetes/kubernetes/blob/v1.6.1/pkg/api/v1/types.go#L3872-L3879
# idem for resource: https://github.com/kubernetes/kubernetes/blob/v1.6.1/pkg/api/v1/types... | python | def kube_limitrange(self, metric, scraper_config):
""" Resource limits by consumer type. """
# type's cardinality's low: https://github.com/kubernetes/kubernetes/blob/v1.6.1/pkg/api/v1/types.go#L3872-L3879
# idem for resource: https://github.com/kubernetes/kubernetes/blob/v1.6.1/pkg/api/v1/types... | [
"def",
"kube_limitrange",
"(",
"self",
",",
"metric",
",",
"scraper_config",
")",
":",
"# type's cardinality's low: https://github.com/kubernetes/kubernetes/blob/v1.6.1/pkg/api/v1/types.go#L3872-L3879",
"# idem for resource: https://github.com/kubernetes/kubernetes/blob/v1.6.1/pkg/api/v1/types... | Resource limits by consumer type. | [
"Resource",
"limits",
"by",
"consumer",
"type",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L634-L664 | train | Add limit range to the log. | 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 | kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py | KubernetesState.count_objects_by_tags | def count_objects_by_tags(self, metric, scraper_config):
""" Count objects by whitelisted tags and submit counts as gauges. """
config = self.object_count_params[metric.name]
metric_name = "{}.{}".format(scraper_config['namespace'], config['metric_name'])
object_counter = Counter()
... | python | def count_objects_by_tags(self, metric, scraper_config):
""" Count objects by whitelisted tags and submit counts as gauges. """
config = self.object_count_params[metric.name]
metric_name = "{}.{}".format(scraper_config['namespace'], config['metric_name'])
object_counter = Counter()
... | [
"def",
"count_objects_by_tags",
"(",
"self",
",",
"metric",
",",
"scraper_config",
")",
":",
"config",
"=",
"self",
".",
"object_count_params",
"[",
"metric",
".",
"name",
"]",
"metric_name",
"=",
"\"{}.{}\"",
".",
"format",
"(",
"scraper_config",
"[",
"'names... | Count objects by whitelisted tags and submit counts as gauges. | [
"Count",
"objects",
"by",
"whitelisted",
"tags",
"and",
"submit",
"counts",
"as",
"gauges",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes_state/datadog_checks/kubernetes_state/kubernetes_state.py#L666-L679 | train | Count objects by whitelisted tags and submit counts 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 | kubelet/datadog_checks/kubelet/common.py | get_pod_by_uid | def get_pod_by_uid(uid, podlist):
"""
Searches for a pod uid in the podlist and returns the pod if found
:param uid: pod uid
:param podlist: podlist dict object
:return: pod dict object if found, None if not found
"""
for pod in podlist.get("items", []):
try:
if pod["meta... | python | def get_pod_by_uid(uid, podlist):
"""
Searches for a pod uid in the podlist and returns the pod if found
:param uid: pod uid
:param podlist: podlist dict object
:return: pod dict object if found, None if not found
"""
for pod in podlist.get("items", []):
try:
if pod["meta... | [
"def",
"get_pod_by_uid",
"(",
"uid",
",",
"podlist",
")",
":",
"for",
"pod",
"in",
"podlist",
".",
"get",
"(",
"\"items\"",
",",
"[",
"]",
")",
":",
"try",
":",
"if",
"pod",
"[",
"\"metadata\"",
"]",
"[",
"\"uid\"",
"]",
"==",
"uid",
":",
"return",... | Searches for a pod uid in the podlist and returns the pod if found
:param uid: pod uid
:param podlist: podlist dict object
:return: pod dict object if found, None if not found | [
"Searches",
"for",
"a",
"pod",
"uid",
"in",
"the",
"podlist",
"and",
"returns",
"the",
"pod",
"if",
"found",
":",
"param",
"uid",
":",
"pod",
"uid",
":",
"param",
"podlist",
":",
"podlist",
"dict",
"object",
":",
"return",
":",
"pod",
"dict",
"object",... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/common.py#L41-L54 | train | Searches for a pod in the podlist and returns the pod if found None if not found | 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 | kubelet/datadog_checks/kubelet/common.py | is_static_pending_pod | def is_static_pending_pod(pod):
"""
Return if the pod is a static pending pod
See https://github.com/kubernetes/kubernetes/pull/57106
:param pod: dict
:return: bool
"""
try:
if pod["metadata"]["annotations"]["kubernetes.io/config.source"] == "api":
return False
p... | python | def is_static_pending_pod(pod):
"""
Return if the pod is a static pending pod
See https://github.com/kubernetes/kubernetes/pull/57106
:param pod: dict
:return: bool
"""
try:
if pod["metadata"]["annotations"]["kubernetes.io/config.source"] == "api":
return False
p... | [
"def",
"is_static_pending_pod",
"(",
"pod",
")",
":",
"try",
":",
"if",
"pod",
"[",
"\"metadata\"",
"]",
"[",
"\"annotations\"",
"]",
"[",
"\"kubernetes.io/config.source\"",
"]",
"==",
"\"api\"",
":",
"return",
"False",
"pod_status",
"=",
"pod",
"[",
"\"status... | Return if the pod is a static pending pod
See https://github.com/kubernetes/kubernetes/pull/57106
:param pod: dict
:return: bool | [
"Return",
"if",
"the",
"pod",
"is",
"a",
"static",
"pending",
"pod",
"See",
"https",
":",
"//",
"github",
".",
"com",
"/",
"kubernetes",
"/",
"kubernetes",
"/",
"pull",
"/",
"57106",
":",
"param",
"pod",
":",
"dict",
":",
"return",
":",
"bool"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/common.py#L57-L74 | train | Return if the pod is a static pending pod | 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 | kubelet/datadog_checks/kubelet/common.py | PodListUtils.is_excluded | def is_excluded(self, cid, pod_uid=None):
"""
Queries the agent6 container filter interface. It retrieves container
name + image from the podlist, so static pod filtering is not supported.
Result is cached between calls to avoid the python-go switching cost for
prometheus metric... | python | def is_excluded(self, cid, pod_uid=None):
"""
Queries the agent6 container filter interface. It retrieves container
name + image from the podlist, so static pod filtering is not supported.
Result is cached between calls to avoid the python-go switching cost for
prometheus metric... | [
"def",
"is_excluded",
"(",
"self",
",",
"cid",
",",
"pod_uid",
"=",
"None",
")",
":",
"if",
"not",
"cid",
":",
"return",
"True",
"if",
"cid",
"in",
"self",
".",
"cache",
":",
"return",
"self",
".",
"cache",
"[",
"cid",
"]",
"if",
"pod_uid",
"and",
... | Queries the agent6 container filter interface. It retrieves container
name + image from the podlist, so static pod filtering is not supported.
Result is cached between calls to avoid the python-go switching cost for
prometheus metrics (will be called once per metric)
:param cid: contain... | [
"Queries",
"the",
"agent6",
"container",
"filter",
"interface",
".",
"It",
"retrieves",
"container",
"name",
"+",
"image",
"from",
"the",
"podlist",
"so",
"static",
"pod",
"filtering",
"is",
"not",
"supported",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/common.py#L139-L172 | train | Queries the agent6 container filter interface. It retrieves the container ID and image from the podlist and returns True if the container ID is not in the podlist False otherwise. | 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 | kubelet/datadog_checks/kubelet/common.py | KubeletCredentials.cert_pair | def cert_pair(self):
"""
Returns the client certificates
:return: tuple (crt,key) or None
"""
if self._ssl_cert and self._ssl_private_key:
return (self._ssl_cert, self._ssl_private_key)
else:
return None | python | def cert_pair(self):
"""
Returns the client certificates
:return: tuple (crt,key) or None
"""
if self._ssl_cert and self._ssl_private_key:
return (self._ssl_cert, self._ssl_private_key)
else:
return None | [
"def",
"cert_pair",
"(",
"self",
")",
":",
"if",
"self",
".",
"_ssl_cert",
"and",
"self",
".",
"_ssl_private_key",
":",
"return",
"(",
"self",
".",
"_ssl_cert",
",",
"self",
".",
"_ssl_private_key",
")",
"else",
":",
"return",
"None"
] | Returns the client certificates
:return: tuple (crt,key) or None | [
"Returns",
"the",
"client",
"certificates",
":",
"return",
":",
"tuple",
"(",
"crt",
"key",
")",
"or",
"None"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/common.py#L205-L213 | train | Returns the client certificates and keys in the SSL certificate or None if no client certificates are available. | 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 | kubelet/datadog_checks/kubelet/common.py | KubeletCredentials.headers | def headers(self, url):
"""
Returns the https headers with credentials, if token is used and url is https
:param url: url to be queried, including scheme
:return: dict or None
"""
if self._token and url.lower().startswith('https'):
return {'Authorization': 'Be... | python | def headers(self, url):
"""
Returns the https headers with credentials, if token is used and url is https
:param url: url to be queried, including scheme
:return: dict or None
"""
if self._token and url.lower().startswith('https'):
return {'Authorization': 'Be... | [
"def",
"headers",
"(",
"self",
",",
"url",
")",
":",
"if",
"self",
".",
"_token",
"and",
"url",
".",
"lower",
"(",
")",
".",
"startswith",
"(",
"'https'",
")",
":",
"return",
"{",
"'Authorization'",
":",
"'Bearer {}'",
".",
"format",
"(",
"self",
"."... | Returns the https headers with credentials, if token is used and url is https
:param url: url to be queried, including scheme
:return: dict or None | [
"Returns",
"the",
"https",
"headers",
"with",
"credentials",
"if",
"token",
"is",
"used",
"and",
"url",
"is",
"https",
":",
"param",
"url",
":",
"url",
"to",
"be",
"queried",
"including",
"scheme",
":",
"return",
":",
"dict",
"or",
"None"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/common.py#L215-L224 | train | Returns the https headers with credentials if token is used and url is https
| 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 | kubelet/datadog_checks/kubelet/common.py | KubeletCredentials.configure_scraper | def configure_scraper(self, scraper_config):
"""
Configures a PrometheusScaper object with query credentials
:param scraper: valid PrometheusScaper object
:param endpoint: url that will be scraped
"""
endpoint = scraper_config['prometheus_url']
scraper_config.upda... | python | def configure_scraper(self, scraper_config):
"""
Configures a PrometheusScaper object with query credentials
:param scraper: valid PrometheusScaper object
:param endpoint: url that will be scraped
"""
endpoint = scraper_config['prometheus_url']
scraper_config.upda... | [
"def",
"configure_scraper",
"(",
"self",
",",
"scraper_config",
")",
":",
"endpoint",
"=",
"scraper_config",
"[",
"'prometheus_url'",
"]",
"scraper_config",
".",
"update",
"(",
"{",
"'ssl_ca_cert'",
":",
"self",
".",
"_ssl_verify",
",",
"'ssl_cert'",
":",
"self"... | Configures a PrometheusScaper object with query credentials
:param scraper: valid PrometheusScaper object
:param endpoint: url that will be scraped | [
"Configures",
"a",
"PrometheusScaper",
"object",
"with",
"query",
"credentials",
":",
"param",
"scraper",
":",
"valid",
"PrometheusScaper",
"object",
":",
"param",
"endpoint",
":",
"url",
"that",
"will",
"be",
"scraped"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/common.py#L233-L247 | train | Configure a PrometheusScaper object with query credentials | 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/git.py | files_changed | def files_changed():
"""
Return the list of file changed in the current branch compared to `master`
"""
with chdir(get_root()):
result = run_command('git diff --name-only master...', capture='out')
changed_files = result.stdout.splitlines()
# Remove empty lines
return [f for f in ch... | python | def files_changed():
"""
Return the list of file changed in the current branch compared to `master`
"""
with chdir(get_root()):
result = run_command('git diff --name-only master...', capture='out')
changed_files = result.stdout.splitlines()
# Remove empty lines
return [f for f in ch... | [
"def",
"files_changed",
"(",
")",
":",
"with",
"chdir",
"(",
"get_root",
"(",
")",
")",
":",
"result",
"=",
"run_command",
"(",
"'git diff --name-only master...'",
",",
"capture",
"=",
"'out'",
")",
"changed_files",
"=",
"result",
".",
"stdout",
".",
"splitl... | Return the list of file changed in the current branch compared to `master` | [
"Return",
"the",
"list",
"of",
"file",
"changed",
"in",
"the",
"current",
"branch",
"compared",
"to",
"master"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/git.py#L22-L31 | train | Return the list of files changed in the current branch compared to master | 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/git.py | get_commits_since | def get_commits_since(check_name, target_tag=None):
"""
Get the list of commits from `target_tag` to `HEAD` for the given check
"""
root = get_root()
target_path = os.path.join(root, check_name)
command = 'git log --pretty=%s {}{}'.format('' if target_tag is None else '{}... '.format(target_tag)... | python | def get_commits_since(check_name, target_tag=None):
"""
Get the list of commits from `target_tag` to `HEAD` for the given check
"""
root = get_root()
target_path = os.path.join(root, check_name)
command = 'git log --pretty=%s {}{}'.format('' if target_tag is None else '{}... '.format(target_tag)... | [
"def",
"get_commits_since",
"(",
"check_name",
",",
"target_tag",
"=",
"None",
")",
":",
"root",
"=",
"get_root",
"(",
")",
"target_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"root",
",",
"check_name",
")",
"command",
"=",
"'git log --pretty=%s {}{}'",... | Get the list of commits from `target_tag` to `HEAD` for the given check | [
"Get",
"the",
"list",
"of",
"commits",
"from",
"target_tag",
"to",
"HEAD",
"for",
"the",
"given",
"check"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/git.py#L34-L43 | train | Get the list of commits from target_tag to HEAD for the given check_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/tooling/git.py | git_show_file | def git_show_file(path, ref):
"""
Return the contents of a file at a given tag
"""
root = get_root()
command = 'git show {}:{}'.format(ref, path)
with chdir(root):
return run_command(command, capture=True).stdout | python | def git_show_file(path, ref):
"""
Return the contents of a file at a given tag
"""
root = get_root()
command = 'git show {}:{}'.format(ref, path)
with chdir(root):
return run_command(command, capture=True).stdout | [
"def",
"git_show_file",
"(",
"path",
",",
"ref",
")",
":",
"root",
"=",
"get_root",
"(",
")",
"command",
"=",
"'git show {}:{}'",
".",
"format",
"(",
"ref",
",",
"path",
")",
"with",
"chdir",
"(",
"root",
")",
":",
"return",
"run_command",
"(",
"comman... | Return the contents of a file at a given tag | [
"Return",
"the",
"contents",
"of",
"a",
"file",
"at",
"a",
"given",
"tag"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/git.py#L46-L54 | train | Return the contents of a file at a given tag
| 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/git.py | git_commit | def git_commit(targets, message, force=False, sign=False):
"""
Commit the changes for the given targets.
"""
root = get_root()
target_paths = []
for t in targets:
target_paths.append(os.path.join(root, t))
with chdir(root):
result = run_command('git add{} {}'.format(' -f' if... | python | def git_commit(targets, message, force=False, sign=False):
"""
Commit the changes for the given targets.
"""
root = get_root()
target_paths = []
for t in targets:
target_paths.append(os.path.join(root, t))
with chdir(root):
result = run_command('git add{} {}'.format(' -f' if... | [
"def",
"git_commit",
"(",
"targets",
",",
"message",
",",
"force",
"=",
"False",
",",
"sign",
"=",
"False",
")",
":",
"root",
"=",
"get_root",
"(",
")",
"target_paths",
"=",
"[",
"]",
"for",
"t",
"in",
"targets",
":",
"target_paths",
".",
"append",
"... | Commit the changes for the given targets. | [
"Commit",
"the",
"changes",
"for",
"the",
"given",
"targets",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/git.py#L57-L71 | train | Commit changes for the given targets. | 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/git.py | git_tag | def git_tag(tag_name, push=False):
"""
Tag the repo using an annotated tag.
"""
with chdir(get_root()):
result = run_command('git tag -a {} -m "{}"'.format(tag_name, tag_name), capture=True)
if push:
if result.code != 0:
return result
return run_c... | python | def git_tag(tag_name, push=False):
"""
Tag the repo using an annotated tag.
"""
with chdir(get_root()):
result = run_command('git tag -a {} -m "{}"'.format(tag_name, tag_name), capture=True)
if push:
if result.code != 0:
return result
return run_c... | [
"def",
"git_tag",
"(",
"tag_name",
",",
"push",
"=",
"False",
")",
":",
"with",
"chdir",
"(",
"get_root",
"(",
")",
")",
":",
"result",
"=",
"run_command",
"(",
"'git tag -a {} -m \"{}\"'",
".",
"format",
"(",
"tag_name",
",",
"tag_name",
")",
",",
"capt... | Tag the repo using an annotated tag. | [
"Tag",
"the",
"repo",
"using",
"an",
"annotated",
"tag",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/git.py#L74-L86 | train | Tag the repo using an annotated tag. | 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/git.py | git_tag_list | def git_tag_list(pattern=None):
"""
Return a list of all the tags in the git repo matching a regex passed in
`pattern`. If `pattern` is None, return all the tags.
"""
with chdir(get_root()):
result = run_command('git tag', capture=True).stdout
result = result.splitlines()
if not... | python | def git_tag_list(pattern=None):
"""
Return a list of all the tags in the git repo matching a regex passed in
`pattern`. If `pattern` is None, return all the tags.
"""
with chdir(get_root()):
result = run_command('git tag', capture=True).stdout
result = result.splitlines()
if not... | [
"def",
"git_tag_list",
"(",
"pattern",
"=",
"None",
")",
":",
"with",
"chdir",
"(",
"get_root",
"(",
")",
")",
":",
"result",
"=",
"run_command",
"(",
"'git tag'",
",",
"capture",
"=",
"True",
")",
".",
"stdout",
"result",
"=",
"result",
".",
"splitlin... | Return a list of all the tags in the git repo matching a regex passed in
`pattern`. If `pattern` is None, return all the tags. | [
"Return",
"a",
"list",
"of",
"all",
"the",
"tags",
"in",
"the",
"git",
"repo",
"matching",
"a",
"regex",
"passed",
"in",
"pattern",
".",
"If",
"pattern",
"is",
"None",
"return",
"all",
"the",
"tags",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/git.py#L89-L102 | train | Return a list of all the tags in the git repo matching a regex passed in
pattern. | 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/git.py | git_ls_files | def git_ls_files(filename):
"""
Return a boolean value for whether the given file is tracked by git.
"""
with chdir(get_root()):
# https://stackoverflow.com/a/2406813
result = run_command('git ls-files --error-unmatch {}'.format(filename), capture=True)
return result.code == 0 | python | def git_ls_files(filename):
"""
Return a boolean value for whether the given file is tracked by git.
"""
with chdir(get_root()):
# https://stackoverflow.com/a/2406813
result = run_command('git ls-files --error-unmatch {}'.format(filename), capture=True)
return result.code == 0 | [
"def",
"git_ls_files",
"(",
"filename",
")",
":",
"with",
"chdir",
"(",
"get_root",
"(",
")",
")",
":",
"# https://stackoverflow.com/a/2406813",
"result",
"=",
"run_command",
"(",
"'git ls-files --error-unmatch {}'",
".",
"format",
"(",
"filename",
")",
",",
"capt... | Return a boolean value for whether the given file is tracked by git. | [
"Return",
"a",
"boolean",
"value",
"for",
"whether",
"the",
"given",
"file",
"is",
"tracked",
"by",
"git",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/git.py#L105-L112 | train | Return a boolean value for whether the given file is tracked by git. | 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/win/winpdh.py | WinPDHCounter._make_counter_path | def _make_counter_path(self, machine_name, counter_name, instance_name, counters):
"""
When handling non english versions, the counters don't work quite as documented.
This is because strings like "Bytes Sent/sec" might appear multiple times in the
english master, and might not have mapp... | python | def _make_counter_path(self, machine_name, counter_name, instance_name, counters):
"""
When handling non english versions, the counters don't work quite as documented.
This is because strings like "Bytes Sent/sec" might appear multiple times in the
english master, and might not have mapp... | [
"def",
"_make_counter_path",
"(",
"self",
",",
"machine_name",
",",
"counter_name",
",",
"instance_name",
",",
"counters",
")",
":",
"path",
"=",
"\"\"",
"if",
"WinPDHCounter",
".",
"_use_en_counter_names",
":",
"'''\n In this case, we don't have any translatio... | When handling non english versions, the counters don't work quite as documented.
This is because strings like "Bytes Sent/sec" might appear multiple times in the
english master, and might not have mappings for each index.
Search each index, and make sure the requested counter name actually appe... | [
"When",
"handling",
"non",
"english",
"versions",
"the",
"counters",
"don",
"t",
"work",
"quite",
"as",
"documented",
".",
"This",
"is",
"because",
"strings",
"like",
"Bytes",
"Sent",
"/",
"sec",
"might",
"appear",
"multiple",
"times",
"in",
"the",
"english"... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/winpdh.py#L142-L193 | train | Create a counter path for the given counter 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 | nagios/datadog_checks/nagios/nagios.py | Nagios.gauge | def gauge(self, *args, **kwargs):
"""
Compatability wrapper for Agents that do not submit gauge metrics with custom timestamps
"""
orig_gauge = super(Nagios, self).gauge
# remove 'timestamp' arg if the base class' gauge function does not accept a 'timestamp' arg
if 'times... | python | def gauge(self, *args, **kwargs):
"""
Compatability wrapper for Agents that do not submit gauge metrics with custom timestamps
"""
orig_gauge = super(Nagios, self).gauge
# remove 'timestamp' arg if the base class' gauge function does not accept a 'timestamp' arg
if 'times... | [
"def",
"gauge",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"orig_gauge",
"=",
"super",
"(",
"Nagios",
",",
"self",
")",
".",
"gauge",
"# remove 'timestamp' arg if the base class' gauge function does not accept a 'timestamp' arg",
"if",
"'times... | Compatability wrapper for Agents that do not submit gauge metrics with custom timestamps | [
"Compatability",
"wrapper",
"for",
"Agents",
"that",
"do",
"not",
"submit",
"gauge",
"metrics",
"with",
"custom",
"timestamps"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/nagios/datadog_checks/nagios/nagios.py#L85-L94 | train | This is a wrapper for Agents that do not submit gauge metrics with custom timestamps
. | 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 | nagios/datadog_checks/nagios/nagios.py | Nagios.check | def check(self, instance):
"""
Parse until the end of each tailer associated with this instance.
We match instance and tailers based on the path to the Nagios configuration file
Special case: Compatibility with the old conf when no conf file is specified
but the path to the even... | python | def check(self, instance):
"""
Parse until the end of each tailer associated with this instance.
We match instance and tailers based on the path to the Nagios configuration file
Special case: Compatibility with the old conf when no conf file is specified
but the path to the even... | [
"def",
"check",
"(",
"self",
",",
"instance",
")",
":",
"instance_key",
"=",
"instance",
".",
"get",
"(",
"'nagios_conf'",
",",
"instance",
".",
"get",
"(",
"'nagios_perf_cfg'",
",",
"instance",
".",
"get",
"(",
"'nagios_log'",
",",
"None",
")",
")",
")"... | Parse until the end of each tailer associated with this instance.
We match instance and tailers based on the path to the Nagios configuration file
Special case: Compatibility with the old conf when no conf file is specified
but the path to the event_log is given | [
"Parse",
"until",
"the",
"end",
"of",
"each",
"tailer",
"associated",
"with",
"this",
"instance",
".",
"We",
"match",
"instance",
"and",
"tailers",
"based",
"on",
"the",
"path",
"to",
"the",
"Nagios",
"configuration",
"file"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/nagios/datadog_checks/nagios/nagios.py#L207-L221 | train | Check if the instance has any necessary tailers | 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 | nagios/datadog_checks/nagios/nagios.py | NagiosEventLogTailer._parse_line | def _parse_line(self, line):
"""
Actual nagios parsing
Return True if we found an event, False otherwise
"""
# first isolate the timestamp and the event type
try:
self._line_parsed = self._line_parsed + 1
m = RE_LINE_REG.match(line)
if... | python | def _parse_line(self, line):
"""
Actual nagios parsing
Return True if we found an event, False otherwise
"""
# first isolate the timestamp and the event type
try:
self._line_parsed = self._line_parsed + 1
m = RE_LINE_REG.match(line)
if... | [
"def",
"_parse_line",
"(",
"self",
",",
"line",
")",
":",
"# first isolate the timestamp and the event type",
"try",
":",
"self",
".",
"_line_parsed",
"=",
"self",
".",
"_line_parsed",
"+",
"1",
"m",
"=",
"RE_LINE_REG",
".",
"match",
"(",
"line",
")",
"if",
... | Actual nagios parsing
Return True if we found an event, False otherwise | [
"Actual",
"nagios",
"parsing",
"Return",
"True",
"if",
"we",
"found",
"an",
"event",
"False",
"otherwise"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/nagios/datadog_checks/nagios/nagios.py#L298-L342 | train | Parses a line of nagios and returns True if we found an event False otherwise | 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 | nagios/datadog_checks/nagios/nagios.py | NagiosEventLogTailer.create_event | def create_event(self, timestamp, event_type, hostname, fields, tags=None):
"""Factory method called by the parsers
"""
# Agent6 expects a specific set of fields, so we need to place all
# extra fields in the msg_title and let the Datadog backend separate them
# Any remaining fie... | python | def create_event(self, timestamp, event_type, hostname, fields, tags=None):
"""Factory method called by the parsers
"""
# Agent6 expects a specific set of fields, so we need to place all
# extra fields in the msg_title and let the Datadog backend separate them
# Any remaining fie... | [
"def",
"create_event",
"(",
"self",
",",
"timestamp",
",",
"event_type",
",",
"hostname",
",",
"fields",
",",
"tags",
"=",
"None",
")",
":",
"# Agent6 expects a specific set of fields, so we need to place all",
"# extra fields in the msg_title and let the Datadog backend separa... | Factory method called by the parsers | [
"Factory",
"method",
"called",
"by",
"the",
"parsers"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/nagios/datadog_checks/nagios/nagios.py#L344-L379 | train | This method creates an event from the fields and returns the event_payload. | 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 | snmp/datadog_checks/snmp/snmp.py | SnmpCheck.create_snmp_engine | def create_snmp_engine(self, mibs_path):
'''
Create a command generator to perform all the snmp query.
If mibs_path is not None, load the mibs present in the custom mibs
folder. (Need to be in pysnmp format)
'''
snmp_engine = hlapi.SnmpEngine()
mib_builder = snmp_... | python | def create_snmp_engine(self, mibs_path):
'''
Create a command generator to perform all the snmp query.
If mibs_path is not None, load the mibs present in the custom mibs
folder. (Need to be in pysnmp format)
'''
snmp_engine = hlapi.SnmpEngine()
mib_builder = snmp_... | [
"def",
"create_snmp_engine",
"(",
"self",
",",
"mibs_path",
")",
":",
"snmp_engine",
"=",
"hlapi",
".",
"SnmpEngine",
"(",
")",
"mib_builder",
"=",
"snmp_engine",
".",
"getMibBuilder",
"(",
")",
"if",
"mibs_path",
"is",
"not",
"None",
":",
"mib_builder",
"."... | Create a command generator to perform all the snmp query.
If mibs_path is not None, load the mibs present in the custom mibs
folder. (Need to be in pysnmp format) | [
"Create",
"a",
"command",
"generator",
"to",
"perform",
"all",
"the",
"snmp",
"query",
".",
"If",
"mibs_path",
"is",
"not",
"None",
"load",
"the",
"mibs",
"present",
"in",
"the",
"custom",
"mibs",
"folder",
".",
"(",
"Need",
"to",
"be",
"in",
"pysnmp",
... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/snmp/datadog_checks/snmp/snmp.py#L99-L112 | train | Create a command generator to perform all the snmp query. | 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 | snmp/datadog_checks/snmp/snmp.py | SnmpCheck.get_auth_data | def get_auth_data(cls, instance):
'''
Generate a Security Parameters object based on the instance's
configuration.
See http://pysnmp.sourceforge.net/docs/current/security-configuration.html
'''
if "community_string" in instance:
# SNMP v1 - SNMP v2
... | python | def get_auth_data(cls, instance):
'''
Generate a Security Parameters object based on the instance's
configuration.
See http://pysnmp.sourceforge.net/docs/current/security-configuration.html
'''
if "community_string" in instance:
# SNMP v1 - SNMP v2
... | [
"def",
"get_auth_data",
"(",
"cls",
",",
"instance",
")",
":",
"if",
"\"community_string\"",
"in",
"instance",
":",
"# SNMP v1 - SNMP v2",
"# See http://pysnmp.sourceforge.net/docs/current/security-configuration.html",
"if",
"int",
"(",
"instance",
".",
"get",
"(",
"\"snm... | Generate a Security Parameters object based on the instance's
configuration.
See http://pysnmp.sourceforge.net/docs/current/security-configuration.html | [
"Generate",
"a",
"Security",
"Parameters",
"object",
"based",
"on",
"the",
"instance",
"s",
"configuration",
".",
"See",
"http",
":",
"//",
"pysnmp",
".",
"sourceforge",
".",
"net",
"/",
"docs",
"/",
"current",
"/",
"security",
"-",
"configuration",
".",
"... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/snmp/datadog_checks/snmp/snmp.py#L115-L149 | train | Generate a Security Parameters object based on the instance s 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 | snmp/datadog_checks/snmp/snmp.py | SnmpCheck.get_context_data | def get_context_data(cls, instance):
'''
Generate a Context Parameters object based on the instance's
configuration.
We do not use the hlapi currently, but the rfc3413.oneliner.cmdgen
accepts Context Engine Id (always None for now) and Context Name parameters.
'''
... | python | def get_context_data(cls, instance):
'''
Generate a Context Parameters object based on the instance's
configuration.
We do not use the hlapi currently, but the rfc3413.oneliner.cmdgen
accepts Context Engine Id (always None for now) and Context Name parameters.
'''
... | [
"def",
"get_context_data",
"(",
"cls",
",",
"instance",
")",
":",
"context_engine_id",
"=",
"None",
"context_name",
"=",
"''",
"if",
"\"user\"",
"in",
"instance",
":",
"if",
"'context_engine_id'",
"in",
"instance",
":",
"context_engine_id",
"=",
"OctetString",
"... | Generate a Context Parameters object based on the instance's
configuration.
We do not use the hlapi currently, but the rfc3413.oneliner.cmdgen
accepts Context Engine Id (always None for now) and Context Name parameters. | [
"Generate",
"a",
"Context",
"Parameters",
"object",
"based",
"on",
"the",
"instance",
"s",
"configuration",
".",
"We",
"do",
"not",
"use",
"the",
"hlapi",
"currently",
"but",
"the",
"rfc3413",
".",
"oneliner",
".",
"cmdgen",
"accepts",
"Context",
"Engine",
"... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/snmp/datadog_checks/snmp/snmp.py#L152-L169 | train | Generate a Context Parameters object based on the instance s context_engine_id and context_name properties. | 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 | snmp/datadog_checks/snmp/snmp.py | SnmpCheck.get_transport_target | def get_transport_target(cls, instance, timeout, retries):
'''
Generate a Transport target object based on the instance's configuration
'''
if "ip_address" not in instance:
raise Exception("An IP address needs to be specified")
ip_address = instance["ip_address"]
... | python | def get_transport_target(cls, instance, timeout, retries):
'''
Generate a Transport target object based on the instance's configuration
'''
if "ip_address" not in instance:
raise Exception("An IP address needs to be specified")
ip_address = instance["ip_address"]
... | [
"def",
"get_transport_target",
"(",
"cls",
",",
"instance",
",",
"timeout",
",",
"retries",
")",
":",
"if",
"\"ip_address\"",
"not",
"in",
"instance",
":",
"raise",
"Exception",
"(",
"\"An IP address needs to be specified\"",
")",
"ip_address",
"=",
"instance",
"[... | Generate a Transport target object based on the instance's configuration | [
"Generate",
"a",
"Transport",
"target",
"object",
"based",
"on",
"the",
"instance",
"s",
"configuration"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/snmp/datadog_checks/snmp/snmp.py#L172-L180 | train | Generate a Transport target object based on the instance s 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 | snmp/datadog_checks/snmp/snmp.py | SnmpCheck.check_table | def check_table(
self,
instance,
snmp_engine,
mib_view_controller,
oids,
lookup_names,
timeout,
retries,
enforce_constraints=False,
mibs_to_load=None,
):
'''
Perform a snmpwalk on the domain specified by the oids, on the... | python | def check_table(
self,
instance,
snmp_engine,
mib_view_controller,
oids,
lookup_names,
timeout,
retries,
enforce_constraints=False,
mibs_to_load=None,
):
'''
Perform a snmpwalk on the domain specified by the oids, on the... | [
"def",
"check_table",
"(",
"self",
",",
"instance",
",",
"snmp_engine",
",",
"mib_view_controller",
",",
"oids",
",",
"lookup_names",
",",
"timeout",
",",
"retries",
",",
"enforce_constraints",
"=",
"False",
",",
"mibs_to_load",
"=",
"None",
",",
")",
":",
"... | Perform a snmpwalk on the domain specified by the oids, on the device
configured in instance.
lookup_names is a boolean to specify whether or not to use the mibs to
resolve the name and values.
Returns a dictionary:
dict[oid/metric_name][row index] = value
In case of sca... | [
"Perform",
"a",
"snmpwalk",
"on",
"the",
"domain",
"specified",
"by",
"the",
"oids",
"on",
"the",
"device",
"configured",
"in",
"instance",
".",
"lookup_names",
"is",
"a",
"boolean",
"to",
"specify",
"whether",
"or",
"not",
"to",
"use",
"the",
"mibs",
"to"... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/snmp/datadog_checks/snmp/snmp.py#L188-L320 | train | Perform a snmpwalk on the domain specified by oids and return the values of the values in the mibs_to_load attribute. | 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 | snmp/datadog_checks/snmp/snmp.py | SnmpCheck.report_raw_metrics | def report_raw_metrics(self, metrics, results, tags):
'''
For all the metrics that are specified as oid,
the conf oid is going to exactly match or be a prefix of the oid sent back by the device
Use the instance configuration to find the name to give to the metric
Submit the resu... | python | def report_raw_metrics(self, metrics, results, tags):
'''
For all the metrics that are specified as oid,
the conf oid is going to exactly match or be a prefix of the oid sent back by the device
Use the instance configuration to find the name to give to the metric
Submit the resu... | [
"def",
"report_raw_metrics",
"(",
"self",
",",
"metrics",
",",
"results",
",",
"tags",
")",
":",
"for",
"metric",
"in",
"metrics",
":",
"forced_type",
"=",
"metric",
".",
"get",
"(",
"'forced_type'",
")",
"if",
"'OID'",
"in",
"metric",
":",
"queried_oid",
... | For all the metrics that are specified as oid,
the conf oid is going to exactly match or be a prefix of the oid sent back by the device
Use the instance configuration to find the name to give to the metric
Submit the results to the aggregator. | [
"For",
"all",
"the",
"metrics",
"that",
"are",
"specified",
"as",
"oid",
"the",
"conf",
"oid",
"is",
"going",
"to",
"exactly",
"match",
"or",
"be",
"a",
"prefix",
"of",
"the",
"oid",
"sent",
"back",
"by",
"the",
"device",
"Use",
"the",
"instance",
"con... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/snmp/datadog_checks/snmp/snmp.py#L444-L471 | train | This method is used to report the raw metrics to the aggregator. | 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 | snmp/datadog_checks/snmp/snmp.py | SnmpCheck.report_table_metrics | def report_table_metrics(self, metrics, results, tags):
'''
For each of the metrics specified as needing to be resolved with mib,
gather the tags requested in the instance conf for each row.
Submit the results to the aggregator.
'''
for metric in metrics:
fo... | python | def report_table_metrics(self, metrics, results, tags):
'''
For each of the metrics specified as needing to be resolved with mib,
gather the tags requested in the instance conf for each row.
Submit the results to the aggregator.
'''
for metric in metrics:
fo... | [
"def",
"report_table_metrics",
"(",
"self",
",",
"metrics",
",",
"results",
",",
"tags",
")",
":",
"for",
"metric",
"in",
"metrics",
":",
"forced_type",
"=",
"metric",
".",
"get",
"(",
"'forced_type'",
")",
"if",
"'table'",
"in",
"metric",
":",
"index_base... | For each of the metrics specified as needing to be resolved with mib,
gather the tags requested in the instance conf for each row.
Submit the results to the aggregator. | [
"For",
"each",
"of",
"the",
"metrics",
"specified",
"as",
"needing",
"to",
"be",
"resolved",
"with",
"mib",
"gather",
"the",
"tags",
"requested",
"in",
"the",
"instance",
"conf",
"for",
"each",
"row",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/snmp/datadog_checks/snmp/snmp.py#L473-L514 | train | Given a list of metrics and a list of tags gather the tags requested in the instance conf for each row and submit the results to the aggregator. | 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 | snmp/datadog_checks/snmp/snmp.py | SnmpCheck.get_index_tags | def get_index_tags(self, index, results, index_tags, column_tags):
'''
Gather the tags for this row of the table (index) based on the
results (all the results from the query).
index_tags and column_tags are the tags to gather.
- Those specified in index_tags contain the tag_grou... | python | def get_index_tags(self, index, results, index_tags, column_tags):
'''
Gather the tags for this row of the table (index) based on the
results (all the results from the query).
index_tags and column_tags are the tags to gather.
- Those specified in index_tags contain the tag_grou... | [
"def",
"get_index_tags",
"(",
"self",
",",
"index",
",",
"results",
",",
"index_tags",
",",
"column_tags",
")",
":",
"tags",
"=",
"[",
"]",
"for",
"idx_tag",
"in",
"index_tags",
":",
"tag_group",
"=",
"idx_tag",
"[",
"0",
"]",
"try",
":",
"tag_value",
... | Gather the tags for this row of the table (index) based on the
results (all the results from the query).
index_tags and column_tags are the tags to gather.
- Those specified in index_tags contain the tag_group name and the
index of the value we want to extract from the index tuple.
... | [
"Gather",
"the",
"tags",
"for",
"this",
"row",
"of",
"the",
"table",
"(",
"index",
")",
"based",
"on",
"the",
"results",
"(",
"all",
"the",
"results",
"from",
"the",
"query",
")",
".",
"index_tags",
"and",
"column_tags",
"are",
"the",
"tags",
"to",
"ga... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/snmp/datadog_checks/snmp/snmp.py#L516-L549 | train | Gather the tags for this row based on the index and the column of the results. | 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 | snmp/datadog_checks/snmp/snmp.py | SnmpCheck.submit_metric | def submit_metric(self, name, snmp_value, forced_type, tags=None):
'''
Convert the values reported as pysnmp-Managed Objects to values and
report them to the aggregator
'''
tags = [] if tags is None else tags
if reply_invalid(snmp_value):
# Metrics not present... | python | def submit_metric(self, name, snmp_value, forced_type, tags=None):
'''
Convert the values reported as pysnmp-Managed Objects to values and
report them to the aggregator
'''
tags = [] if tags is None else tags
if reply_invalid(snmp_value):
# Metrics not present... | [
"def",
"submit_metric",
"(",
"self",
",",
"name",
",",
"snmp_value",
",",
"forced_type",
",",
"tags",
"=",
"None",
")",
":",
"tags",
"=",
"[",
"]",
"if",
"tags",
"is",
"None",
"else",
"tags",
"if",
"reply_invalid",
"(",
"snmp_value",
")",
":",
"# Metri... | Convert the values reported as pysnmp-Managed Objects to values and
report them to the aggregator | [
"Convert",
"the",
"values",
"reported",
"as",
"pysnmp",
"-",
"Managed",
"Objects",
"to",
"values",
"and",
"report",
"them",
"to",
"the",
"aggregator"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/snmp/datadog_checks/snmp/snmp.py#L551-L591 | train | Submit a metric to the aggregator. | 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/agent/debug.py | Debugger.set_trace | def set_trace(self, frame=None):
"""See https://github.com/python/cpython/blob/b02774f42108aaf18eb19865472c8d5cd95b5f11/Lib/bdb.py#L319-L332"""
self.reset()
if frame is None:
frame = sys._getframe().f_back
while frame:
frame.f_trace = self.trace_dispatch
... | python | def set_trace(self, frame=None):
"""See https://github.com/python/cpython/blob/b02774f42108aaf18eb19865472c8d5cd95b5f11/Lib/bdb.py#L319-L332"""
self.reset()
if frame is None:
frame = sys._getframe().f_back
while frame:
frame.f_trace = self.trace_dispatch
... | [
"def",
"set_trace",
"(",
"self",
",",
"frame",
"=",
"None",
")",
":",
"self",
".",
"reset",
"(",
")",
"if",
"frame",
"is",
"None",
":",
"frame",
"=",
"sys",
".",
"_getframe",
"(",
")",
".",
"f_back",
"while",
"frame",
":",
"frame",
".",
"f_trace",
... | See https://github.com/python/cpython/blob/b02774f42108aaf18eb19865472c8d5cd95b5f11/Lib/bdb.py#L319-L332 | [
"See",
"https",
":",
"//",
"github",
".",
"com",
"/",
"python",
"/",
"cpython",
"/",
"blob",
"/",
"b02774f42108aaf18eb19865472c8d5cd95b5f11",
"/",
"Lib",
"/",
"bdb",
".",
"py#L319",
"-",
"L332"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/utils/agent/debug.py#L12-L27 | train | Set the trace of the current thread. | 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/server_description.py | ServerDescription.round_trip_time | def round_trip_time(self):
"""The current average latency or None."""
# This override is for unittesting only!
if self._address in self._host_to_round_trip_time:
return self._host_to_round_trip_time[self._address]
return self._round_trip_time | python | def round_trip_time(self):
"""The current average latency or None."""
# This override is for unittesting only!
if self._address in self._host_to_round_trip_time:
return self._host_to_round_trip_time[self._address]
return self._round_trip_time | [
"def",
"round_trip_time",
"(",
"self",
")",
":",
"# This override is for unittesting only!",
"if",
"self",
".",
"_address",
"in",
"self",
".",
"_host_to_round_trip_time",
":",
"return",
"self",
".",
"_host_to_round_trip_time",
"[",
"self",
".",
"_address",
"]",
"ret... | The current average latency or None. | [
"The",
"current",
"average",
"latency",
"or",
"None",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/server_description.py#L168-L174 | train | The current round trip time or None. | 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 | openstack_controller/datadog_checks/openstack_controller/openstack_controller.py | OpenStackControllerCheck.collect_networks_metrics | def collect_networks_metrics(self, tags, network_ids, exclude_network_id_rules):
"""
Collect stats for all reachable networks
"""
networks = self.get_networks()
filtered_networks = []
if not network_ids:
# Filter out excluded networks
filtered_netw... | python | def collect_networks_metrics(self, tags, network_ids, exclude_network_id_rules):
"""
Collect stats for all reachable networks
"""
networks = self.get_networks()
filtered_networks = []
if not network_ids:
# Filter out excluded networks
filtered_netw... | [
"def",
"collect_networks_metrics",
"(",
"self",
",",
"tags",
",",
"network_ids",
",",
"exclude_network_id_rules",
")",
":",
"networks",
"=",
"self",
".",
"get_networks",
"(",
")",
"filtered_networks",
"=",
"[",
"]",
"if",
"not",
"network_ids",
":",
"# Filter out... | Collect stats for all reachable networks | [
"Collect",
"stats",
"for",
"all",
"reachable",
"networks"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack_controller/datadog_checks/openstack_controller/openstack_controller.py#L145-L178 | train | Collect stats for all reachable networks | 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 | openstack_controller/datadog_checks/openstack_controller/openstack_controller.py | OpenStackControllerCheck._parse_uptime_string | def _parse_uptime_string(self, uptime):
""" Parse u' 16:53:48 up 1 day, 21:34, 3 users, load average: 0.04, 0.14, 0.19\n' """
uptime = uptime.strip()
load_averages = uptime[uptime.find('load average:') :].split(':')[1].strip().split(',')
load_averages = [float(load_avg) for load_avg in... | python | def _parse_uptime_string(self, uptime):
""" Parse u' 16:53:48 up 1 day, 21:34, 3 users, load average: 0.04, 0.14, 0.19\n' """
uptime = uptime.strip()
load_averages = uptime[uptime.find('load average:') :].split(':')[1].strip().split(',')
load_averages = [float(load_avg) for load_avg in... | [
"def",
"_parse_uptime_string",
"(",
"self",
",",
"uptime",
")",
":",
"uptime",
"=",
"uptime",
".",
"strip",
"(",
")",
"load_averages",
"=",
"uptime",
"[",
"uptime",
".",
"find",
"(",
"'load average:'",
")",
":",
"]",
".",
"split",
"(",
"':'",
")",
"[",... | Parse u' 16:53:48 up 1 day, 21:34, 3 users, load average: 0.04, 0.14, 0.19\n' | [
"Parse",
"u",
"16",
":",
"53",
":",
"48",
"up",
"1",
"day",
"21",
":",
"34",
"3",
"users",
"load",
"average",
":",
"0",
".",
"04",
"0",
".",
"14",
"0",
".",
"19",
"\\",
"n"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack_controller/datadog_checks/openstack_controller/openstack_controller.py#L181-L186 | train | Parse the uptime string into a list of load averages. | 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 | openstack_controller/datadog_checks/openstack_controller/openstack_controller.py | OpenStackControllerCheck.collect_hypervisors_metrics | def collect_hypervisors_metrics(
self,
servers,
custom_tags=None,
use_shortname=False,
collect_hypervisor_metrics=True,
collect_hypervisor_load=False,
):
"""
Submits stats for all hypervisors registered to this control plane
Raises specific exc... | python | def collect_hypervisors_metrics(
self,
servers,
custom_tags=None,
use_shortname=False,
collect_hypervisor_metrics=True,
collect_hypervisor_load=False,
):
"""
Submits stats for all hypervisors registered to this control plane
Raises specific exc... | [
"def",
"collect_hypervisors_metrics",
"(",
"self",
",",
"servers",
",",
"custom_tags",
"=",
"None",
",",
"use_shortname",
"=",
"False",
",",
"collect_hypervisor_metrics",
"=",
"True",
",",
"collect_hypervisor_load",
"=",
"False",
",",
")",
":",
"# Create a dictionar... | Submits stats for all hypervisors registered to this control plane
Raises specific exceptions based on response code | [
"Submits",
"stats",
"for",
"all",
"hypervisors",
"registered",
"to",
"this",
"control",
"plane",
"Raises",
"specific",
"exceptions",
"based",
"on",
"response",
"code"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack_controller/datadog_checks/openstack_controller/openstack_controller.py#L209-L244 | train | Collect metrics for all hypervisors in the control plane. | 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 | openstack_controller/datadog_checks/openstack_controller/openstack_controller.py | OpenStackControllerCheck.init_api | def init_api(self, instance_config, custom_tags):
"""
Guarantees a valid auth scope for this instance, and returns it
Communicates with the identity server and initializes a new scope when one is absent, or has been forcibly
removed due to token expiry
"""
custom_tags = ... | python | def init_api(self, instance_config, custom_tags):
"""
Guarantees a valid auth scope for this instance, and returns it
Communicates with the identity server and initializes a new scope when one is absent, or has been forcibly
removed due to token expiry
"""
custom_tags = ... | [
"def",
"init_api",
"(",
"self",
",",
"instance_config",
",",
"custom_tags",
")",
":",
"custom_tags",
"=",
"custom_tags",
"or",
"[",
"]",
"keystone_server_url",
"=",
"instance_config",
".",
"get",
"(",
"\"keystone_server_url\"",
")",
"proxy_config",
"=",
"self",
... | Guarantees a valid auth scope for this instance, and returns it
Communicates with the identity server and initializes a new scope when one is absent, or has been forcibly
removed due to token expiry | [
"Guarantees",
"a",
"valid",
"auth",
"scope",
"for",
"this",
"instance",
"and",
"returns",
"it"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack_controller/datadog_checks/openstack_controller/openstack_controller.py#L601-L669 | train | Initializes the API for the current instance | 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 | kubelet/datadog_checks/kubelet/cadvisor.py | CadvisorScraper.detect_cadvisor | def detect_cadvisor(kubelet_url, cadvisor_port):
"""
Tries to connect to the cadvisor endpoint, with given params
:return: url if OK, raises exception if NOK
"""
if cadvisor_port == 0:
raise ValueError("cAdvisor port set to 0 in configuration")
kubelet_hostnam... | python | def detect_cadvisor(kubelet_url, cadvisor_port):
"""
Tries to connect to the cadvisor endpoint, with given params
:return: url if OK, raises exception if NOK
"""
if cadvisor_port == 0:
raise ValueError("cAdvisor port set to 0 in configuration")
kubelet_hostnam... | [
"def",
"detect_cadvisor",
"(",
"kubelet_url",
",",
"cadvisor_port",
")",
":",
"if",
"cadvisor_port",
"==",
"0",
":",
"raise",
"ValueError",
"(",
"\"cAdvisor port set to 0 in configuration\"",
")",
"kubelet_hostname",
"=",
"urlparse",
"(",
"kubelet_url",
")",
".",
"h... | Tries to connect to the cadvisor endpoint, with given params
:return: url if OK, raises exception if NOK | [
"Tries",
"to",
"connect",
"to",
"the",
"cadvisor",
"endpoint",
"with",
"given",
"params",
":",
"return",
":",
"url",
"if",
"OK",
"raises",
"exception",
"if",
"NOK"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/cadvisor.py#L48-L64 | train | Attempts to connect to the cadvisor endpoint with given params
| 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 | kubelet/datadog_checks/kubelet/cadvisor.py | CadvisorScraper.process_cadvisor | def process_cadvisor(self, instance, cadvisor_url, pod_list, pod_list_utils):
"""
Scrape and submit metrics from cadvisor
:param: instance: check instance object
:param: cadvisor_url: valid cadvisor url, as returned by detect_cadvisor()
:param: pod_list: fresh podlist object from... | python | def process_cadvisor(self, instance, cadvisor_url, pod_list, pod_list_utils):
"""
Scrape and submit metrics from cadvisor
:param: instance: check instance object
:param: cadvisor_url: valid cadvisor url, as returned by detect_cadvisor()
:param: pod_list: fresh podlist object from... | [
"def",
"process_cadvisor",
"(",
"self",
",",
"instance",
",",
"cadvisor_url",
",",
"pod_list",
",",
"pod_list_utils",
")",
":",
"self",
".",
"max_depth",
"=",
"instance",
".",
"get",
"(",
"'max_depth'",
",",
"DEFAULT_MAX_DEPTH",
")",
"enabled_gauges",
"=",
"in... | Scrape and submit metrics from cadvisor
:param: instance: check instance object
:param: cadvisor_url: valid cadvisor url, as returned by detect_cadvisor()
:param: pod_list: fresh podlist object from the kubelet
:param: pod_list_utils: already initialised PodListUtils object | [
"Scrape",
"and",
"submit",
"metrics",
"from",
"cadvisor",
":",
"param",
":",
"instance",
":",
"check",
"instance",
"object",
":",
"param",
":",
"cadvisor_url",
":",
"valid",
"cadvisor",
"url",
"as",
"returned",
"by",
"detect_cadvisor",
"()",
":",
"param",
":... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/cadvisor.py#L66-L82 | train | Scrape and submit metrics from a cadvisor instance. | 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 | kubelet/datadog_checks/kubelet/cadvisor.py | CadvisorScraper._publish_raw_metrics | def _publish_raw_metrics(self, metric, dat, tags, is_pod, depth=0):
"""
Recusively parses and submit metrics for a given entity, until
reaching self.max_depth.
Nested metric names are flattened: memory/usage -> memory.usage
:param: metric: parent's metric name (check namespace fo... | python | def _publish_raw_metrics(self, metric, dat, tags, is_pod, depth=0):
"""
Recusively parses and submit metrics for a given entity, until
reaching self.max_depth.
Nested metric names are flattened: memory/usage -> memory.usage
:param: metric: parent's metric name (check namespace fo... | [
"def",
"_publish_raw_metrics",
"(",
"self",
",",
"metric",
",",
"dat",
",",
"tags",
",",
"is_pod",
",",
"depth",
"=",
"0",
")",
":",
"if",
"depth",
">=",
"self",
".",
"max_depth",
":",
"self",
".",
"log",
".",
"warning",
"(",
"'Reached max depth on metri... | Recusively parses and submit metrics for a given entity, until
reaching self.max_depth.
Nested metric names are flattened: memory/usage -> memory.usage
:param: metric: parent's metric name (check namespace for root stat objects)
:param: dat: metric dictionnary to parse
:param: ta... | [
"Recusively",
"parses",
"and",
"submit",
"metrics",
"for",
"a",
"given",
"entity",
"until",
"reaching",
"self",
".",
"max_depth",
".",
"Nested",
"metric",
"names",
"are",
"flattened",
":",
"memory",
"/",
"usage",
"-",
">",
"memory",
".",
"usage",
":",
"par... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/cadvisor.py#L105-L139 | train | Recusively parses and submit metrics for a given entity. | 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/metrics.py | stats_for_version | def stats_for_version(version):
"""
Get the proper set of stats metrics for the specified ES version
"""
metrics = dict(STATS_METRICS)
# JVM additional metrics
if version >= [0, 90, 10]:
metrics.update(JVM_METRICS_POST_0_90_10)
else:
metrics.update(JVM_METRICS_PRE_0_90_10)
... | python | def stats_for_version(version):
"""
Get the proper set of stats metrics for the specified ES version
"""
metrics = dict(STATS_METRICS)
# JVM additional metrics
if version >= [0, 90, 10]:
metrics.update(JVM_METRICS_POST_0_90_10)
else:
metrics.update(JVM_METRICS_PRE_0_90_10)
... | [
"def",
"stats_for_version",
"(",
"version",
")",
":",
"metrics",
"=",
"dict",
"(",
"STATS_METRICS",
")",
"# JVM additional metrics",
"if",
"version",
">=",
"[",
"0",
",",
"90",
",",
"10",
"]",
":",
"metrics",
".",
"update",
"(",
"JVM_METRICS_POST_0_90_10",
"... | Get the proper set of stats metrics for the specified ES version | [
"Get",
"the",
"proper",
"set",
"of",
"stats",
"metrics",
"for",
"the",
"specified",
"ES",
"version"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/elastic/datadog_checks/elastic/metrics.py#L452-L509 | train | Returns the proper set of stats metrics for the specified 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/metrics.py | pshard_stats_for_version | def pshard_stats_for_version(version):
"""
Get the proper set of pshard metrics for the specified ES version
"""
pshard_stats_metrics = dict(PRIMARY_SHARD_METRICS)
if version >= [1, 0, 0]:
pshard_stats_metrics.update(PRIMARY_SHARD_METRICS_POST_1_0)
return pshard_stats_metrics | python | def pshard_stats_for_version(version):
"""
Get the proper set of pshard metrics for the specified ES version
"""
pshard_stats_metrics = dict(PRIMARY_SHARD_METRICS)
if version >= [1, 0, 0]:
pshard_stats_metrics.update(PRIMARY_SHARD_METRICS_POST_1_0)
return pshard_stats_metrics | [
"def",
"pshard_stats_for_version",
"(",
"version",
")",
":",
"pshard_stats_metrics",
"=",
"dict",
"(",
"PRIMARY_SHARD_METRICS",
")",
"if",
"version",
">=",
"[",
"1",
",",
"0",
",",
"0",
"]",
":",
"pshard_stats_metrics",
".",
"update",
"(",
"PRIMARY_SHARD_METRICS... | Get the proper set of pshard metrics for the specified ES version | [
"Get",
"the",
"proper",
"set",
"of",
"pshard",
"metrics",
"for",
"the",
"specified",
"ES",
"version"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/elastic/datadog_checks/elastic/metrics.py#L512-L520 | train | Get the proper set of pshard metrics for the specified 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/metrics.py | health_stats_for_version | def health_stats_for_version(version):
"""
Get the proper set of health metrics for the specified ES version
"""
cluster_health_metrics = dict(CLUSTER_HEALTH_METRICS)
if version >= [2, 4, 0]:
cluster_health_metrics.update(CLUSTER_HEALTH_METRICS_POST_2_4)
return cluster_health_metrics | python | def health_stats_for_version(version):
"""
Get the proper set of health metrics for the specified ES version
"""
cluster_health_metrics = dict(CLUSTER_HEALTH_METRICS)
if version >= [2, 4, 0]:
cluster_health_metrics.update(CLUSTER_HEALTH_METRICS_POST_2_4)
return cluster_health_metrics | [
"def",
"health_stats_for_version",
"(",
"version",
")",
":",
"cluster_health_metrics",
"=",
"dict",
"(",
"CLUSTER_HEALTH_METRICS",
")",
"if",
"version",
">=",
"[",
"2",
",",
"4",
",",
"0",
"]",
":",
"cluster_health_metrics",
".",
"update",
"(",
"CLUSTER_HEALTH_M... | Get the proper set of health metrics for the specified ES version | [
"Get",
"the",
"proper",
"set",
"of",
"health",
"metrics",
"for",
"the",
"specified",
"ES",
"version"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/elastic/datadog_checks/elastic/metrics.py#L523-L531 | train | Get the proper set of health metrics for the specified 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 | datadog_checks_dev/datadog_checks/dev/tooling/commands/release.py | ready | def ready(ctx, quiet):
"""Show all the checks that can be released."""
user_config = ctx.obj
cached_prs = {}
for target in sorted(get_valid_checks()):
# get the name of the current release tag
cur_version = get_version_string(target)
target_tag = get_release_tag_string(target, c... | python | def ready(ctx, quiet):
"""Show all the checks that can be released."""
user_config = ctx.obj
cached_prs = {}
for target in sorted(get_valid_checks()):
# get the name of the current release tag
cur_version = get_version_string(target)
target_tag = get_release_tag_string(target, c... | [
"def",
"ready",
"(",
"ctx",
",",
"quiet",
")",
":",
"user_config",
"=",
"ctx",
".",
"obj",
"cached_prs",
"=",
"{",
"}",
"for",
"target",
"in",
"sorted",
"(",
"get_valid_checks",
"(",
")",
")",
":",
"# get the name of the current release tag",
"cur_version",
... | Show all the checks that can be released. | [
"Show",
"all",
"the",
"checks",
"that",
"can",
"be",
"released",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/release.py#L120-L175 | train | Show all the checks that can be released. | 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/release.py | changes | def changes(ctx, check, dry_run):
"""Show all the pending PRs for a given check."""
if not dry_run and check not in get_valid_checks():
abort('Check `{}` is not an Agent-based Integration'.format(check))
# get the name of the current release tag
cur_version = get_version_string(check)
targe... | python | def changes(ctx, check, dry_run):
"""Show all the pending PRs for a given check."""
if not dry_run and check not in get_valid_checks():
abort('Check `{}` is not an Agent-based Integration'.format(check))
# get the name of the current release tag
cur_version = get_version_string(check)
targe... | [
"def",
"changes",
"(",
"ctx",
",",
"check",
",",
"dry_run",
")",
":",
"if",
"not",
"dry_run",
"and",
"check",
"not",
"in",
"get_valid_checks",
"(",
")",
":",
"abort",
"(",
"'Check `{}` is not an Agent-based Integration'",
".",
"format",
"(",
"check",
")",
")... | Show all the pending PRs for a given check. | [
"Show",
"all",
"the",
"pending",
"PRs",
"for",
"a",
"given",
"check",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/release.py#L182-L240 | train | Show all the pending PRs for a 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/commands/release.py | tag | def tag(check, version, push, dry_run):
"""Tag the HEAD of the git repo with the current release number for a
specific check. The tag is pushed to origin by default.
You can tag everything at once by setting the check to `all`.
Notice: specifying a different version than the one in __about__.py is
... | python | def tag(check, version, push, dry_run):
"""Tag the HEAD of the git repo with the current release number for a
specific check. The tag is pushed to origin by default.
You can tag everything at once by setting the check to `all`.
Notice: specifying a different version than the one in __about__.py is
... | [
"def",
"tag",
"(",
"check",
",",
"version",
",",
"push",
",",
"dry_run",
")",
":",
"tagging_all",
"=",
"check",
"==",
"'all'",
"valid_checks",
"=",
"get_valid_checks",
"(",
")",
"if",
"not",
"tagging_all",
"and",
"check",
"not",
"in",
"valid_checks",
":",
... | Tag the HEAD of the git repo with the current release number for a
specific check. The tag is pushed to origin by default.
You can tag everything at once by setting the check to `all`.
Notice: specifying a different version than the one in __about__.py is
a maintenance task that should be run under ve... | [
"Tag",
"the",
"HEAD",
"of",
"the",
"git",
"repo",
"with",
"the",
"current",
"release",
"number",
"for",
"a",
"specific",
"check",
".",
"The",
"tag",
"is",
"pushed",
"to",
"origin",
"by",
"default",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/release.py#L487-L543 | train | Tag the HEAD of the git repo with the current release 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/commands/release.py | make | def make(ctx, check, version, initial_release, skip_sign, sign_only):
"""Perform a set of operations needed to release a single check:
\b
* update the version in __about__.py
* update the changelog
* update the requirements-agent-release.txt file
* update in-toto metadata
* commit... | python | def make(ctx, check, version, initial_release, skip_sign, sign_only):
"""Perform a set of operations needed to release a single check:
\b
* update the version in __about__.py
* update the changelog
* update the requirements-agent-release.txt file
* update in-toto metadata
* commit... | [
"def",
"make",
"(",
"ctx",
",",
"check",
",",
"version",
",",
"initial_release",
",",
"skip_sign",
",",
"sign_only",
")",
":",
"# Import lazily since in-toto runs a subprocess to check for gpg2 on load",
"from",
".",
".",
"signing",
"import",
"update_link_metadata",
","... | Perform a set of operations needed to release a single check:
\b
* update the version in __about__.py
* update the changelog
* update the requirements-agent-release.txt file
* update in-toto metadata
* commit the above changes
You can release everything at once by setting the che... | [
"Perform",
"a",
"set",
"of",
"operations",
"needed",
"to",
"release",
"a",
"single",
"check",
":"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/release.py#L553-L690 | train | This function generates a single check and returns the version of the 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/commands/release.py | changelog | def changelog(ctx, check, version, old_version, initial, quiet, dry_run):
"""Perform the operations needed to update the changelog.
This method is supposed to be used by other tasks and not directly.
"""
if check not in get_valid_checks():
abort('Check `{}` is not an Agent-based Integration'.fo... | python | def changelog(ctx, check, version, old_version, initial, quiet, dry_run):
"""Perform the operations needed to update the changelog.
This method is supposed to be used by other tasks and not directly.
"""
if check not in get_valid_checks():
abort('Check `{}` is not an Agent-based Integration'.fo... | [
"def",
"changelog",
"(",
"ctx",
",",
"check",
",",
"version",
",",
"old_version",
",",
"initial",
",",
"quiet",
",",
"dry_run",
")",
":",
"if",
"check",
"not",
"in",
"get_valid_checks",
"(",
")",
":",
"abort",
"(",
"'Check `{}` is not an Agent-based Integratio... | Perform the operations needed to update the changelog.
This method is supposed to be used by other tasks and not directly. | [
"Perform",
"the",
"operations",
"needed",
"to",
"update",
"the",
"changelog",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/release.py#L701-L802 | train | Update the changelog for a 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/commands/release.py | build | def build(check, sdist):
"""Build a wheel for a check as it is on the repo HEAD"""
if check in get_valid_checks():
check_dir = os.path.join(get_root(), check)
else:
check_dir = resolve_path(check)
if not dir_exists(check_dir):
abort('`{}` is not an Agent-based Integration... | python | def build(check, sdist):
"""Build a wheel for a check as it is on the repo HEAD"""
if check in get_valid_checks():
check_dir = os.path.join(get_root(), check)
else:
check_dir = resolve_path(check)
if not dir_exists(check_dir):
abort('`{}` is not an Agent-based Integration... | [
"def",
"build",
"(",
"check",
",",
"sdist",
")",
":",
"if",
"check",
"in",
"get_valid_checks",
"(",
")",
":",
"check_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"get_root",
"(",
")",
",",
"check",
")",
"else",
":",
"check_dir",
"=",
"resolve_path... | Build a wheel for a check as it is on the repo HEAD | [
"Build",
"a",
"wheel",
"for",
"a",
"check",
"as",
"it",
"is",
"on",
"the",
"repo",
"HEAD"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/release.py#L808-L829 | train | Build a wheel for a check as it is on the repo HEAD | 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/release.py | upload | def upload(ctx, check, sdist, dry_run):
"""Release a specific check to PyPI as it is on the repo HEAD."""
if check in get_valid_checks():
check_dir = os.path.join(get_root(), check)
else:
check_dir = resolve_path(check)
if not dir_exists(check_dir):
abort('`{}` is not an ... | python | def upload(ctx, check, sdist, dry_run):
"""Release a specific check to PyPI as it is on the repo HEAD."""
if check in get_valid_checks():
check_dir = os.path.join(get_root(), check)
else:
check_dir = resolve_path(check)
if not dir_exists(check_dir):
abort('`{}` is not an ... | [
"def",
"upload",
"(",
"ctx",
",",
"check",
",",
"sdist",
",",
"dry_run",
")",
":",
"if",
"check",
"in",
"get_valid_checks",
"(",
")",
":",
"check_dir",
"=",
"os",
".",
"path",
".",
"join",
"(",
"get_root",
"(",
")",
",",
"check",
")",
"else",
":",
... | Release a specific check to PyPI as it is on the repo HEAD. | [
"Release",
"a",
"specific",
"check",
"to",
"PyPI",
"as",
"it",
"is",
"on",
"the",
"repo",
"HEAD",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/release.py#L837-L868 | train | Upload a specific check to PyPI. | 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/stubs/aggregator.py | AggregatorStub.metrics | def metrics(self, name):
"""
Return the metrics received under the given name
"""
return [
MetricStub(
ensure_unicode(stub.name),
stub.type,
stub.value,
normalize_tags(stub.tags),
ensure_unicode(s... | python | def metrics(self, name):
"""
Return the metrics received under the given name
"""
return [
MetricStub(
ensure_unicode(stub.name),
stub.type,
stub.value,
normalize_tags(stub.tags),
ensure_unicode(s... | [
"def",
"metrics",
"(",
"self",
",",
"name",
")",
":",
"return",
"[",
"MetricStub",
"(",
"ensure_unicode",
"(",
"stub",
".",
"name",
")",
",",
"stub",
".",
"type",
",",
"stub",
".",
"value",
",",
"normalize_tags",
"(",
"stub",
".",
"tags",
")",
",",
... | Return the metrics received under the given name | [
"Return",
"the",
"metrics",
"received",
"under",
"the",
"given",
"name"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/stubs/aggregator.py#L56-L69 | train | Returns the list of metrics received under the given 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_base/datadog_checks/base/stubs/aggregator.py | AggregatorStub.service_checks | def service_checks(self, name):
"""
Return the service checks received under the given name
"""
return [
ServiceCheckStub(
ensure_unicode(stub.check_id),
ensure_unicode(stub.name),
stub.status,
normalize_tags(stu... | python | def service_checks(self, name):
"""
Return the service checks received under the given name
"""
return [
ServiceCheckStub(
ensure_unicode(stub.check_id),
ensure_unicode(stub.name),
stub.status,
normalize_tags(stu... | [
"def",
"service_checks",
"(",
"self",
",",
"name",
")",
":",
"return",
"[",
"ServiceCheckStub",
"(",
"ensure_unicode",
"(",
"stub",
".",
"check_id",
")",
",",
"ensure_unicode",
"(",
"stub",
".",
"name",
")",
",",
"stub",
".",
"status",
",",
"normalize_tags... | Return the service checks received under the given name | [
"Return",
"the",
"service",
"checks",
"received",
"under",
"the",
"given",
"name"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/stubs/aggregator.py#L71-L85 | train | Returns the list of service checks received under the given 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_base/datadog_checks/base/stubs/aggregator.py | AggregatorStub.events | def events(self):
"""
Return all events
"""
all_events = [{ensure_unicode(key): value for key, value in iteritems(ev)} for ev in self._events]
for ev in all_events:
to_decode = []
for key, value in iteritems(ev):
if isinstance(value, binar... | python | def events(self):
"""
Return all events
"""
all_events = [{ensure_unicode(key): value for key, value in iteritems(ev)} for ev in self._events]
for ev in all_events:
to_decode = []
for key, value in iteritems(ev):
if isinstance(value, binar... | [
"def",
"events",
"(",
"self",
")",
":",
"all_events",
"=",
"[",
"{",
"ensure_unicode",
"(",
"key",
")",
":",
"value",
"for",
"key",
",",
"value",
"in",
"iteritems",
"(",
"ev",
")",
"}",
"for",
"ev",
"in",
"self",
".",
"_events",
"]",
"for",
"ev",
... | Return all events | [
"Return",
"all",
"events"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/stubs/aggregator.py#L88-L105 | train | Return all events 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 | datadog_checks_base/datadog_checks/base/stubs/aggregator.py | AggregatorStub.assert_metric_has_tag | def assert_metric_has_tag(self, metric_name, tag, count=None, at_least=1):
"""
Assert a metric is tagged with tag
"""
self._asserted.add(metric_name)
candidates = []
for metric in self.metrics(metric_name):
if tag in metric.tags:
candidates.ap... | python | def assert_metric_has_tag(self, metric_name, tag, count=None, at_least=1):
"""
Assert a metric is tagged with tag
"""
self._asserted.add(metric_name)
candidates = []
for metric in self.metrics(metric_name):
if tag in metric.tags:
candidates.ap... | [
"def",
"assert_metric_has_tag",
"(",
"self",
",",
"metric_name",
",",
"tag",
",",
"count",
"=",
"None",
",",
"at_least",
"=",
"1",
")",
":",
"self",
".",
"_asserted",
".",
"add",
"(",
"metric_name",
")",
"candidates",
"=",
"[",
"]",
"for",
"metric",
"i... | Assert a metric is tagged with tag | [
"Assert",
"a",
"metric",
"is",
"tagged",
"with",
"tag"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/stubs/aggregator.py#L107-L121 | train | Assert a metric is tagged with tag | 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/stubs/aggregator.py | AggregatorStub.assert_metric | def assert_metric(self, name, value=None, tags=None, count=None, at_least=1, hostname=None, metric_type=None):
"""
Assert a metric was processed by this stub
"""
self._asserted.add(name)
tags = normalize_tags(tags, sort=True)
candidates = []
for metric in self.me... | python | def assert_metric(self, name, value=None, tags=None, count=None, at_least=1, hostname=None, metric_type=None):
"""
Assert a metric was processed by this stub
"""
self._asserted.add(name)
tags = normalize_tags(tags, sort=True)
candidates = []
for metric in self.me... | [
"def",
"assert_metric",
"(",
"self",
",",
"name",
",",
"value",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"count",
"=",
"None",
",",
"at_least",
"=",
"1",
",",
"hostname",
"=",
"None",
",",
"metric_type",
"=",
"None",
")",
":",
"self",
".",
"_ass... | Assert a metric was processed by this stub | [
"Assert",
"a",
"metric",
"was",
"processed",
"by",
"this",
"stub"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/stubs/aggregator.py#L146-L179 | train | Assert a metric was processed by this stub. | 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/stubs/aggregator.py | AggregatorStub.assert_service_check | def assert_service_check(self, name, status=None, tags=None, count=None, at_least=1, hostname=None, message=None):
"""
Assert a service check was processed by this stub
"""
tags = normalize_tags(tags, sort=True)
candidates = []
for sc in self.service_checks(name):
... | python | def assert_service_check(self, name, status=None, tags=None, count=None, at_least=1, hostname=None, message=None):
"""
Assert a service check was processed by this stub
"""
tags = normalize_tags(tags, sort=True)
candidates = []
for sc in self.service_checks(name):
... | [
"def",
"assert_service_check",
"(",
"self",
",",
"name",
",",
"status",
"=",
"None",
",",
"tags",
"=",
"None",
",",
"count",
"=",
"None",
",",
"at_least",
"=",
"1",
",",
"hostname",
"=",
"None",
",",
"message",
"=",
"None",
")",
":",
"tags",
"=",
"... | Assert a service check was processed by this stub | [
"Assert",
"a",
"service",
"check",
"was",
"processed",
"by",
"this",
"stub"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/stubs/aggregator.py#L181-L207 | train | Assert a service check was processed by this stub. | 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/stubs/aggregator.py | AggregatorStub.metrics_asserted_pct | def metrics_asserted_pct(self):
"""
Return the metrics assertion coverage
"""
num_metrics = len(self._metrics)
num_asserted = len(self._asserted)
if num_metrics == 0:
if num_asserted == 0:
return 100
else:
return 0
... | python | def metrics_asserted_pct(self):
"""
Return the metrics assertion coverage
"""
num_metrics = len(self._metrics)
num_asserted = len(self._asserted)
if num_metrics == 0:
if num_asserted == 0:
return 100
else:
return 0
... | [
"def",
"metrics_asserted_pct",
"(",
"self",
")",
":",
"num_metrics",
"=",
"len",
"(",
"self",
".",
"_metrics",
")",
"num_asserted",
"=",
"len",
"(",
"self",
".",
"_asserted",
")",
"if",
"num_metrics",
"==",
"0",
":",
"if",
"num_asserted",
"==",
"0",
":",... | Return the metrics assertion coverage | [
"Return",
"the",
"metrics",
"assertion",
"coverage"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/stubs/aggregator.py#L248-L261 | train | Return the metrics assertion coverage in percent. | 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 | mcache/datadog_checks/mcache/mcache.py | Memcache._process_response | def _process_response(cls, response):
"""
Examine the response and raise an error is something is off
"""
if len(response) != 1:
raise BadResponseError("Malformed response: {}".format(response))
stats = list(itervalues(response))[0]
if not len(stats):
... | python | def _process_response(cls, response):
"""
Examine the response and raise an error is something is off
"""
if len(response) != 1:
raise BadResponseError("Malformed response: {}".format(response))
stats = list(itervalues(response))[0]
if not len(stats):
... | [
"def",
"_process_response",
"(",
"cls",
",",
"response",
")",
":",
"if",
"len",
"(",
"response",
")",
"!=",
"1",
":",
"raise",
"BadResponseError",
"(",
"\"Malformed response: {}\"",
".",
"format",
"(",
"response",
")",
")",
"stats",
"=",
"list",
"(",
"iter... | Examine the response and raise an error is something is off | [
"Examine",
"the",
"response",
"and",
"raise",
"an",
"error",
"is",
"something",
"is",
"off"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mcache/datadog_checks/mcache/mcache.py#L112-L123 | train | Examine the response and raise an error if something is off
| 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 | mcache/datadog_checks/mcache/mcache.py | Memcache.get_items_stats | def get_items_stats(key, value):
"""
Optional metric handler for 'items' stats
key: "items:<slab_id>:<metric_name>" format
value: return untouched
Like all optional metric handlers returns metric, tags, value
"""
itemized_key = key.split(':')
slab_id = i... | python | def get_items_stats(key, value):
"""
Optional metric handler for 'items' stats
key: "items:<slab_id>:<metric_name>" format
value: return untouched
Like all optional metric handlers returns metric, tags, value
"""
itemized_key = key.split(':')
slab_id = i... | [
"def",
"get_items_stats",
"(",
"key",
",",
"value",
")",
":",
"itemized_key",
"=",
"key",
".",
"split",
"(",
"':'",
")",
"slab_id",
"=",
"itemized_key",
"[",
"1",
"]",
"metric",
"=",
"itemized_key",
"[",
"2",
"]",
"tags",
"=",
"[",
"\"slab:{}\"",
".",
... | Optional metric handler for 'items' stats
key: "items:<slab_id>:<metric_name>" format
value: return untouched
Like all optional metric handlers returns metric, tags, value | [
"Optional",
"metric",
"handler",
"for",
"items",
"stats"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mcache/datadog_checks/mcache/mcache.py#L206-L221 | train | Get the items stats for the given key and value | 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 | mcache/datadog_checks/mcache/mcache.py | Memcache.get_slabs_stats | def get_slabs_stats(key, value):
"""
Optional metric handler for 'items' stats
key: "items:<slab_id>:<metric_name>" format
value: return untouched
Like all optional metric handlers returns metric, tags, value
"""
slabbed_key = key.split(':')
tags = []
... | python | def get_slabs_stats(key, value):
"""
Optional metric handler for 'items' stats
key: "items:<slab_id>:<metric_name>" format
value: return untouched
Like all optional metric handlers returns metric, tags, value
"""
slabbed_key = key.split(':')
tags = []
... | [
"def",
"get_slabs_stats",
"(",
"key",
",",
"value",
")",
":",
"slabbed_key",
"=",
"key",
".",
"split",
"(",
"':'",
")",
"tags",
"=",
"[",
"]",
"if",
"len",
"(",
"slabbed_key",
")",
"==",
"2",
":",
"slab_id",
"=",
"slabbed_key",
"[",
"0",
"]",
"metr... | Optional metric handler for 'items' stats
key: "items:<slab_id>:<metric_name>" format
value: return untouched
Like all optional metric handlers returns metric, tags, value | [
"Optional",
"metric",
"handler",
"for",
"items",
"stats"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mcache/datadog_checks/mcache/mcache.py#L224-L242 | train | Get the stats for items with optional metric handlers. | 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 | rabbitmq/datadog_checks/rabbitmq/rabbitmq.py | RabbitMQ.get_stats | def get_stats(
self,
instance,
base_url,
object_type,
max_detailed,
filters,
limit_vhosts,
custom_tags,
auth=None,
ssl_verify=True,
):
"""
instance: the check instance
base_url: the url of the rabbitmq management... | python | def get_stats(
self,
instance,
base_url,
object_type,
max_detailed,
filters,
limit_vhosts,
custom_tags,
auth=None,
ssl_verify=True,
):
"""
instance: the check instance
base_url: the url of the rabbitmq management... | [
"def",
"get_stats",
"(",
"self",
",",
"instance",
",",
"base_url",
",",
"object_type",
",",
"max_detailed",
",",
"filters",
",",
"limit_vhosts",
",",
"custom_tags",
",",
"auth",
"=",
"None",
",",
"ssl_verify",
"=",
"True",
",",
")",
":",
"instance_proxy",
... | instance: the check instance
base_url: the url of the rabbitmq management api (e.g. http://localhost:15672/api)
object_type: either QUEUE_TYPE or NODE_TYPE or EXCHANGE_TYPE
max_detailed: the limit of objects to collect for this type
filters: explicit or regexes filters of specified queue... | [
"instance",
":",
"the",
"check",
"instance",
"base_url",
":",
"the",
"url",
"of",
"the",
"rabbitmq",
"management",
"api",
"(",
"e",
".",
"g",
".",
"http",
":",
"//",
"localhost",
":",
"15672",
"/",
"api",
")",
"object_type",
":",
"either",
"QUEUE_TYPE",
... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/rabbitmq/datadog_checks/rabbitmq/rabbitmq.py#L375-L549 | train | This function returns the stats for a specific check instance. | 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 | rabbitmq/datadog_checks/rabbitmq/rabbitmq.py | RabbitMQ.get_connections_stat | def get_connections_stat(
self, instance, base_url, object_type, vhosts, limit_vhosts, custom_tags, auth=None, ssl_verify=True
):
"""
Collect metrics on currently open connection per vhost.
"""
instance_proxy = self.get_instance_proxy(instance, base_url)
grab_all_dat... | python | def get_connections_stat(
self, instance, base_url, object_type, vhosts, limit_vhosts, custom_tags, auth=None, ssl_verify=True
):
"""
Collect metrics on currently open connection per vhost.
"""
instance_proxy = self.get_instance_proxy(instance, base_url)
grab_all_dat... | [
"def",
"get_connections_stat",
"(",
"self",
",",
"instance",
",",
"base_url",
",",
"object_type",
",",
"vhosts",
",",
"limit_vhosts",
",",
"custom_tags",
",",
"auth",
"=",
"None",
",",
"ssl_verify",
"=",
"True",
")",
":",
"instance_proxy",
"=",
"self",
".",
... | Collect metrics on currently open connection per vhost. | [
"Collect",
"metrics",
"on",
"currently",
"open",
"connection",
"per",
"vhost",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/rabbitmq/datadog_checks/rabbitmq/rabbitmq.py#L591-L636 | train | Get statistics on currently open connections. | 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 | rabbitmq/datadog_checks/rabbitmq/rabbitmq.py | RabbitMQ._check_aliveness | def _check_aliveness(self, instance, base_url, vhosts, custom_tags, auth=None, ssl_verify=True):
"""
Check the aliveness API against all or a subset of vhosts. The API
will return {"status": "ok"} and a 200 response code in the case
that the check passes.
"""
for vhost i... | python | def _check_aliveness(self, instance, base_url, vhosts, custom_tags, auth=None, ssl_verify=True):
"""
Check the aliveness API against all or a subset of vhosts. The API
will return {"status": "ok"} and a 200 response code in the case
that the check passes.
"""
for vhost i... | [
"def",
"_check_aliveness",
"(",
"self",
",",
"instance",
",",
"base_url",
",",
"vhosts",
",",
"custom_tags",
",",
"auth",
"=",
"None",
",",
"ssl_verify",
"=",
"True",
")",
":",
"for",
"vhost",
"in",
"vhosts",
":",
"tags",
"=",
"[",
"'vhost:{}'",
".",
"... | Check the aliveness API against all or a subset of vhosts. The API
will return {"status": "ok"} and a 200 response code in the case
that the check passes. | [
"Check",
"the",
"aliveness",
"API",
"against",
"all",
"or",
"a",
"subset",
"of",
"vhosts",
".",
"The",
"API",
"will",
"return",
"{",
"status",
":",
"ok",
"}",
"and",
"a",
"200",
"response",
"code",
"in",
"the",
"case",
"that",
"the",
"check",
"passes",... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/rabbitmq/datadog_checks/rabbitmq/rabbitmq.py#L676-L699 | train | Check the aliveness API against all or a subset of vhosts. | 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/gridfs/grid_file.py | _grid_in_property | def _grid_in_property(field_name, docstring, read_only=False,
closed_only=False):
"""Create a GridIn property."""
def getter(self):
if closed_only and not self._closed:
raise AttributeError("can only get %r on a closed file" %
field_name... | python | def _grid_in_property(field_name, docstring, read_only=False,
closed_only=False):
"""Create a GridIn property."""
def getter(self):
if closed_only and not self._closed:
raise AttributeError("can only get %r on a closed file" %
field_name... | [
"def",
"_grid_in_property",
"(",
"field_name",
",",
"docstring",
",",
"read_only",
"=",
"False",
",",
"closed_only",
"=",
"False",
")",
":",
"def",
"getter",
"(",
"self",
")",
":",
"if",
"closed_only",
"and",
"not",
"self",
".",
"_closed",
":",
"raise",
... | Create a GridIn property. | [
"Create",
"a",
"GridIn",
"property",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/grid_file.py#L56-L83 | train | Create a GridIn property. | 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/gridfs/grid_file.py | _grid_out_property | def _grid_out_property(field_name, docstring):
"""Create a GridOut property."""
def getter(self):
self._ensure_file()
# Protect against PHP-237
if field_name == 'length':
return self._file.get(field_name, 0)
return self._file.get(field_name, None)
docstring += "... | python | def _grid_out_property(field_name, docstring):
"""Create a GridOut property."""
def getter(self):
self._ensure_file()
# Protect against PHP-237
if field_name == 'length':
return self._file.get(field_name, 0)
return self._file.get(field_name, None)
docstring += "... | [
"def",
"_grid_out_property",
"(",
"field_name",
",",
"docstring",
")",
":",
"def",
"getter",
"(",
"self",
")",
":",
"self",
".",
"_ensure_file",
"(",
")",
"# Protect against PHP-237",
"if",
"field_name",
"==",
"'length'",
":",
"return",
"self",
".",
"_file",
... | Create a GridOut property. | [
"Create",
"a",
"GridOut",
"property",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/grid_file.py#L86-L97 | train | Create a GridOut property. | 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/gridfs/grid_file.py | GridIn.__flush_data | def __flush_data(self, data):
"""Flush `data` to a chunk.
"""
# Ensure the index, even if there's nothing to write, so
# the filemd5 command always succeeds.
self.__ensure_indexes()
self._file['md5'].update(data)
if not data:
return
assert(len... | python | def __flush_data(self, data):
"""Flush `data` to a chunk.
"""
# Ensure the index, even if there's nothing to write, so
# the filemd5 command always succeeds.
self.__ensure_indexes()
self._file['md5'].update(data)
if not data:
return
assert(len... | [
"def",
"__flush_data",
"(",
"self",
",",
"data",
")",
":",
"# Ensure the index, even if there's nothing to write, so",
"# the filemd5 command always succeeds.",
"self",
".",
"__ensure_indexes",
"(",
")",
"self",
".",
"_file",
"[",
"'md5'",
"]",
".",
"update",
"(",
"da... | Flush `data` to a chunk. | [
"Flush",
"data",
"to",
"a",
"chunk",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/grid_file.py#L241-L262 | train | Flushes the data to a chunk. | 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/gridfs/grid_file.py | GridIn.__flush_buffer | def __flush_buffer(self):
"""Flush the buffer contents out to a chunk.
"""
self.__flush_data(self._buffer.getvalue())
self._buffer.close()
self._buffer = StringIO() | python | def __flush_buffer(self):
"""Flush the buffer contents out to a chunk.
"""
self.__flush_data(self._buffer.getvalue())
self._buffer.close()
self._buffer = StringIO() | [
"def",
"__flush_buffer",
"(",
"self",
")",
":",
"self",
".",
"__flush_data",
"(",
"self",
".",
"_buffer",
".",
"getvalue",
"(",
")",
")",
"self",
".",
"_buffer",
".",
"close",
"(",
")",
"self",
".",
"_buffer",
"=",
"StringIO",
"(",
")"
] | Flush the buffer contents out to a chunk. | [
"Flush",
"the",
"buffer",
"contents",
"out",
"to",
"a",
"chunk",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/grid_file.py#L264-L269 | train | Flush the buffer contents out to a chunk. | 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/gridfs/grid_file.py | GridIn.__flush | def __flush(self):
"""Flush the file to the database.
"""
try:
self.__flush_buffer()
self._file['md5'] = self._file["md5"].hexdigest()
self._file["length"] = self._position
self._file["uploadDate"] = datetime.datetime.utcnow()
return ... | python | def __flush(self):
"""Flush the file to the database.
"""
try:
self.__flush_buffer()
self._file['md5'] = self._file["md5"].hexdigest()
self._file["length"] = self._position
self._file["uploadDate"] = datetime.datetime.utcnow()
return ... | [
"def",
"__flush",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"__flush_buffer",
"(",
")",
"self",
".",
"_file",
"[",
"'md5'",
"]",
"=",
"self",
".",
"_file",
"[",
"\"md5\"",
"]",
".",
"hexdigest",
"(",
")",
"self",
".",
"_file",
"[",
"\"length\... | Flush the file to the database. | [
"Flush",
"the",
"file",
"to",
"the",
"database",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/grid_file.py#L271-L283 | train | Flush the file to the database. | 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/gridfs/grid_file.py | GridIn.close | def close(self):
"""Flush the file and close it.
A closed file cannot be written any more. Calling
:meth:`close` more than once is allowed.
"""
if not self._closed:
self.__flush()
object.__setattr__(self, "_closed", True) | python | def close(self):
"""Flush the file and close it.
A closed file cannot be written any more. Calling
:meth:`close` more than once is allowed.
"""
if not self._closed:
self.__flush()
object.__setattr__(self, "_closed", True) | [
"def",
"close",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_closed",
":",
"self",
".",
"__flush",
"(",
")",
"object",
".",
"__setattr__",
"(",
"self",
",",
"\"_closed\"",
",",
"True",
")"
] | Flush the file and close it.
A closed file cannot be written any more. Calling
:meth:`close` more than once is allowed. | [
"Flush",
"the",
"file",
"and",
"close",
"it",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/grid_file.py#L289-L297 | train | Flush the file and close 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 | tokumx/datadog_checks/tokumx/vendor/gridfs/grid_file.py | GridIn.write | def write(self, data):
"""Write data to the file. There is no return value.
`data` can be either a string of bytes or a file-like object
(implementing :meth:`read`). If the file has an
:attr:`encoding` attribute, `data` can also be a
:class:`unicode` (:class:`str` in python 3) i... | python | def write(self, data):
"""Write data to the file. There is no return value.
`data` can be either a string of bytes or a file-like object
(implementing :meth:`read`). If the file has an
:attr:`encoding` attribute, `data` can also be a
:class:`unicode` (:class:`str` in python 3) i... | [
"def",
"write",
"(",
"self",
",",
"data",
")",
":",
"if",
"self",
".",
"_closed",
":",
"raise",
"ValueError",
"(",
"\"cannot write to a closed file\"",
")",
"try",
":",
"# file-like",
"read",
"=",
"data",
".",
"read",
"except",
"AttributeError",
":",
"# stri... | Write data to the file. There is no return value.
`data` can be either a string of bytes or a file-like object
(implementing :meth:`read`). If the file has an
:attr:`encoding` attribute, `data` can also be a
:class:`unicode` (:class:`str` in python 3) instance, which
will be enc... | [
"Write",
"data",
"to",
"the",
"file",
".",
"There",
"is",
"no",
"return",
"value",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/grid_file.py#L299-L356 | train | Writes data to the file. | 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/gridfs/grid_file.py | GridOut.readchunk | def readchunk(self):
"""Reads a chunk at a time. If the current position is within a
chunk the remainder of the chunk is returned.
"""
received = len(self.__buffer)
chunk_data = EMPTY
chunk_size = int(self.chunk_size)
if received > 0:
chunk_data = sel... | python | def readchunk(self):
"""Reads a chunk at a time. If the current position is within a
chunk the remainder of the chunk is returned.
"""
received = len(self.__buffer)
chunk_data = EMPTY
chunk_size = int(self.chunk_size)
if received > 0:
chunk_data = sel... | [
"def",
"readchunk",
"(",
"self",
")",
":",
"received",
"=",
"len",
"(",
"self",
".",
"__buffer",
")",
"chunk_data",
"=",
"EMPTY",
"chunk_size",
"=",
"int",
"(",
"self",
".",
"chunk_size",
")",
"if",
"received",
">",
"0",
":",
"chunk_data",
"=",
"self",... | Reads a chunk at a time. If the current position is within a
chunk the remainder of the chunk is returned. | [
"Reads",
"a",
"chunk",
"at",
"a",
"time",
".",
"If",
"the",
"current",
"position",
"is",
"within",
"a",
"chunk",
"the",
"remainder",
"of",
"the",
"chunk",
"is",
"returned",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/grid_file.py#L444-L468 | train | Reads a single chunk at a time. | 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/gridfs/grid_file.py | GridOut.read | def read(self, size=-1):
"""Read at most `size` bytes from the file (less if there
isn't enough data).
The bytes are returned as an instance of :class:`str` (:class:`bytes`
in python 3). If `size` is negative or omitted all data is read.
:Parameters:
- `size` (optiona... | python | def read(self, size=-1):
"""Read at most `size` bytes from the file (less if there
isn't enough data).
The bytes are returned as an instance of :class:`str` (:class:`bytes`
in python 3). If `size` is negative or omitted all data is read.
:Parameters:
- `size` (optiona... | [
"def",
"read",
"(",
"self",
",",
"size",
"=",
"-",
"1",
")",
":",
"self",
".",
"_ensure_file",
"(",
")",
"if",
"size",
"==",
"0",
":",
"return",
"EMPTY",
"remainder",
"=",
"int",
"(",
"self",
".",
"length",
")",
"-",
"self",
".",
"__position",
"i... | Read at most `size` bytes from the file (less if there
isn't enough data).
The bytes are returned as an instance of :class:`str` (:class:`bytes`
in python 3). If `size` is negative or omitted all data is read.
:Parameters:
- `size` (optional): the number of bytes to read | [
"Read",
"at",
"most",
"size",
"bytes",
"from",
"the",
"file",
"(",
"less",
"if",
"there",
"isn",
"t",
"enough",
"data",
")",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/grid_file.py#L470-L512 | train | Reads at most size bytes from the file. | 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/gridfs/grid_file.py | GridOut.seek | def seek(self, pos, whence=_SEEK_SET):
"""Set the current position of this file.
:Parameters:
- `pos`: the position (or offset if using relative
positioning) to seek to
- `whence` (optional): where to seek
from. :attr:`os.SEEK_SET` (``0``) for absolute file
... | python | def seek(self, pos, whence=_SEEK_SET):
"""Set the current position of this file.
:Parameters:
- `pos`: the position (or offset if using relative
positioning) to seek to
- `whence` (optional): where to seek
from. :attr:`os.SEEK_SET` (``0``) for absolute file
... | [
"def",
"seek",
"(",
"self",
",",
"pos",
",",
"whence",
"=",
"_SEEK_SET",
")",
":",
"if",
"whence",
"==",
"_SEEK_SET",
":",
"new_pos",
"=",
"pos",
"elif",
"whence",
"==",
"_SEEK_CUR",
":",
"new_pos",
"=",
"self",
".",
"__position",
"+",
"pos",
"elif",
... | Set the current position of this file.
:Parameters:
- `pos`: the position (or offset if using relative
positioning) to seek to
- `whence` (optional): where to seek
from. :attr:`os.SEEK_SET` (``0``) for absolute file
positioning, :attr:`os.SEEK_CUR` (``1``) to ... | [
"Set",
"the",
"current",
"position",
"of",
"this",
"file",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/grid_file.py#L553-L578 | train | Set the current position of the file to pos. | 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/win/wmi/sampler.py | WMISampler.provider | def provider(self, value):
"""
Validate and set a WMI provider. Default to `ProviderArchitecture.DEFAULT`
"""
result = None
# `None` defaults to `ProviderArchitecture.DEFAULT`
defaulted_value = value or ProviderArchitecture.DEFAULT
try:
parsed_value ... | python | def provider(self, value):
"""
Validate and set a WMI provider. Default to `ProviderArchitecture.DEFAULT`
"""
result = None
# `None` defaults to `ProviderArchitecture.DEFAULT`
defaulted_value = value or ProviderArchitecture.DEFAULT
try:
parsed_value ... | [
"def",
"provider",
"(",
"self",
",",
"value",
")",
":",
"result",
"=",
"None",
"# `None` defaults to `ProviderArchitecture.DEFAULT`",
"defaulted_value",
"=",
"value",
"or",
"ProviderArchitecture",
".",
"DEFAULT",
"try",
":",
"parsed_value",
"=",
"int",
"(",
"default... | Validate and set a WMI provider. Default to `ProviderArchitecture.DEFAULT` | [
"Validate",
"and",
"set",
"a",
"WMI",
"provider",
".",
"Default",
"to",
"ProviderArchitecture",
".",
"DEFAULT"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/sampler.py#L155-L175 | train | Validate and set a WMI provider. Default to ProviderArchitecture. DEFAULT | 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/win/wmi/sampler.py | WMISampler.connection | def connection(self):
"""
A property to retrieve the sampler connection information.
"""
return {'host': self.host, 'namespace': self.namespace, 'username': self.username, 'password': self.password} | python | def connection(self):
"""
A property to retrieve the sampler connection information.
"""
return {'host': self.host, 'namespace': self.namespace, 'username': self.username, 'password': self.password} | [
"def",
"connection",
"(",
"self",
")",
":",
"return",
"{",
"'host'",
":",
"self",
".",
"host",
",",
"'namespace'",
":",
"self",
".",
"namespace",
",",
"'username'",
":",
"self",
".",
"username",
",",
"'password'",
":",
"self",
".",
"password",
"}"
] | A property to retrieve the sampler connection information. | [
"A",
"property",
"to",
"retrieve",
"the",
"sampler",
"connection",
"information",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/sampler.py#L178-L182 | train | A property to retrieve the sampler connection information. | 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/win/wmi/sampler.py | WMISampler.connection_key | def connection_key(self):
"""
Return an index key used to cache the sampler connection.
"""
return "{host}:{namespace}:{username}".format(host=self.host, namespace=self.namespace, username=self.username) | python | def connection_key(self):
"""
Return an index key used to cache the sampler connection.
"""
return "{host}:{namespace}:{username}".format(host=self.host, namespace=self.namespace, username=self.username) | [
"def",
"connection_key",
"(",
"self",
")",
":",
"return",
"\"{host}:{namespace}:{username}\"",
".",
"format",
"(",
"host",
"=",
"self",
".",
"host",
",",
"namespace",
"=",
"self",
".",
"namespace",
",",
"username",
"=",
"self",
".",
"username",
")"
] | Return an index key used to cache the sampler connection. | [
"Return",
"an",
"index",
"key",
"used",
"to",
"cache",
"the",
"sampler",
"connection",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/sampler.py#L185-L189 | train | Return an index key used to cache the sampler 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/win/wmi/sampler.py | WMISampler.formatted_filters | def formatted_filters(self):
"""
Cache and return filters as a comprehensive WQL clause.
"""
if not self._formatted_filters:
filters = deepcopy(self.filters)
self._formatted_filters = self._format_filter(filters, self._and_props)
return self._formatted_fil... | python | def formatted_filters(self):
"""
Cache and return filters as a comprehensive WQL clause.
"""
if not self._formatted_filters:
filters = deepcopy(self.filters)
self._formatted_filters = self._format_filter(filters, self._and_props)
return self._formatted_fil... | [
"def",
"formatted_filters",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_formatted_filters",
":",
"filters",
"=",
"deepcopy",
"(",
"self",
".",
"filters",
")",
"self",
".",
"_formatted_filters",
"=",
"self",
".",
"_format_filter",
"(",
"filters",
",",
... | Cache and return filters as a comprehensive WQL clause. | [
"Cache",
"and",
"return",
"filters",
"as",
"a",
"comprehensive",
"WQL",
"clause",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/sampler.py#L192-L199 | train | Returns a list of filters as a comprehensive WQL clause. | 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/win/wmi/sampler.py | WMISampler.sample | def sample(self):
"""
Compute new samples.
"""
self._sampling = True
try:
if self.is_raw_perf_class and not self._previous_sample:
self._current_sample = self._query()
self._previous_sample = self._current_sample
self._current... | python | def sample(self):
"""
Compute new samples.
"""
self._sampling = True
try:
if self.is_raw_perf_class and not self._previous_sample:
self._current_sample = self._query()
self._previous_sample = self._current_sample
self._current... | [
"def",
"sample",
"(",
"self",
")",
":",
"self",
".",
"_sampling",
"=",
"True",
"try",
":",
"if",
"self",
".",
"is_raw_perf_class",
"and",
"not",
"self",
".",
"_previous_sample",
":",
"self",
".",
"_current_sample",
"=",
"self",
".",
"_query",
"(",
")",
... | Compute new samples. | [
"Compute",
"new",
"samples",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/sampler.py#L206-L222 | train | Compute new samples. | 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/win/wmi/sampler.py | WMISampler._get_property_calculator | def _get_property_calculator(self, counter_type):
"""
Return the calculator for the given `counter_type`.
Fallback with `get_raw`.
"""
calculator = get_raw
try:
calculator = get_calculator(counter_type)
except UndefinedCalculator:
self.logg... | python | def _get_property_calculator(self, counter_type):
"""
Return the calculator for the given `counter_type`.
Fallback with `get_raw`.
"""
calculator = get_raw
try:
calculator = get_calculator(counter_type)
except UndefinedCalculator:
self.logg... | [
"def",
"_get_property_calculator",
"(",
"self",
",",
"counter_type",
")",
":",
"calculator",
"=",
"get_raw",
"try",
":",
"calculator",
"=",
"get_calculator",
"(",
"counter_type",
")",
"except",
"UndefinedCalculator",
":",
"self",
".",
"logger",
".",
"warning",
"... | Return the calculator for the given `counter_type`.
Fallback with `get_raw`. | [
"Return",
"the",
"calculator",
"for",
"the",
"given",
"counter_type",
".",
"Fallback",
"with",
"get_raw",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/sampler.py#L276-L290 | train | Return the calculator for the given counter_type. | 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/win/wmi/sampler.py | WMISampler._format_property_values | def _format_property_values(self, previous, current):
"""
Format WMI Object's RAW data based on the previous sample.
Do not override the original WMI Object !
"""
formatted_wmi_object = CaseInsensitiveDict()
for property_name, property_raw_value in iteritems(current):
... | python | def _format_property_values(self, previous, current):
"""
Format WMI Object's RAW data based on the previous sample.
Do not override the original WMI Object !
"""
formatted_wmi_object = CaseInsensitiveDict()
for property_name, property_raw_value in iteritems(current):
... | [
"def",
"_format_property_values",
"(",
"self",
",",
"previous",
",",
"current",
")",
":",
"formatted_wmi_object",
"=",
"CaseInsensitiveDict",
"(",
")",
"for",
"property_name",
",",
"property_raw_value",
"in",
"iteritems",
"(",
"current",
")",
":",
"counter_type",
... | Format WMI Object's RAW data based on the previous sample.
Do not override the original WMI Object ! | [
"Format",
"WMI",
"Object",
"s",
"RAW",
"data",
"based",
"on",
"the",
"previous",
"sample",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/sampler.py#L292-L310 | train | Formats the WMI Object s RAW data based on the previous sample and the current sample. | 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/win/wmi/sampler.py | WMISampler.get_connection | def get_connection(self):
"""
Create a new WMI connection
"""
self.logger.debug(
u"Connecting to WMI server "
u"(host={host}, namespace={namespace}, provider={provider}, username={username}).".format(
host=self.host, namespace=self.namespace, provi... | python | def get_connection(self):
"""
Create a new WMI connection
"""
self.logger.debug(
u"Connecting to WMI server "
u"(host={host}, namespace={namespace}, provider={provider}, username={username}).".format(
host=self.host, namespace=self.namespace, provi... | [
"def",
"get_connection",
"(",
"self",
")",
":",
"self",
".",
"logger",
".",
"debug",
"(",
"u\"Connecting to WMI server \"",
"u\"(host={host}, namespace={namespace}, provider={provider}, username={username}).\"",
".",
"format",
"(",
"host",
"=",
"self",
".",
"host",
",",
... | Create a new WMI connection | [
"Create",
"a",
"new",
"WMI",
"connection"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/sampler.py#L312-L339 | train | Create a new connection to the WMI server. | 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.