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
kubelet/datadog_checks/kubelet/prometheus.py
CadvisorPrometheusScraperMixin._get_pod_uid
def _get_pod_uid(self, labels): """ Return the id of a pod :param labels: :return: str or None """ namespace = CadvisorPrometheusScraperMixin._get_container_label(labels, "namespace") pod_name = CadvisorPrometheusScraperMixin._get_container_label(labels, "pod_name...
python
def _get_pod_uid(self, labels): """ Return the id of a pod :param labels: :return: str or None """ namespace = CadvisorPrometheusScraperMixin._get_container_label(labels, "namespace") pod_name = CadvisorPrometheusScraperMixin._get_container_label(labels, "pod_name...
[ "def", "_get_pod_uid", "(", "self", ",", "labels", ")", ":", "namespace", "=", "CadvisorPrometheusScraperMixin", ".", "_get_container_label", "(", "labels", ",", "\"namespace\"", ")", "pod_name", "=", "CadvisorPrometheusScraperMixin", ".", "_get_container_label", "(", ...
Return the id of a pod :param labels: :return: str or None
[ "Return", "the", "id", "of", "a", "pod", ":", "param", "labels", ":", ":", "return", ":", "str", "or", "None" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/prometheus.py#L181-L189
train
Get the pod uid from the pod_name and namespace
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/prometheus.py
CadvisorPrometheusScraperMixin._is_pod_host_networked
def _is_pod_host_networked(self, pod_uid): """ Return if the pod is on host Network Return False if the Pod isn't in the pod list :param pod_uid: str :return: bool """ for pod in self.pod_list['items']: if pod.get('metadata', {}).get('uid', '') == pod_...
python
def _is_pod_host_networked(self, pod_uid): """ Return if the pod is on host Network Return False if the Pod isn't in the pod list :param pod_uid: str :return: bool """ for pod in self.pod_list['items']: if pod.get('metadata', {}).get('uid', '') == pod_...
[ "def", "_is_pod_host_networked", "(", "self", ",", "pod_uid", ")", ":", "for", "pod", "in", "self", ".", "pod_list", "[", "'items'", "]", ":", "if", "pod", ".", "get", "(", "'metadata'", ",", "{", "}", ")", ".", "get", "(", "'uid'", ",", "''", ")",...
Return if the pod is on host Network Return False if the Pod isn't in the pod list :param pod_uid: str :return: bool
[ "Return", "if", "the", "pod", "is", "on", "host", "Network", "Return", "False", "if", "the", "Pod", "isn", "t", "in", "the", "pod", "list", ":", "param", "pod_uid", ":", "str", ":", "return", ":", "bool" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/prometheus.py#L201-L211
train
Return True if the pod is on host Network Return False if the pod is not in the pod list
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
kubelet/datadog_checks/kubelet/prometheus.py
CadvisorPrometheusScraperMixin._get_pod_by_metric_label
def _get_pod_by_metric_label(self, labels): """ :param labels: metric labels: iterable :return: """ pod_uid = self._get_pod_uid(labels) return get_pod_by_uid(pod_uid, self.pod_list)
python
def _get_pod_by_metric_label(self, labels): """ :param labels: metric labels: iterable :return: """ pod_uid = self._get_pod_uid(labels) return get_pod_by_uid(pod_uid, self.pod_list)
[ "def", "_get_pod_by_metric_label", "(", "self", ",", "labels", ")", ":", "pod_uid", "=", "self", ".", "_get_pod_uid", "(", "labels", ")", "return", "get_pod_by_uid", "(", "pod_uid", ",", "self", ".", "pod_list", ")" ]
:param labels: metric labels: iterable :return:
[ ":", "param", "labels", ":", "metric", "labels", ":", "iterable", ":", "return", ":" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/prometheus.py#L213-L219
train
Get a pod by metric label
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/prometheus.py
CadvisorPrometheusScraperMixin._sum_values_by_context
def _sum_values_by_context(metric, uid_from_labels): """ Iterates over all metrics in a metric and sums the values matching the same uid. Modifies the metric family in place. :param metric: prometheus metric family :param uid_from_labels: function mapping a metric.label to a uniq...
python
def _sum_values_by_context(metric, uid_from_labels): """ Iterates over all metrics in a metric and sums the values matching the same uid. Modifies the metric family in place. :param metric: prometheus metric family :param uid_from_labels: function mapping a metric.label to a uniq...
[ "def", "_sum_values_by_context", "(", "metric", ",", "uid_from_labels", ")", ":", "seen", "=", "{", "}", "for", "sample", "in", "metric", ".", "samples", ":", "uid", "=", "uid_from_labels", "(", "sample", "[", "OpenMetricsBaseCheck", ".", "SAMPLE_LABELS", "]",...
Iterates over all metrics in a metric and sums the values matching the same uid. Modifies the metric family in place. :param metric: prometheus metric family :param uid_from_labels: function mapping a metric.label to a unique context id :return: dict with uid as keys, metric object refer...
[ "Iterates", "over", "all", "metrics", "in", "a", "metric", "and", "sums", "the", "values", "matching", "the", "same", "uid", ".", "Modifies", "the", "metric", "family", "in", "place", ".", ":", "param", "metric", ":", "prometheus", "metric", "family", ":",...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/prometheus.py#L238-L265
train
Sums the values of all the contexts in a metric.
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/prometheus.py
CadvisorPrometheusScraperMixin._process_container_metric
def _process_container_metric(self, type, metric_name, metric, scraper_config): """ Takes a simple metric about a container, reports it as a rate or gauge. If several series are found for a given container, values are summed before submission. """ if metric.type not in METRIC_TYP...
python
def _process_container_metric(self, type, metric_name, metric, scraper_config): """ Takes a simple metric about a container, reports it as a rate or gauge. If several series are found for a given container, values are summed before submission. """ if metric.type not in METRIC_TYP...
[ "def", "_process_container_metric", "(", "self", ",", "type", ",", "metric_name", ",", "metric", ",", "scraper_config", ")", ":", "if", "metric", ".", "type", "not", "in", "METRIC_TYPES", ":", "self", ".", "log", ".", "error", "(", "\"Metric type %s unsupporte...
Takes a simple metric about a container, reports it as a rate or gauge. If several series are found for a given container, values are summed before submission.
[ "Takes", "a", "simple", "metric", "about", "a", "container", "reports", "it", "as", "a", "rate", "or", "gauge", ".", "If", "several", "series", "are", "found", "for", "a", "given", "container", "values", "are", "summed", "before", "submission", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/prometheus.py#L267-L298
train
Processes a metric about a container.
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/prometheus.py
CadvisorPrometheusScraperMixin._process_pod_rate
def _process_pod_rate(self, metric_name, metric, scraper_config): """ Takes a simple metric about a pod, reports it as a rate. If several series are found for a given pod, values are summed before submission. """ if metric.type not in METRIC_TYPES: self.log.error("Met...
python
def _process_pod_rate(self, metric_name, metric, scraper_config): """ Takes a simple metric about a pod, reports it as a rate. If several series are found for a given pod, values are summed before submission. """ if metric.type not in METRIC_TYPES: self.log.error("Met...
[ "def", "_process_pod_rate", "(", "self", ",", "metric_name", ",", "metric", ",", "scraper_config", ")", ":", "if", "metric", ".", "type", "not", "in", "METRIC_TYPES", ":", "self", ".", "log", ".", "error", "(", "\"Metric type %s unsupported for metric %s\"", "%"...
Takes a simple metric about a pod, reports it as a rate. If several series are found for a given pod, values are summed before submission.
[ "Takes", "a", "simple", "metric", "about", "a", "pod", "reports", "it", "as", "a", "rate", ".", "If", "several", "series", "are", "found", "for", "a", "given", "pod", "values", "are", "summed", "before", "submission", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/prometheus.py#L300-L316
train
Processes a metric about a pod and reports it as a rate.
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/prometheus.py
CadvisorPrometheusScraperMixin._process_usage_metric
def _process_usage_metric(self, m_name, metric, cache, scraper_config): """ Takes a metric object, a metric name, and a cache dict where it will store container_name --> (value, tags) so that _process_limit_metric can compute usage_pct it also submit said value and tags as a gauge. ...
python
def _process_usage_metric(self, m_name, metric, cache, scraper_config): """ Takes a metric object, a metric name, and a cache dict where it will store container_name --> (value, tags) so that _process_limit_metric can compute usage_pct it also submit said value and tags as a gauge. ...
[ "def", "_process_usage_metric", "(", "self", ",", "m_name", ",", "metric", ",", "cache", ",", "scraper_config", ")", ":", "# track containers that still exist in the cache", "seen_keys", "=", "{", "k", ":", "False", "for", "k", "in", "cache", "}", "samples", "="...
Takes a metric object, a metric name, and a cache dict where it will store container_name --> (value, tags) so that _process_limit_metric can compute usage_pct it also submit said value and tags as a gauge.
[ "Takes", "a", "metric", "object", "a", "metric", "name", "and", "a", "cache", "dict", "where", "it", "will", "store", "container_name", "--", ">", "(", "value", "tags", ")", "so", "that", "_process_limit_metric", "can", "compute", "usage_pct", "it", "also", ...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/prometheus.py#L318-L355
train
Processes a usage metric.
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/prometheus.py
CadvisorPrometheusScraperMixin._process_limit_metric
def _process_limit_metric(self, m_name, metric, cache, scraper_config, pct_m_name=None): """ Reports limit metrics if m_name is not an empty string, and optionally checks in the given cache if there's a usage for each sample in the metric and reports the usage_pct """ sam...
python
def _process_limit_metric(self, m_name, metric, cache, scraper_config, pct_m_name=None): """ Reports limit metrics if m_name is not an empty string, and optionally checks in the given cache if there's a usage for each sample in the metric and reports the usage_pct """ sam...
[ "def", "_process_limit_metric", "(", "self", ",", "m_name", ",", "metric", ",", "cache", ",", "scraper_config", ",", "pct_m_name", "=", "None", ")", ":", "samples", "=", "self", ".", "_sum_values_by_context", "(", "metric", ",", "self", ".", "_get_entity_id_if...
Reports limit metrics if m_name is not an empty string, and optionally checks in the given cache if there's a usage for each sample in the metric and reports the usage_pct
[ "Reports", "limit", "metrics", "if", "m_name", "is", "not", "an", "empty", "string", "and", "optionally", "checks", "in", "the", "given", "cache", "if", "there", "s", "a", "usage", "for", "each", "sample", "in", "the", "metric", "and", "reports", "the", ...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/prometheus.py#L357-L387
train
Processes a limit metric.
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/prometheus.py
CadvisorPrometheusScraperMixin.container_fs_usage_bytes
def container_fs_usage_bytes(self, metric, scraper_config): """ Number of bytes that are consumed by the container on this filesystem. """ metric_name = scraper_config['namespace'] + '.filesystem.usage' if metric.type not in METRIC_TYPES: self.log.error("Metric type %...
python
def container_fs_usage_bytes(self, metric, scraper_config): """ Number of bytes that are consumed by the container on this filesystem. """ metric_name = scraper_config['namespace'] + '.filesystem.usage' if metric.type not in METRIC_TYPES: self.log.error("Metric type %...
[ "def", "container_fs_usage_bytes", "(", "self", ",", "metric", ",", "scraper_config", ")", ":", "metric_name", "=", "scraper_config", "[", "'namespace'", "]", "+", "'.filesystem.usage'", "if", "metric", ".", "type", "not", "in", "METRIC_TYPES", ":", "self", ".",...
Number of bytes that are consumed by the container on this filesystem.
[ "Number", "of", "bytes", "that", "are", "consumed", "by", "the", "container", "on", "this", "filesystem", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/prometheus.py#L453-L461
train
This method is used to update the number of bytes that are consumed by the container on this filesystem.
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/prometheus.py
CadvisorPrometheusScraperMixin.container_fs_limit_bytes
def container_fs_limit_bytes(self, metric, scraper_config): """ Number of bytes that can be consumed by the container on this filesystem. This method is used by container_fs_usage_bytes, it doesn't report any metric """ pct_m_name = scraper_config['namespace'] + '.filesystem.usag...
python
def container_fs_limit_bytes(self, metric, scraper_config): """ Number of bytes that can be consumed by the container on this filesystem. This method is used by container_fs_usage_bytes, it doesn't report any metric """ pct_m_name = scraper_config['namespace'] + '.filesystem.usag...
[ "def", "container_fs_limit_bytes", "(", "self", ",", "metric", ",", "scraper_config", ")", ":", "pct_m_name", "=", "scraper_config", "[", "'namespace'", "]", "+", "'.filesystem.usage_pct'", "if", "metric", ".", "type", "not", "in", "METRIC_TYPES", ":", "self", "...
Number of bytes that can be consumed by the container on this filesystem. This method is used by container_fs_usage_bytes, it doesn't report any metric
[ "Number", "of", "bytes", "that", "can", "be", "consumed", "by", "the", "container", "on", "this", "filesystem", ".", "This", "method", "is", "used", "by", "container_fs_usage_bytes", "it", "doesn", "t", "report", "any", "metric" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubelet/datadog_checks/kubelet/prometheus.py#L463-L472
train
This method is used by container_fs_usage_bytes to report the number of bytes that can be consumed by the container on this filesystem.
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
mongo/datadog_checks/mongo/mongo.py
MongoDb._report_replica_set_state
def _report_replica_set_state(self, state, clean_server_name, replset_name): """ Report the member's replica set state * Submit a service check. * Create an event on state change. """ last_state = self._last_state_by_server.get(clean_server_name, -1) self._last_st...
python
def _report_replica_set_state(self, state, clean_server_name, replset_name): """ Report the member's replica set state * Submit a service check. * Create an event on state change. """ last_state = self._last_state_by_server.get(clean_server_name, -1) self._last_st...
[ "def", "_report_replica_set_state", "(", "self", ",", "state", ",", "clean_server_name", ",", "replset_name", ")", ":", "last_state", "=", "self", ".", "_last_state_by_server", ".", "get", "(", "clean_server_name", ",", "-", "1", ")", "self", ".", "_last_state_b...
Report the member's replica set state * Submit a service check. * Create an event on state change.
[ "Report", "the", "member", "s", "replica", "set", "state", "*", "Submit", "a", "service", "check", ".", "*", "Create", "an", "event", "on", "state", "change", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mongo/datadog_checks/mongo/mongo.py#L450-L459
train
Report the state of a replica set.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mongo/datadog_checks/mongo/mongo.py
MongoDb.hostname_for_event
def hostname_for_event(self, clean_server_name): """Return a reasonable hostname for a replset membership event to mention.""" uri = urlsplit(clean_server_name) if '@' in uri.netloc: hostname = uri.netloc.split('@')[1].split(':')[0] else: hostname = uri.netloc.spl...
python
def hostname_for_event(self, clean_server_name): """Return a reasonable hostname for a replset membership event to mention.""" uri = urlsplit(clean_server_name) if '@' in uri.netloc: hostname = uri.netloc.split('@')[1].split(':')[0] else: hostname = uri.netloc.spl...
[ "def", "hostname_for_event", "(", "self", ",", "clean_server_name", ")", ":", "uri", "=", "urlsplit", "(", "clean_server_name", ")", "if", "'@'", "in", "uri", ".", "netloc", ":", "hostname", "=", "uri", ".", "netloc", ".", "split", "(", "'@'", ")", "[", ...
Return a reasonable hostname for a replset membership event to mention.
[ "Return", "a", "reasonable", "hostname", "for", "a", "replset", "membership", "event", "to", "mention", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mongo/datadog_checks/mongo/mongo.py#L461-L470
train
Return a reasonable hostname for a replset membership event to mention.
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
mongo/datadog_checks/mongo/mongo.py
MongoDb.create_event
def create_event(self, last_state, state, clean_server_name, replset_name): """Create an event with a message describing the replication state of a mongo node""" status = self.get_state_description(state) short_status = self.get_state_name(state) last_short_status = self.get...
python
def create_event(self, last_state, state, clean_server_name, replset_name): """Create an event with a message describing the replication state of a mongo node""" status = self.get_state_description(state) short_status = self.get_state_name(state) last_short_status = self.get...
[ "def", "create_event", "(", "self", ",", "last_state", ",", "state", ",", "clean_server_name", ",", "replset_name", ")", ":", "status", "=", "self", ".", "get_state_description", "(", "state", ")", "short_status", "=", "self", ".", "get_state_name", "(", "stat...
Create an event with a message describing the replication state of a mongo node
[ "Create", "an", "event", "with", "a", "message", "describing", "the", "replication", "state", "of", "a", "mongo", "node" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mongo/datadog_checks/mongo/mongo.py#L472-L498
train
Create an event describing the replication state of a mongo 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
mongo/datadog_checks/mongo/mongo.py
MongoDb._build_metric_list_to_collect
def _build_metric_list_to_collect(self, additional_metrics): """ Build the metric list to collect based on the instance preferences. """ metrics_to_collect = {} # Defaut metrics for default_metrics in itervalues(self.DEFAULT_METRICS): metrics_to_collect.updat...
python
def _build_metric_list_to_collect(self, additional_metrics): """ Build the metric list to collect based on the instance preferences. """ metrics_to_collect = {} # Defaut metrics for default_metrics in itervalues(self.DEFAULT_METRICS): metrics_to_collect.updat...
[ "def", "_build_metric_list_to_collect", "(", "self", ",", "additional_metrics", ")", ":", "metrics_to_collect", "=", "{", "}", "# Defaut metrics", "for", "default_metrics", "in", "itervalues", "(", "self", ".", "DEFAULT_METRICS", ")", ":", "metrics_to_collect", ".", ...
Build the metric list to collect based on the instance preferences.
[ "Build", "the", "metric", "list", "to", "collect", "based", "on", "the", "instance", "preferences", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mongo/datadog_checks/mongo/mongo.py#L500-L527
train
Build the metric list to collect based on the instance preferences.
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
mongo/datadog_checks/mongo/mongo.py
MongoDb._get_metrics_to_collect
def _get_metrics_to_collect(self, instance_key, additional_metrics): """ Return and cache the list of metrics to collect. """ if instance_key not in self.metrics_to_collect_by_instance: self.metrics_to_collect_by_instance[instance_key] = self._build_metric_list_to_collect(add...
python
def _get_metrics_to_collect(self, instance_key, additional_metrics): """ Return and cache the list of metrics to collect. """ if instance_key not in self.metrics_to_collect_by_instance: self.metrics_to_collect_by_instance[instance_key] = self._build_metric_list_to_collect(add...
[ "def", "_get_metrics_to_collect", "(", "self", ",", "instance_key", ",", "additional_metrics", ")", ":", "if", "instance_key", "not", "in", "self", ".", "metrics_to_collect_by_instance", ":", "self", ".", "metrics_to_collect_by_instance", "[", "instance_key", "]", "="...
Return and cache the list of metrics to collect.
[ "Return", "and", "cache", "the", "list", "of", "metrics", "to", "collect", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mongo/datadog_checks/mongo/mongo.py#L529-L535
train
Return the list of metrics to collect.
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
mongo/datadog_checks/mongo/mongo.py
MongoDb._resolve_metric
def _resolve_metric(self, original_metric_name, metrics_to_collect, prefix=""): """ Return the submit method and the metric name to use. The metric name is defined as follow: * If available, the normalized metric name alias * (Or) the normalized original metric name """ ...
python
def _resolve_metric(self, original_metric_name, metrics_to_collect, prefix=""): """ Return the submit method and the metric name to use. The metric name is defined as follow: * If available, the normalized metric name alias * (Or) the normalized original metric name """ ...
[ "def", "_resolve_metric", "(", "self", ",", "original_metric_name", ",", "metrics_to_collect", ",", "prefix", "=", "\"\"", ")", ":", "submit_method", "=", "(", "metrics_to_collect", "[", "original_metric_name", "]", "[", "0", "]", "if", "isinstance", "(", "metri...
Return the submit method and the metric name to use. The metric name is defined as follow: * If available, the normalized metric name alias * (Or) the normalized original metric name
[ "Return", "the", "submit", "method", "and", "the", "metric", "name", "to", "use", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mongo/datadog_checks/mongo/mongo.py#L537-L557
train
Resolve the metric name to use.
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
mongo/datadog_checks/mongo/mongo.py
MongoDb._normalize
def _normalize(self, metric_name, submit_method, prefix): """ Replace case-sensitive metric name characters, normalize the metric name, prefix and suffix according to its type. """ metric_prefix = "mongodb." if not prefix else "mongodb.{0}.".format(prefix) metric_suffix =...
python
def _normalize(self, metric_name, submit_method, prefix): """ Replace case-sensitive metric name characters, normalize the metric name, prefix and suffix according to its type. """ metric_prefix = "mongodb." if not prefix else "mongodb.{0}.".format(prefix) metric_suffix =...
[ "def", "_normalize", "(", "self", ",", "metric_name", ",", "submit_method", ",", "prefix", ")", ":", "metric_prefix", "=", "\"mongodb.\"", "if", "not", "prefix", "else", "\"mongodb.{0}.\"", ".", "format", "(", "prefix", ")", "metric_suffix", "=", "\"ps\"", "if...
Replace case-sensitive metric name characters, normalize the metric name, prefix and suffix according to its type.
[ "Replace", "case", "-", "sensitive", "metric", "name", "characters", "normalize", "the", "metric", "name", "prefix", "and", "suffix", "according", "to", "its", "type", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mongo/datadog_checks/mongo/mongo.py#L559-L576
train
Normalize the metric name and wrap it in a new one.
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
mongo/datadog_checks/mongo/mongo.py
MongoDb._authenticate
def _authenticate(self, database, username, password, use_x509, server_name, service_check_tags): """ Authenticate to the database. Available mechanisms: * Username & password * X.509 More information: https://api.mongodb.com/python/current/examples/authenticati...
python
def _authenticate(self, database, username, password, use_x509, server_name, service_check_tags): """ Authenticate to the database. Available mechanisms: * Username & password * X.509 More information: https://api.mongodb.com/python/current/examples/authenticati...
[ "def", "_authenticate", "(", "self", ",", "database", ",", "username", ",", "password", ",", "use_x509", ",", "server_name", ",", "service_check_tags", ")", ":", "authenticated", "=", "False", "try", ":", "# X.509", "if", "use_x509", ":", "self", ".", "log",...
Authenticate to the database. Available mechanisms: * Username & password * X.509 More information: https://api.mongodb.com/python/current/examples/authentication.html
[ "Authenticate", "to", "the", "database", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mongo/datadog_checks/mongo/mongo.py#L578-L608
train
Authenticate 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
mongo/datadog_checks/mongo/mongo.py
MongoDb._parse_uri
def _parse_uri(cls, server, sanitize_username=False): """ Parses a MongoDB-formatted URI (e.g. mongodb://user:pass@server/db) and returns parsed elements and a sanitized URI. """ parsed = pymongo.uri_parser.parse_uri(server) username = parsed.get('username') pass...
python
def _parse_uri(cls, server, sanitize_username=False): """ Parses a MongoDB-formatted URI (e.g. mongodb://user:pass@server/db) and returns parsed elements and a sanitized URI. """ parsed = pymongo.uri_parser.parse_uri(server) username = parsed.get('username') pass...
[ "def", "_parse_uri", "(", "cls", ",", "server", ",", "sanitize_username", "=", "False", ")", ":", "parsed", "=", "pymongo", ".", "uri_parser", ".", "parse_uri", "(", "server", ")", "username", "=", "parsed", ".", "get", "(", "'username'", ")", "password", ...
Parses a MongoDB-formatted URI (e.g. mongodb://user:pass@server/db) and returns parsed elements and a sanitized URI.
[ "Parses", "a", "MongoDB", "-", "formatted", "URI", "(", "e", ".", "g", ".", "mongodb", ":", "//", "user", ":", "pass" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mongo/datadog_checks/mongo/mongo.py#L611-L634
train
Parses a MongoDB - formatted URI and returns parsed elements and a sanitized URI.
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
mongo/datadog_checks/mongo/mongo.py
MongoDb._collect_indexes_stats
def _collect_indexes_stats(self, instance, db, tags): """ Collect indexes statistics for all collections in the configuration. This use the "$indexStats" command. """ for coll_name in instance.get('collections', []): try: for stats in db[coll_name].agg...
python
def _collect_indexes_stats(self, instance, db, tags): """ Collect indexes statistics for all collections in the configuration. This use the "$indexStats" command. """ for coll_name in instance.get('collections', []): try: for stats in db[coll_name].agg...
[ "def", "_collect_indexes_stats", "(", "self", ",", "instance", ",", "db", ",", "tags", ")", ":", "for", "coll_name", "in", "instance", ".", "get", "(", "'collections'", ",", "[", "]", ")", ":", "try", ":", "for", "stats", "in", "db", "[", "coll_name", ...
Collect indexes statistics for all collections in the configuration. This use the "$indexStats" command.
[ "Collect", "indexes", "statistics", "for", "all", "collections", "in", "the", "configuration", ".", "This", "use", "the", "$indexStats", "command", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mongo/datadog_checks/mongo/mongo.py#L636-L651
train
Collect indexes stats for all collections in the configuration.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
mongo/datadog_checks/mongo/mongo.py
MongoDb.check
def check(self, instance): """ Returns a dictionary that looks a lot like what's sent back by db.serverStatus() """ def total_seconds(td): """ Returns total seconds of a timedelta in a way that's safe for Python < 2.7 """ ...
python
def check(self, instance): """ Returns a dictionary that looks a lot like what's sent back by db.serverStatus() """ def total_seconds(td): """ Returns total seconds of a timedelta in a way that's safe for Python < 2.7 """ ...
[ "def", "check", "(", "self", ",", "instance", ")", ":", "def", "total_seconds", "(", "td", ")", ":", "\"\"\"\n Returns total seconds of a timedelta in a way that's safe for\n Python < 2.7\n \"\"\"", "if", "hasattr", "(", "td", ",", "'total_sec...
Returns a dictionary that looks a lot like what's sent back by db.serverStatus()
[ "Returns", "a", "dictionary", "that", "looks", "a", "lot", "like", "what", "s", "sent", "back", "by", "db", ".", "serverStatus", "()" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/mongo/datadog_checks/mongo/mongo.py#L653-L1045
train
Check the status of a specific instance of a specific version of 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
ibm_mq/datadog_checks/ibm_mq/connection.py
get_normal_connection
def get_normal_connection(config): """ Get the connection either with a username and password or without """ if config.username and config.password: log.debug("connecting with username and password") queue_manager = pymqi.connect( config.queue_manager_name, config.channel, co...
python
def get_normal_connection(config): """ Get the connection either with a username and password or without """ if config.username and config.password: log.debug("connecting with username and password") queue_manager = pymqi.connect( config.queue_manager_name, config.channel, co...
[ "def", "get_normal_connection", "(", "config", ")", ":", "if", "config", ".", "username", "and", "config", ".", "password", ":", "log", ".", "debug", "(", "\"connecting with username and password\"", ")", "queue_manager", "=", "pymqi", ".", "connect", "(", "conf...
Get the connection either with a username and password or without
[ "Get", "the", "connection", "either", "with", "a", "username", "and", "password", "or", "without" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/ibm_mq/datadog_checks/ibm_mq/connection.py#L25-L38
train
Get the connection to the normal queue manager.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
ibm_mq/datadog_checks/ibm_mq/connection.py
get_ssl_connection
def get_ssl_connection(config): """ Get the connection with SSL """ cd = pymqi.CD() cd.ChannelName = config.channel cd.ConnectionName = config.host_and_port cd.ChannelType = pymqi.CMQC.MQCHT_CLNTCONN cd.TransportType = pymqi.CMQC.MQXPT_TCP cd.SSLCipherSpec = config.ssl_cipher_spec ...
python
def get_ssl_connection(config): """ Get the connection with SSL """ cd = pymqi.CD() cd.ChannelName = config.channel cd.ConnectionName = config.host_and_port cd.ChannelType = pymqi.CMQC.MQCHT_CLNTCONN cd.TransportType = pymqi.CMQC.MQXPT_TCP cd.SSLCipherSpec = config.ssl_cipher_spec ...
[ "def", "get_ssl_connection", "(", "config", ")", ":", "cd", "=", "pymqi", ".", "CD", "(", ")", "cd", ".", "ChannelName", "=", "config", ".", "channel", "cd", ".", "ConnectionName", "=", "config", ".", "host_and_port", "cd", ".", "ChannelType", "=", "pymq...
Get the connection with SSL
[ "Get", "the", "connection", "with", "SSL" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/ibm_mq/datadog_checks/ibm_mq/connection.py#L41-L58
train
Get the connection with SSL
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/env/check.py
check_run
def check_run(check, env, rate, times, pause, delay, log_level, as_json, break_point): """Run an Agent check.""" envs = get_configured_envs(check) if not envs: echo_failure('No active environments found for `{}`.'.format(check)) echo_info('See what is available to start via `ddev env ls {}`....
python
def check_run(check, env, rate, times, pause, delay, log_level, as_json, break_point): """Run an Agent check.""" envs = get_configured_envs(check) if not envs: echo_failure('No active environments found for `{}`.'.format(check)) echo_info('See what is available to start via `ddev env ls {}`....
[ "def", "check_run", "(", "check", ",", "env", ",", "rate", ",", "times", ",", "pause", ",", "delay", ",", "log_level", ",", "as_json", ",", "break_point", ")", ":", "envs", "=", "get_configured_envs", "(", "check", ")", "if", "not", "envs", ":", "echo_...
Run an Agent check.
[ "Run", "an", "Agent", "check", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/env/check.py#L33-L60
train
Run an Agent 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
openstack/datadog_checks/openstack/openstack.py
OpenStackScope.get_user_identity
def get_user_identity(cls, instance_config): """ Parse user identity out of init_config To guarantee a uniquely identifiable user, expects {"user": {"name": "my_username", "password": "my_password", "domain": {"id": "my_domain_id"} } } ...
python
def get_user_identity(cls, instance_config): """ Parse user identity out of init_config To guarantee a uniquely identifiable user, expects {"user": {"name": "my_username", "password": "my_password", "domain": {"id": "my_domain_id"} } } ...
[ "def", "get_user_identity", "(", "cls", ",", "instance_config", ")", ":", "user", "=", "instance_config", ".", "get", "(", "'user'", ")", "if", "not", "(", "user", "and", "user", ".", "get", "(", "'name'", ")", "and", "user", ".", "get", "(", "'passwor...
Parse user identity out of init_config To guarantee a uniquely identifiable user, expects {"user": {"name": "my_username", "password": "my_password", "domain": {"id": "my_domain_id"} } }
[ "Parse", "user", "identity", "out", "of", "init_config" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack/datadog_checks/openstack/openstack.py#L171-L189
train
Parse user identity out of init_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
openstack/datadog_checks/openstack/openstack.py
OpenStackScope.get_auth_scope
def get_auth_scope(cls, instance_config): """ Parse authorization scope out of init_config To guarantee a uniquely identifiable scope, expects either: {'project': {'name': 'my_project', 'domain': {'id': 'my_domain_id'}}} OR {'project': {'id': 'my_project_id'}} ""...
python
def get_auth_scope(cls, instance_config): """ Parse authorization scope out of init_config To guarantee a uniquely identifiable scope, expects either: {'project': {'name': 'my_project', 'domain': {'id': 'my_domain_id'}}} OR {'project': {'id': 'my_project_id'}} ""...
[ "def", "get_auth_scope", "(", "cls", ",", "instance_config", ")", ":", "auth_scope", "=", "instance_config", ".", "get", "(", "'auth_scope'", ")", "if", "not", "auth_scope", ":", "return", "None", "if", "not", "auth_scope", ".", "get", "(", "'project'", ")",...
Parse authorization scope out of init_config To guarantee a uniquely identifiable scope, expects either: {'project': {'name': 'my_project', 'domain': {'id': 'my_domain_id'}}} OR {'project': {'id': 'my_project_id'}}
[ "Parse", "authorization", "scope", "out", "of", "init_config" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack/datadog_checks/openstack/openstack.py#L192-L217
train
Parse authorization scope out of init_config and return 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
openstack/datadog_checks/openstack/openstack.py
KeystoneCatalog.get_neutron_endpoint
def get_neutron_endpoint(cls, json_resp): """ Parse the service catalog returned by the Identity API for an endpoint matching the Neutron service Sends a CRITICAL service check when none are found registered in the Catalog """ catalog = json_resp.get('token', {}).get('catalog', [...
python
def get_neutron_endpoint(cls, json_resp): """ Parse the service catalog returned by the Identity API for an endpoint matching the Neutron service Sends a CRITICAL service check when none are found registered in the Catalog """ catalog = json_resp.get('token', {}).get('catalog', [...
[ "def", "get_neutron_endpoint", "(", "cls", ",", "json_resp", ")", ":", "catalog", "=", "json_resp", ".", "get", "(", "'token'", ",", "{", "}", ")", ".", "get", "(", "'catalog'", ",", "[", "]", ")", "match", "=", "'neutron'", "neutron_endpoint", "=", "N...
Parse the service catalog returned by the Identity API for an endpoint matching the Neutron service Sends a CRITICAL service check when none are found registered in the Catalog
[ "Parse", "the", "service", "catalog", "returned", "by", "the", "Identity", "API", "for", "an", "endpoint", "matching", "the", "Neutron", "service", "Sends", "a", "CRITICAL", "service", "check", "when", "none", "are", "found", "registered", "in", "the", "Catalo...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack/datadog_checks/openstack/openstack.py#L455-L479
train
Parse the JSON response from the Neutron Identity API and return the endpoint that is available for the neutron service
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/datadog_checks/openstack/openstack.py
KeystoneCatalog.get_nova_endpoint
def get_nova_endpoint(cls, json_resp, nova_api_version=None): """ Parse the service catalog returned by the Identity API for an endpoint matching the Nova service with the requested version Sends a CRITICAL service check when no viable candidates are found in the Catalog """ ...
python
def get_nova_endpoint(cls, json_resp, nova_api_version=None): """ Parse the service catalog returned by the Identity API for an endpoint matching the Nova service with the requested version Sends a CRITICAL service check when no viable candidates are found in the Catalog """ ...
[ "def", "get_nova_endpoint", "(", "cls", ",", "json_resp", ",", "nova_api_version", "=", "None", ")", ":", "nova_version", "=", "nova_api_version", "or", "DEFAULT_NOVA_API_VERSION", "catalog", "=", "json_resp", ".", "get", "(", "'token'", ",", "{", "}", ")", "....
Parse the service catalog returned by the Identity API for an endpoint matching the Nova service with the requested version Sends a CRITICAL service check when no viable candidates are found in the Catalog
[ "Parse", "the", "service", "catalog", "returned", "by", "the", "Identity", "API", "for", "an", "endpoint", "matching", "the", "Nova", "service", "with", "the", "requested", "version", "Sends", "a", "CRITICAL", "service", "check", "when", "no", "viable", "candi...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack/datadog_checks/openstack/openstack.py#L482-L507
train
Parse the Nova service catalog and return the endpoint that is available for the requested 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
openstack/datadog_checks/openstack/openstack.py
OpenStackCheck._make_request_with_auth_fallback
def _make_request_with_auth_fallback(self, url, headers=None, params=None): """ Generic request handler for OpenStack API requests Raises specialized Exceptions for commonly encountered error codes """ self.log.debug("Request URL and Params: %s, %s", url, params) try: ...
python
def _make_request_with_auth_fallback(self, url, headers=None, params=None): """ Generic request handler for OpenStack API requests Raises specialized Exceptions for commonly encountered error codes """ self.log.debug("Request URL and Params: %s, %s", url, params) try: ...
[ "def", "_make_request_with_auth_fallback", "(", "self", ",", "url", ",", "headers", "=", "None", ",", "params", "=", "None", ")", ":", "self", ".", "log", ".", "debug", "(", "\"Request URL and Params: %s, %s\"", ",", "url", ",", "params", ")", "try", ":", ...
Generic request handler for OpenStack API requests Raises specialized Exceptions for commonly encountered error codes
[ "Generic", "request", "handler", "for", "OpenStack", "API", "requests", "Raises", "specialized", "Exceptions", "for", "commonly", "encountered", "error", "codes" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack/datadog_checks/openstack/openstack.py#L576-L606
train
This function is a generic request handler for OpenStack API requests Raises specialized Exceptions for commonly encountered error codes
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/datadog_checks/openstack/openstack.py
OpenStackCheck.get_network_stats
def get_network_stats(self, tags): """ Collect stats for all reachable networks """ # FIXME: (aaditya) Check all networks defaults to true # until we can reliably assign agents to networks to monitor if is_affirmative(self.init_config.get('check_all_networks', True)): ...
python
def get_network_stats(self, tags): """ Collect stats for all reachable networks """ # FIXME: (aaditya) Check all networks defaults to true # until we can reliably assign agents to networks to monitor if is_affirmative(self.init_config.get('check_all_networks', True)): ...
[ "def", "get_network_stats", "(", "self", ",", "tags", ")", ":", "# FIXME: (aaditya) Check all networks defaults to true", "# until we can reliably assign agents to networks to monitor", "if", "is_affirmative", "(", "self", ".", "init_config", ".", "get", "(", "'check_all_networ...
Collect stats for all reachable networks
[ "Collect", "stats", "for", "all", "reachable", "networks" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack/datadog_checks/openstack/openstack.py#L688-L714
train
Collect stats for all reachable networks and add agents to the monitor.
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/datadog_checks/openstack/openstack.py
OpenStackCheck._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].split(',') uptime_sec = uptime.split(',')[0] return {'load...
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].split(',') uptime_sec = uptime.split(',')[0] return {'load...
[ "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/datadog_checks/openstack/openstack.py#L759-L765
train
Parse the uptime string into a dictionary of load average and uptime_sec.
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/datadog_checks/openstack/openstack.py
OpenStackCheck.ensure_auth_scope
def ensure_auth_scope(self, instance): """ 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 """ instance_scope = None ...
python
def ensure_auth_scope(self, instance): """ 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 """ instance_scope = None ...
[ "def", "ensure_auth_scope", "(", "self", ",", "instance", ")", ":", "instance_scope", "=", "None", "custom_tags", "=", "instance", ".", "get", "(", "'tags'", ",", "[", "]", ")", "if", "custom_tags", "is", "None", ":", "custom_tags", "=", "[", "]", "try",...
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/datadog_checks/openstack/openstack.py#L1105-L1179
train
Ensures that the auth token for this instance is valid and returns 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
openstack/datadog_checks/openstack/openstack.py
OpenStackCheck.get_local_hypervisor
def get_local_hypervisor(self): """ Returns the hypervisor running on this host, and assumes a 1-1 between host and hypervisor """ # Look up hypervisors available filtered by my hostname host = self.get_my_hostname() hyp = self.get_all_hypervisor_ids(filter_by_host=host) ...
python
def get_local_hypervisor(self): """ Returns the hypervisor running on this host, and assumes a 1-1 between host and hypervisor """ # Look up hypervisors available filtered by my hostname host = self.get_my_hostname() hyp = self.get_all_hypervisor_ids(filter_by_host=host) ...
[ "def", "get_local_hypervisor", "(", "self", ")", ":", "# Look up hypervisors available filtered by my hostname", "host", "=", "self", ".", "get_my_hostname", "(", ")", "hyp", "=", "self", ".", "get_all_hypervisor_ids", "(", "filter_by_host", "=", "host", ")", "if", ...
Returns the hypervisor running on this host, and assumes a 1-1 between host and hypervisor
[ "Returns", "the", "hypervisor", "running", "on", "this", "host", "and", "assumes", "a", "1", "-", "1", "between", "host", "and", "hypervisor" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack/datadog_checks/openstack/openstack.py#L1313-L1321
train
Returns the local hypervisor running on this host and assumes a 1 - 1 between host and hypervisor
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/datadog_checks/openstack/openstack.py
OpenStackCheck.get_all_projects
def get_all_projects(self, scope): """ Returns all projects in the domain """ url = "{0}/{1}/{2}".format(self.keystone_server_url, DEFAULT_KEYSTONE_API_VERSION, "projects") headers = {'X-Auth-Token': scope.auth_token} try: r = self._make_request_with_auth_fall...
python
def get_all_projects(self, scope): """ Returns all projects in the domain """ url = "{0}/{1}/{2}".format(self.keystone_server_url, DEFAULT_KEYSTONE_API_VERSION, "projects") headers = {'X-Auth-Token': scope.auth_token} try: r = self._make_request_with_auth_fall...
[ "def", "get_all_projects", "(", "self", ",", "scope", ")", ":", "url", "=", "\"{0}/{1}/{2}\"", ".", "format", "(", "self", ".", "keystone_server_url", ",", "DEFAULT_KEYSTONE_API_VERSION", ",", "\"projects\"", ")", "headers", "=", "{", "'X-Auth-Token'", ":", "sco...
Returns all projects in the domain
[ "Returns", "all", "projects", "in", "the", "domain" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack/datadog_checks/openstack/openstack.py#L1323-L1337
train
Returns all projects in the domain
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/datadog_checks/openstack/openstack.py
OpenStackCheck.get_scoped_project
def get_scoped_project(self, project_auth_scope): """ Returns the project that this instance of the check is scoped to """ filter_params = {} url = "{0}/{1}/{2}".format(self.keystone_server_url, DEFAULT_KEYSTONE_API_VERSION, "projects") if project_auth_scope.tenant_id: ...
python
def get_scoped_project(self, project_auth_scope): """ Returns the project that this instance of the check is scoped to """ filter_params = {} url = "{0}/{1}/{2}".format(self.keystone_server_url, DEFAULT_KEYSTONE_API_VERSION, "projects") if project_auth_scope.tenant_id: ...
[ "def", "get_scoped_project", "(", "self", ",", "project_auth_scope", ")", ":", "filter_params", "=", "{", "}", "url", "=", "\"{0}/{1}/{2}\"", ".", "format", "(", "self", ".", "keystone_server_url", ",", "DEFAULT_KEYSTONE_API_VERSION", ",", "\"projects\"", ")", "if...
Returns the project that this instance of the check is scoped to
[ "Returns", "the", "project", "that", "this", "instance", "of", "the", "check", "is", "scoped", "to" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack/datadog_checks/openstack/openstack.py#L1339-L1372
train
Returns the project that this check is scoped to
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/datadog_checks/openstack/openstack.py
OpenStackCheck.get_my_hostname
def get_my_hostname(self, split_hostname_on_first_period=False): """ Returns a best guess for the hostname registered with OpenStack for this host """ hostname = self.init_config.get("os_host") or self.hostname if split_hostname_on_first_period: hostname = hostname.s...
python
def get_my_hostname(self, split_hostname_on_first_period=False): """ Returns a best guess for the hostname registered with OpenStack for this host """ hostname = self.init_config.get("os_host") or self.hostname if split_hostname_on_first_period: hostname = hostname.s...
[ "def", "get_my_hostname", "(", "self", ",", "split_hostname_on_first_period", "=", "False", ")", ":", "hostname", "=", "self", ".", "init_config", ".", "get", "(", "\"os_host\"", ")", "or", "self", ".", "hostname", "if", "split_hostname_on_first_period", ":", "h...
Returns a best guess for the hostname registered with OpenStack for this host
[ "Returns", "a", "best", "guess", "for", "the", "hostname", "registered", "with", "OpenStack", "for", "this", "host" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack/datadog_checks/openstack/openstack.py#L1374-L1383
train
Returns a best guess for the hostname registered with OpenStack for this host.
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/datadog_checks/openstack/openstack.py
OpenStackCheck.get_external_host_tags
def get_external_host_tags(self): """ Returns a list of tags for every guest server that is detected by the OpenStack integration. List of pairs (hostname, list_of_tags) """ self.log.debug("Collecting external_host_tags now") external_host_tags = [] for k, v in it...
python
def get_external_host_tags(self): """ Returns a list of tags for every guest server that is detected by the OpenStack integration. List of pairs (hostname, list_of_tags) """ self.log.debug("Collecting external_host_tags now") external_host_tags = [] for k, v in it...
[ "def", "get_external_host_tags", "(", "self", ")", ":", "self", ".", "log", ".", "debug", "(", "\"Collecting external_host_tags now\"", ")", "external_host_tags", "=", "[", "]", "for", "k", ",", "v", "in", "iteritems", "(", "self", ".", "external_host_tags", "...
Returns a list of tags for every guest server that is detected by the OpenStack integration. List of pairs (hostname, list_of_tags)
[ "Returns", "a", "list", "of", "tags", "for", "every", "guest", "server", "that", "is", "detected", "by", "the", "OpenStack", "integration", ".", "List", "of", "pairs", "(", "hostname", "list_of_tags", ")" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack/datadog_checks/openstack/openstack.py#L1416-L1427
train
Returns a list of pairs of hostname and list_of_tags
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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon.check
def check(self, instance): """Run the Docker check for one instance.""" if not self.init_success: # Initialization can fail if cgroups are not ready or docker daemon is down. So we retry if needed # https://github.com/DataDog/dd-agent/issues/1896 self.init() ...
python
def check(self, instance): """Run the Docker check for one instance.""" if not self.init_success: # Initialization can fail if cgroups are not ready or docker daemon is down. So we retry if needed # https://github.com/DataDog/dd-agent/issues/1896 self.init() ...
[ "def", "check", "(", "self", ",", "instance", ")", ":", "if", "not", "self", ".", "init_success", ":", "# Initialization can fail if cgroups are not ready or docker daemon is down. So we retry if needed", "# https://github.com/DataDog/dd-agent/issues/1896", "self", ".", "init", ...
Run the Docker check for one instance.
[ "Run", "the", "Docker", "check", "for", "one", "instance", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L287-L357
train
Run the Docker check for one 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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._get_and_count_containers
def _get_and_count_containers(self, custom_cgroups=False, healthchecks=False): """List all the containers from the API, filter and count them.""" # Querying the size of containers is slow, we don't do it at each run must_query_size = self.collect_container_size and self._latest_size_query == 0 ...
python
def _get_and_count_containers(self, custom_cgroups=False, healthchecks=False): """List all the containers from the API, filter and count them.""" # Querying the size of containers is slow, we don't do it at each run must_query_size = self.collect_container_size and self._latest_size_query == 0 ...
[ "def", "_get_and_count_containers", "(", "self", ",", "custom_cgroups", "=", "False", ",", "healthchecks", "=", "False", ")", ":", "# Querying the size of containers is slow, we don't do it at each run", "must_query_size", "=", "self", ".", "collect_container_size", "and", ...
List all the containers from the API, filter and count them.
[ "List", "all", "the", "containers", "from", "the", "API", "filter", "and", "count", "them", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L375-L442
train
List all the containers from the API filter and count them.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._get_tags
def _get_tags(self, entity=None, tag_type=None): """Generate the tags for a given entity (container or image) according to a list of tag names.""" # Start with custom tags tags = list(self.custom_tags) # Collect pod names as tags on kubernetes if Platform.is_k8s() and KubeUtil.P...
python
def _get_tags(self, entity=None, tag_type=None): """Generate the tags for a given entity (container or image) according to a list of tag names.""" # Start with custom tags tags = list(self.custom_tags) # Collect pod names as tags on kubernetes if Platform.is_k8s() and KubeUtil.P...
[ "def", "_get_tags", "(", "self", ",", "entity", "=", "None", ",", "tag_type", "=", "None", ")", ":", "# Start with custom tags", "tags", "=", "list", "(", "self", ".", "custom_tags", ")", "# Collect pod names as tags on kubernetes", "if", "Platform", ".", "is_k8...
Generate the tags for a given entity (container or image) according to a list of tag names.
[ "Generate", "the", "tags", "for", "a", "given", "entity", "(", "container", "or", "image", ")", "according", "to", "a", "list", "of", "tag", "names", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L452-L539
train
Generate the tags for a given entity according to a list of tag names.
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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._extract_tag_value
def _extract_tag_value(self, entity, tag_name): """Extra tag information from the API result (containers or images). Cache extracted tags inside the entity object. """ if tag_name not in TAG_EXTRACTORS: self.warning("{0} isn't a supported tag".format(tag_name)) re...
python
def _extract_tag_value(self, entity, tag_name): """Extra tag information from the API result (containers or images). Cache extracted tags inside the entity object. """ if tag_name not in TAG_EXTRACTORS: self.warning("{0} isn't a supported tag".format(tag_name)) re...
[ "def", "_extract_tag_value", "(", "self", ",", "entity", ",", "tag_name", ")", ":", "if", "tag_name", "not", "in", "TAG_EXTRACTORS", ":", "self", ".", "warning", "(", "\"{0} isn't a supported tag\"", ".", "format", "(", "tag_name", ")", ")", "return", "# Check...
Extra tag information from the API result (containers or images). Cache extracted tags inside the entity object.
[ "Extra", "tag", "information", "from", "the", "API", "result", "(", "containers", "or", "images", ")", ".", "Cache", "extracted", "tags", "inside", "the", "entity", "object", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L541-L556
train
Extract the value of a tag from the API result.
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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._is_container_excluded
def _is_container_excluded(self, container): """Check if a container is excluded according to the filter rules. Requires _filter_containers to run first. """ container_name = DockerUtil.container_name_extractor(container)[0] return container_name in self._filtered_containers
python
def _is_container_excluded(self, container): """Check if a container is excluded according to the filter rules. Requires _filter_containers to run first. """ container_name = DockerUtil.container_name_extractor(container)[0] return container_name in self._filtered_containers
[ "def", "_is_container_excluded", "(", "self", ",", "container", ")", ":", "container_name", "=", "DockerUtil", ".", "container_name_extractor", "(", "container", ")", "[", "0", "]", "return", "container_name", "in", "self", ".", "_filtered_containers" ]
Check if a container is excluded according to the filter rules. Requires _filter_containers to run first.
[ "Check", "if", "a", "container", "is", "excluded", "according", "to", "the", "filter", "rules", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L571-L577
train
Check if a container is excluded according to the filter rules.
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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._send_container_healthcheck_sc
def _send_container_healthcheck_sc(self, containers_by_id): """Send health service checks for containers.""" for container in containers_by_id.itervalues(): healthcheck_tags = self._get_tags(container, HEALTHCHECK) match = False for tag in healthcheck_tags: ...
python
def _send_container_healthcheck_sc(self, containers_by_id): """Send health service checks for containers.""" for container in containers_by_id.itervalues(): healthcheck_tags = self._get_tags(container, HEALTHCHECK) match = False for tag in healthcheck_tags: ...
[ "def", "_send_container_healthcheck_sc", "(", "self", ",", "containers_by_id", ")", ":", "for", "container", "in", "containers_by_id", ".", "itervalues", "(", ")", ":", "healthcheck_tags", "=", "self", ".", "_get_tags", "(", "container", ",", "HEALTHCHECK", ")", ...
Send health service checks for containers.
[ "Send", "health", "service", "checks", "for", "containers", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L594-L608
train
Send health service checks for containers.
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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._report_container_count
def _report_container_count(self, containers_by_id): """Report container count per state""" m_func = FUNC_MAP[GAUGE][self.use_histogram] per_state_count = defaultdict(int) filterlambda = lambda ctr: not self._is_container_excluded(ctr) containers = list(filter(filterlambda, con...
python
def _report_container_count(self, containers_by_id): """Report container count per state""" m_func = FUNC_MAP[GAUGE][self.use_histogram] per_state_count = defaultdict(int) filterlambda = lambda ctr: not self._is_container_excluded(ctr) containers = list(filter(filterlambda, con...
[ "def", "_report_container_count", "(", "self", ",", "containers_by_id", ")", ":", "m_func", "=", "FUNC_MAP", "[", "GAUGE", "]", "[", "self", ".", "use_histogram", "]", "per_state_count", "=", "defaultdict", "(", "int", ")", "filterlambda", "=", "lambda", "ctr"...
Report container count per state
[ "Report", "container", "count", "per", "state" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L623-L637
train
Report the number of containers in each 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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._report_volume_count
def _report_volume_count(self): """Report volume count per state (dangling or not)""" m_func = FUNC_MAP[GAUGE][self.use_histogram] attached_volumes = self.docker_util.client.volumes(filters={'dangling': False}) dangling_volumes = self.docker_util.client.volumes(filters={'dangling': True...
python
def _report_volume_count(self): """Report volume count per state (dangling or not)""" m_func = FUNC_MAP[GAUGE][self.use_histogram] attached_volumes = self.docker_util.client.volumes(filters={'dangling': False}) dangling_volumes = self.docker_util.client.volumes(filters={'dangling': True...
[ "def", "_report_volume_count", "(", "self", ")", ":", "m_func", "=", "FUNC_MAP", "[", "GAUGE", "]", "[", "self", ".", "use_histogram", "]", "attached_volumes", "=", "self", ".", "docker_util", ".", "client", ".", "volumes", "(", "filters", "=", "{", "'dang...
Report volume count per state (dangling or not)
[ "Report", "volume", "count", "per", "state", "(", "dangling", "or", "not", ")" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L639-L648
train
Report volume count per state ( attached or not
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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._report_net_metrics
def _report_net_metrics(self, container, tags): """Find container network metrics by looking at /proc/$PID/net/dev of the container process.""" if self._disable_net_metrics: self.log.debug("Network metrics are disabled. Skipping") return proc_net_file = os.path.join(cont...
python
def _report_net_metrics(self, container, tags): """Find container network metrics by looking at /proc/$PID/net/dev of the container process.""" if self._disable_net_metrics: self.log.debug("Network metrics are disabled. Skipping") return proc_net_file = os.path.join(cont...
[ "def", "_report_net_metrics", "(", "self", ",", "container", ",", "tags", ")", ":", "if", "self", ".", "_disable_net_metrics", ":", "self", ".", "log", ".", "debug", "(", "\"Network metrics are disabled. Skipping\"", ")", "return", "proc_net_file", "=", "os", "....
Find container network metrics by looking at /proc/$PID/net/dev of the container process.
[ "Find", "container", "network", "metrics", "by", "looking", "at", "/", "proc", "/", "$PID", "/", "net", "/", "dev", "of", "the", "container", "process", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L722-L764
train
Report the network metrics for the container.
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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._get_events
def _get_events(self): """Get the list of events.""" events, changed_container_ids = self.docker_util.get_events() if not self._disable_net_metrics: self._invalidate_network_mapping_cache(events) if changed_container_ids and self._service_discovery: get_sd_backend...
python
def _get_events(self): """Get the list of events.""" events, changed_container_ids = self.docker_util.get_events() if not self._disable_net_metrics: self._invalidate_network_mapping_cache(events) if changed_container_ids and self._service_discovery: get_sd_backend...
[ "def", "_get_events", "(", "self", ")", ":", "events", ",", "changed_container_ids", "=", "self", ".", "docker_util", ".", "get_events", "(", ")", "if", "not", "self", ".", "_disable_net_metrics", ":", "self", ".", "_invalidate_network_mapping_cache", "(", "even...
Get the list of events.
[ "Get", "the", "list", "of", "events", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L799-L808
train
Get the list of events.
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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._create_dd_event
def _create_dd_event(self, events, image, c_tags, priority='Normal'): """Create the actual event to submit from a list of similar docker events""" if not events: return max_timestamp = 0 status = defaultdict(int) status_change = [] for ev, c_name in events: ...
python
def _create_dd_event(self, events, image, c_tags, priority='Normal'): """Create the actual event to submit from a list of similar docker events""" if not events: return max_timestamp = 0 status = defaultdict(int) status_change = [] for ev, c_name in events: ...
[ "def", "_create_dd_event", "(", "self", ",", "events", ",", "image", ",", "c_tags", ",", "priority", "=", "'Normal'", ")", ":", "if", "not", "events", ":", "return", "max_timestamp", "=", "0", "status", "=", "defaultdict", "(", "int", ")", "status_change",...
Create the actual event to submit from a list of similar docker events
[ "Create", "the", "actual", "event", "to", "submit", "from", "a", "list", "of", "similar", "docker", "events" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L883-L928
train
Create the actual event to submit from a list of similar docker events
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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._report_disk_stats
def _report_disk_stats(self): """Report metrics about the volume space usage""" stats = { 'docker.data.used': None, 'docker.data.total': None, 'docker.data.free': None, 'docker.metadata.used': None, 'docker.metadata.total': None, 'd...
python
def _report_disk_stats(self): """Report metrics about the volume space usage""" stats = { 'docker.data.used': None, 'docker.data.total': None, 'docker.data.free': None, 'docker.metadata.used': None, 'docker.metadata.total': None, 'd...
[ "def", "_report_disk_stats", "(", "self", ")", ":", "stats", "=", "{", "'docker.data.used'", ":", "None", ",", "'docker.data.total'", ":", "None", ",", "'docker.data.free'", ":", "None", ",", "'docker.metadata.used'", ":", "None", ",", "'docker.metadata.total'", "...
Report metrics about the volume space usage
[ "Report", "metrics", "about", "the", "volume", "space", "usage" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L930-L968
train
Report metrics about the disk usage
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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._format_disk_metrics
def _format_disk_metrics(self, metrics): """Cast the disk stats to float and convert them to bytes""" for name, raw_val in metrics.iteritems(): if raw_val: match = DISK_STATS_RE.search(raw_val) if match is None or len(match.groups()) != 2: ...
python
def _format_disk_metrics(self, metrics): """Cast the disk stats to float and convert them to bytes""" for name, raw_val in metrics.iteritems(): if raw_val: match = DISK_STATS_RE.search(raw_val) if match is None or len(match.groups()) != 2: ...
[ "def", "_format_disk_metrics", "(", "self", ",", "metrics", ")", ":", "for", "name", ",", "raw_val", "in", "metrics", ".", "iteritems", "(", ")", ":", "if", "raw_val", ":", "match", "=", "DISK_STATS_RE", ".", "search", "(", "raw_val", ")", "if", "match",...
Cast the disk stats to float and convert them to bytes
[ "Cast", "the", "disk", "stats", "to", "float", "and", "convert", "them", "to", "bytes" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L970-L987
train
Cast the disk stats to float and convert them to bytes
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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._calc_percent_disk_stats
def _calc_percent_disk_stats(self, stats): """Calculate a percentage of used disk space for data and metadata""" mtypes = ['data', 'metadata'] percs = {} for mtype in mtypes: used = stats.get('docker.{0}.used'.format(mtype)) total = stats.get('docker.{0}.total'.fo...
python
def _calc_percent_disk_stats(self, stats): """Calculate a percentage of used disk space for data and metadata""" mtypes = ['data', 'metadata'] percs = {} for mtype in mtypes: used = stats.get('docker.{0}.used'.format(mtype)) total = stats.get('docker.{0}.total'.fo...
[ "def", "_calc_percent_disk_stats", "(", "self", ",", "stats", ")", ":", "mtypes", "=", "[", "'data'", ",", "'metadata'", "]", "percs", "=", "{", "}", "for", "mtype", "in", "mtypes", ":", "used", "=", "stats", ".", "get", "(", "'docker.{0}.used'", ".", ...
Calculate a percentage of used disk space for data and metadata
[ "Calculate", "a", "percentage", "of", "used", "disk", "space", "for", "data", "and", "metadata" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L989-L1010
train
Calculate a percentage of used disk space for data and metadata
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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._get_cgroup_from_proc
def _get_cgroup_from_proc(self, cgroup, pid, filename): """Find a specific cgroup file, containing metrics to extract.""" params = { "file": filename, } return DockerUtil.find_cgroup_from_proc(self._mountpoints, pid, cgroup, self.docker_util._docker_root) % (params)
python
def _get_cgroup_from_proc(self, cgroup, pid, filename): """Find a specific cgroup file, containing metrics to extract.""" params = { "file": filename, } return DockerUtil.find_cgroup_from_proc(self._mountpoints, pid, cgroup, self.docker_util._docker_root) % (params)
[ "def", "_get_cgroup_from_proc", "(", "self", ",", "cgroup", ",", "pid", ",", "filename", ")", ":", "params", "=", "{", "\"file\"", ":", "filename", ",", "}", "return", "DockerUtil", ".", "find_cgroup_from_proc", "(", "self", ".", "_mountpoints", ",", "pid", ...
Find a specific cgroup file, containing metrics to extract.
[ "Find", "a", "specific", "cgroup", "file", "containing", "metrics", "to", "extract", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L1013-L1018
train
Find a specific cgroup file containing metrics to extract.
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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._parse_cgroup_file
def _parse_cgroup_file(self, stat_file): """Parse a cgroup pseudo file for key/values.""" self.log.debug("Opening cgroup file: %s" % stat_file) try: with open(stat_file, 'r') as fp: if 'blkio' in stat_file: return self._parse_blkio_metrics(fp.read(...
python
def _parse_cgroup_file(self, stat_file): """Parse a cgroup pseudo file for key/values.""" self.log.debug("Opening cgroup file: %s" % stat_file) try: with open(stat_file, 'r') as fp: if 'blkio' in stat_file: return self._parse_blkio_metrics(fp.read(...
[ "def", "_parse_cgroup_file", "(", "self", ",", "stat_file", ")", ":", "self", ".", "log", ".", "debug", "(", "\"Opening cgroup file: %s\"", "%", "stat_file", ")", "try", ":", "with", "open", "(", "stat_file", ",", "'r'", ")", "as", "fp", ":", "if", "'blk...
Parse a cgroup pseudo file for key/values.
[ "Parse", "a", "cgroup", "pseudo", "file", "for", "key", "/", "values", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L1020-L1044
train
Parse a cgroup pseudo file for key - value 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
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._parse_blkio_metrics
def _parse_blkio_metrics(self, stats): """Parse the blkio metrics.""" metrics = { 'io_read': 0, 'io_write': 0, } for line in stats: if 'Read' in line: metrics['io_read'] += int(line.split()[2]) if 'Write' in line: ...
python
def _parse_blkio_metrics(self, stats): """Parse the blkio metrics.""" metrics = { 'io_read': 0, 'io_write': 0, } for line in stats: if 'Read' in line: metrics['io_read'] += int(line.split()[2]) if 'Write' in line: ...
[ "def", "_parse_blkio_metrics", "(", "self", ",", "stats", ")", ":", "metrics", "=", "{", "'io_read'", ":", "0", ",", "'io_write'", ":", "0", ",", "}", "for", "line", "in", "stats", ":", "if", "'Read'", "in", "line", ":", "metrics", "[", "'io_read'", ...
Parse the blkio metrics.
[ "Parse", "the", "blkio", "metrics", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L1046-L1057
train
Parse the blkio metrics.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
docker_daemon/datadog_checks/docker_daemon/docker_daemon.py
DockerDaemon._crawl_container_pids
def _crawl_container_pids(self, container_dict, custom_cgroups=False): """Crawl `/proc` to find container PIDs and add them to `containers_by_id`.""" proc_path = os.path.join(self.docker_util._docker_root, 'proc') pid_dirs = [_dir for _dir in os.listdir(proc_path) if _dir.isdigit()] if ...
python
def _crawl_container_pids(self, container_dict, custom_cgroups=False): """Crawl `/proc` to find container PIDs and add them to `containers_by_id`.""" proc_path = os.path.join(self.docker_util._docker_root, 'proc') pid_dirs = [_dir for _dir in os.listdir(proc_path) if _dir.isdigit()] if ...
[ "def", "_crawl_container_pids", "(", "self", ",", "container_dict", ",", "custom_cgroups", "=", "False", ")", ":", "proc_path", "=", "os", ".", "path", ".", "join", "(", "self", ".", "docker_util", ".", "_docker_root", ",", "'proc'", ")", "pid_dirs", "=", ...
Crawl `/proc` to find container PIDs and add them to `containers_by_id`.
[ "Crawl", "/", "proc", "to", "find", "container", "PIDs", "and", "add", "them", "to", "containers_by_id", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/docker_daemon/datadog_checks/docker_daemon/docker_daemon.py#L1073-L1134
train
Crawl proc to find container PIDs and add them to containers_by_id.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/env/start.py
start
def start(ctx, check, env, agent, dev, base, env_vars): """Start an environment.""" if not file_exists(get_tox_file(check)): abort('`{}` is not a testable check.'.format(check)) base_package = None if base: core_dir = os.path.expanduser(ctx.obj.get('core', '')) if not dir_exists...
python
def start(ctx, check, env, agent, dev, base, env_vars): """Start an environment.""" if not file_exists(get_tox_file(check)): abort('`{}` is not a testable check.'.format(check)) base_package = None if base: core_dir = os.path.expanduser(ctx.obj.get('core', '')) if not dir_exists...
[ "def", "start", "(", "ctx", ",", "check", ",", "env", ",", "agent", ",", "dev", ",", "base", ",", "env_vars", ")", ":", "if", "not", "file_exists", "(", "get_tox_file", "(", "check", ")", ")", ":", "abort", "(", "'`{}` is not a testable check.'", ".", ...
Start an environment.
[ "Start", "an", "environment", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/env/start.py#L42-L208
train
Start an environment.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
openstack_controller/datadog_checks/openstack_controller/api.py
SimpleApi._make_request
def _make_request(self, url, headers, params=None): """ Generic request handler for OpenStack API requests Raises specialized Exceptions for commonly encountered error codes """ self.logger.debug("Request URL, Headers and Params: %s, %s, %s", url, headers, params) # Chec...
python
def _make_request(self, url, headers, params=None): """ Generic request handler for OpenStack API requests Raises specialized Exceptions for commonly encountered error codes """ self.logger.debug("Request URL, Headers and Params: %s, %s, %s", url, headers, params) # Chec...
[ "def", "_make_request", "(", "self", ",", "url", ",", "headers", ",", "params", "=", "None", ")", ":", "self", ".", "logger", ".", "debug", "(", "\"Request URL, Headers and Params: %s, %s, %s\"", ",", "url", ",", "headers", ",", "params", ")", "# Checking if r...
Generic request handler for OpenStack API requests Raises specialized Exceptions for commonly encountered error codes
[ "Generic", "request", "handler", "for", "OpenStack", "API", "requests", "Raises", "specialized", "Exceptions", "for", "commonly", "encountered", "error", "codes" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack_controller/datadog_checks/openstack_controller/api.py#L296-L331
train
Generic request handler for OpenStack API requests
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/api.py
SimpleApi.get_projects
def get_projects(self): """ Returns all projects in the domain """ url = urljoin(self.keystone_endpoint, "{}/{}".format(DEFAULT_KEYSTONE_API_VERSION, "projects")) try: r = self._make_request(url, self.headers) return r.get('projects', []) except E...
python
def get_projects(self): """ Returns all projects in the domain """ url = urljoin(self.keystone_endpoint, "{}/{}".format(DEFAULT_KEYSTONE_API_VERSION, "projects")) try: r = self._make_request(url, self.headers) return r.get('projects', []) except E...
[ "def", "get_projects", "(", "self", ")", ":", "url", "=", "urljoin", "(", "self", ".", "keystone_endpoint", ",", "\"{}/{}\"", ".", "format", "(", "DEFAULT_KEYSTONE_API_VERSION", ",", "\"projects\"", ")", ")", "try", ":", "r", "=", "self", ".", "_make_request...
Returns all projects in the domain
[ "Returns", "all", "projects", "in", "the", "domain" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack_controller/datadog_checks/openstack_controller/api.py#L422-L433
train
Returns all projects in the domain
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/api.py
Authenticator._get_user_identity
def _get_user_identity(user): """ Parse user identity out of init_config To guarantee a uniquely identifiable user, expects {"user": {"name": "my_username", "password": "my_password", "domain": {"id": "my_domain_id"} } } """ if...
python
def _get_user_identity(user): """ Parse user identity out of init_config To guarantee a uniquely identifiable user, expects {"user": {"name": "my_username", "password": "my_password", "domain": {"id": "my_domain_id"} } } """ if...
[ "def", "_get_user_identity", "(", "user", ")", ":", "if", "not", "(", "user", "and", "user", ".", "get", "(", "'name'", ")", "and", "user", ".", "get", "(", "'password'", ")", "and", "user", ".", "get", "(", "\"domain\"", ")", "and", "user", ".", "...
Parse user identity out of init_config To guarantee a uniquely identifiable user, expects {"user": {"name": "my_username", "password": "my_password", "domain": {"id": "my_domain_id"} } }
[ "Parse", "user", "identity", "out", "of", "init_config" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack_controller/datadog_checks/openstack_controller/api.py#L556-L572
train
Parse user identity out of init_config and return it as dict
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/api.py
Authenticator._get_neutron_endpoint
def _get_neutron_endpoint(cls, json_resp): """ Parse the service catalog returned by the Identity API for an endpoint matching the Neutron service Sends a CRITICAL service check when none are found registered in the Catalog """ valid_endpoint = cls._get_valid_endpoint(json_resp, ...
python
def _get_neutron_endpoint(cls, json_resp): """ Parse the service catalog returned by the Identity API for an endpoint matching the Neutron service Sends a CRITICAL service check when none are found registered in the Catalog """ valid_endpoint = cls._get_valid_endpoint(json_resp, ...
[ "def", "_get_neutron_endpoint", "(", "cls", ",", "json_resp", ")", ":", "valid_endpoint", "=", "cls", ".", "_get_valid_endpoint", "(", "json_resp", ",", "'neutron'", ",", "'network'", ")", "if", "valid_endpoint", ":", "return", "valid_endpoint", "raise", "MissingN...
Parse the service catalog returned by the Identity API for an endpoint matching the Neutron service Sends a CRITICAL service check when none are found registered in the Catalog
[ "Parse", "the", "service", "catalog", "returned", "by", "the", "Identity", "API", "for", "an", "endpoint", "matching", "the", "Neutron", "service", "Sends", "a", "CRITICAL", "service", "check", "when", "none", "are", "found", "registered", "in", "the", "Catalo...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack_controller/datadog_checks/openstack_controller/api.py#L575-L583
train
Parse the JSON response from the Neutron Identity API and return the endpoint that is valid
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/api.py
Authenticator._get_nova_endpoint
def _get_nova_endpoint(cls, json_resp): """ Parse the service catalog returned by the Identity API for an endpoint matching the Nova service with the requested version Sends a CRITICAL service check when no viable candidates are found in the Catalog """ valid_endpoint = c...
python
def _get_nova_endpoint(cls, json_resp): """ Parse the service catalog returned by the Identity API for an endpoint matching the Nova service with the requested version Sends a CRITICAL service check when no viable candidates are found in the Catalog """ valid_endpoint = c...
[ "def", "_get_nova_endpoint", "(", "cls", ",", "json_resp", ")", ":", "valid_endpoint", "=", "cls", ".", "_get_valid_endpoint", "(", "json_resp", ",", "'nova'", ",", "'compute'", ")", "if", "valid_endpoint", ":", "return", "valid_endpoint", "raise", "MissingNovaEnd...
Parse the service catalog returned by the Identity API for an endpoint matching the Nova service with the requested version Sends a CRITICAL service check when no viable candidates are found in the Catalog
[ "Parse", "the", "service", "catalog", "returned", "by", "the", "Identity", "API", "for", "an", "endpoint", "matching", "the", "Nova", "service", "with", "the", "requested", "version", "Sends", "a", "CRITICAL", "service", "check", "when", "no", "viable", "candi...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack_controller/datadog_checks/openstack_controller/api.py#L586-L595
train
Parse the Nova service catalog response and return the endpoint that matches the requested 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
openstack_controller/datadog_checks/openstack_controller/api.py
Authenticator._get_valid_endpoint
def _get_valid_endpoint(resp, name, entry_type): """ Parse the service catalog returned by the Identity API for an endpoint matching the Nova service with the requested version Sends a CRITICAL service check when no viable candidates are found in the Catalog """ catalog =...
python
def _get_valid_endpoint(resp, name, entry_type): """ Parse the service catalog returned by the Identity API for an endpoint matching the Nova service with the requested version Sends a CRITICAL service check when no viable candidates are found in the Catalog """ catalog =...
[ "def", "_get_valid_endpoint", "(", "resp", ",", "name", ",", "entry_type", ")", ":", "catalog", "=", "resp", ".", "get", "(", "'token'", ",", "{", "}", ")", ".", "get", "(", "'catalog'", ",", "[", "]", ")", "for", "entry", "in", "catalog", ":", "if...
Parse the service catalog returned by the Identity API for an endpoint matching the Nova service with the requested version Sends a CRITICAL service check when no viable candidates are found in the Catalog
[ "Parse", "the", "service", "catalog", "returned", "by", "the", "Identity", "API", "for", "an", "endpoint", "matching", "the", "Nova", "service", "with", "the", "requested", "version", "Sends", "a", "CRITICAL", "service", "check", "when", "no", "viable", "candi...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/openstack_controller/datadog_checks/openstack_controller/api.py#L598-L623
train
Parse the response from the Identity API to find the endpoint that is valid for the requested version of the service
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/dep.py
dep
def dep(): """ This command will: * Verify the uniqueness of dependency versions across all checks. * Verify all the dependencies are pinned. * Verify the embedded Python environment defined in the base check and requirements listed in every integration are compatible. """ failed = Fa...
python
def dep(): """ This command will: * Verify the uniqueness of dependency versions across all checks. * Verify all the dependencies are pinned. * Verify the embedded Python environment defined in the base check and requirements listed in every integration are compatible. """ failed = Fa...
[ "def", "dep", "(", ")", ":", "failed", "=", "False", "catalog", ",", "errors", "=", "make_catalog", "(", ")", "# Check unpinned", "if", "errors", ":", "for", "error", "in", "errors", ":", "echo_failure", "(", "error", ")", "failed", "=", "True", "# Check...
This command will: * Verify the uniqueness of dependency versions across all checks. * Verify all the dependencies are pinned. * Verify the embedded Python environment defined in the base check and requirements listed in every integration are compatible.
[ "This", "command", "will", ":" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/dep.py#L31-L96
train
This command checks if all the dependencies of the base check are compatible.
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/meta/prometheus.py
info
def info(endpoint): """Show metric info from a Prometheus endpoint. \b Example: $ ddev meta prom info :8080/_status/vars """ endpoint = sanitize_endpoint(endpoint) metrics = parse_metrics(endpoint) num_metrics = len(metrics) num_gauge = 0 num_counter = 0 num_histogram = 0 ...
python
def info(endpoint): """Show metric info from a Prometheus endpoint. \b Example: $ ddev meta prom info :8080/_status/vars """ endpoint = sanitize_endpoint(endpoint) metrics = parse_metrics(endpoint) num_metrics = len(metrics) num_gauge = 0 num_counter = 0 num_histogram = 0 ...
[ "def", "info", "(", "endpoint", ")", ":", "endpoint", "=", "sanitize_endpoint", "(", "endpoint", ")", "metrics", "=", "parse_metrics", "(", "endpoint", ")", "num_metrics", "=", "len", "(", "metrics", ")", "num_gauge", "=", "0", "num_counter", "=", "0", "nu...
Show metric info from a Prometheus endpoint. \b Example: $ ddev meta prom info :8080/_status/vars
[ "Show", "metric", "info", "from", "a", "Prometheus", "endpoint", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/prometheus.py#L66-L104
train
Show metric info from a Prometheus endpoint.
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/meta/prometheus.py
parse
def parse(ctx, endpoint, check, here): """Interactively parse metric info from a Prometheus endpoint.""" if here: output_dir = os.getcwd() else: output_dir = path_join(get_root(), check) if not dir_exists(output_dir): abort( 'Check `{check}` does not exist...
python
def parse(ctx, endpoint, check, here): """Interactively parse metric info from a Prometheus endpoint.""" if here: output_dir = os.getcwd() else: output_dir = path_join(get_root(), check) if not dir_exists(output_dir): abort( 'Check `{check}` does not exist...
[ "def", "parse", "(", "ctx", ",", "endpoint", ",", "check", ",", "here", ")", ":", "if", "here", ":", "output_dir", "=", "os", ".", "getcwd", "(", ")", "else", ":", "output_dir", "=", "path_join", "(", "get_root", "(", ")", ",", "check", ")", "if", ...
Interactively parse metric info from a Prometheus endpoint.
[ "Interactively", "parse", "metric", "info", "from", "a", "Prometheus", "endpoint", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/meta/prometheus.py#L114-L251
train
Interactively parse metric info from a Prometheus endpoint.
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/operations.py
DeleteMany._add_to_bulk
def _add_to_bulk(self, bulkobj): """Add this operation to the _Bulk instance `bulkobj`.""" bulkobj.add_delete(self._filter, 0, collation=self._collation)
python
def _add_to_bulk(self, bulkobj): """Add this operation to the _Bulk instance `bulkobj`.""" bulkobj.add_delete(self._filter, 0, collation=self._collation)
[ "def", "_add_to_bulk", "(", "self", ",", "bulkobj", ")", ":", "bulkobj", ".", "add_delete", "(", "self", ".", "_filter", ",", "0", ",", "collation", "=", "self", ".", "_collation", ")" ]
Add this operation to the _Bulk instance `bulkobj`.
[ "Add", "this", "operation", "to", "the", "_Bulk", "instance", "bulkobj", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/operations.py#L119-L121
train
Add this operation to the _Bulk instance bulkobj.
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/operations.py
ReplaceOne._add_to_bulk
def _add_to_bulk(self, bulkobj): """Add this operation to the _Bulk instance `bulkobj`.""" bulkobj.add_replace(self._filter, self._doc, self._upsert, collation=self._collation)
python
def _add_to_bulk(self, bulkobj): """Add this operation to the _Bulk instance `bulkobj`.""" bulkobj.add_replace(self._filter, self._doc, self._upsert, collation=self._collation)
[ "def", "_add_to_bulk", "(", "self", ",", "bulkobj", ")", ":", "bulkobj", ".", "add_replace", "(", "self", ".", "_filter", ",", "self", ".", "_doc", ",", "self", ".", "_upsert", ",", "collation", "=", "self", ".", "_collation", ")" ]
Add this operation to the _Bulk instance `bulkobj`.
[ "Add", "this", "operation", "to", "the", "_Bulk", "instance", "bulkobj", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/operations.py#L192-L195
train
Add this operation to the _Bulk instance bulkobj.
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/operations.py
UpdateOne._add_to_bulk
def _add_to_bulk(self, bulkobj): """Add this operation to the _Bulk instance `bulkobj`.""" bulkobj.add_update(self._filter, self._doc, False, self._upsert, collation=self._collation)
python
def _add_to_bulk(self, bulkobj): """Add this operation to the _Bulk instance `bulkobj`.""" bulkobj.add_update(self._filter, self._doc, False, self._upsert, collation=self._collation)
[ "def", "_add_to_bulk", "(", "self", ",", "bulkobj", ")", ":", "bulkobj", ".", "add_update", "(", "self", ".", "_filter", ",", "self", ".", "_doc", ",", "False", ",", "self", ".", "_upsert", ",", "collation", "=", "self", ".", "_collation", ")" ]
Add this operation to the _Bulk instance `bulkobj`.
[ "Add", "this", "operation", "to", "the", "_Bulk", "instance", "bulkobj", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/operations.py#L222-L225
train
Add this operation to the _Bulk instance bulkobj.
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/ssl_context.py
SSLContext.load_cert_chain
def load_cert_chain(self, certfile, keyfile=None): """Load a private key and the corresponding certificate. The certfile string must be the path to a single file in PEM format containing the certificate as well as any number of CA certificates needed to establish the certificate's authen...
python
def load_cert_chain(self, certfile, keyfile=None): """Load a private key and the corresponding certificate. The certfile string must be the path to a single file in PEM format containing the certificate as well as any number of CA certificates needed to establish the certificate's authen...
[ "def", "load_cert_chain", "(", "self", ",", "certfile", ",", "keyfile", "=", "None", ")", ":", "self", ".", "_certfile", "=", "certfile", "self", ".", "_keyfile", "=", "keyfile" ]
Load a private key and the corresponding certificate. The certfile string must be the path to a single file in PEM format containing the certificate as well as any number of CA certificates needed to establish the certificate's authenticity. The keyfile string, if present, must point to ...
[ "Load", "a", "private", "key", "and", "the", "corresponding", "certificate", ".", "The", "certfile", "string", "must", "be", "the", "path", "to", "a", "single", "file", "in", "PEM", "format", "containing", "the", "certificate", "as", "well", "as", "any", "...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/ssl_context.py#L65-L74
train
Load a private key and the corresponding certificate.
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/ssl_context.py
SSLContext.wrap_socket
def wrap_socket(self, sock, server_side=False, do_handshake_on_connect=True, suppress_ragged_eofs=True, dummy=None): """Wrap an existing Python socket sock and return an ssl.SSLSocket object. """ return ssl.wrap_socket(sock, keyfile=self._keyfile, ...
python
def wrap_socket(self, sock, server_side=False, do_handshake_on_connect=True, suppress_ragged_eofs=True, dummy=None): """Wrap an existing Python socket sock and return an ssl.SSLSocket object. """ return ssl.wrap_socket(sock, keyfile=self._keyfile, ...
[ "def", "wrap_socket", "(", "self", ",", "sock", ",", "server_side", "=", "False", ",", "do_handshake_on_connect", "=", "True", ",", "suppress_ragged_eofs", "=", "True", ",", "dummy", "=", "None", ")", ":", "return", "ssl", ".", "wrap_socket", "(", "sock", ...
Wrap an existing Python socket sock and return an ssl.SSLSocket object.
[ "Wrap", "an", "existing", "Python", "socket", "sock", "and", "return", "an", "ssl", ".", "SSLSocket", "object", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/ssl_context.py#L83-L96
train
Wrap an existing Python socket sock and return an ssl. SSLSocket object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/utils/prometheus/functions.py
parse_metric_family
def parse_metric_family(buf): """ Parse the binary buffer in input, searching for Prometheus messages of type MetricFamily [0] delimited by a varint32 [1]. [0] https://github.com/prometheus/client_model/blob/086fe7ca28bde6cec2acd5223423c1475a362858/metrics.proto#L76-%20%20L81 # noqa: E501 [1] http...
python
def parse_metric_family(buf): """ Parse the binary buffer in input, searching for Prometheus messages of type MetricFamily [0] delimited by a varint32 [1]. [0] https://github.com/prometheus/client_model/blob/086fe7ca28bde6cec2acd5223423c1475a362858/metrics.proto#L76-%20%20L81 # noqa: E501 [1] http...
[ "def", "parse_metric_family", "(", "buf", ")", ":", "n", "=", "0", "while", "n", "<", "len", "(", "buf", ")", ":", "msg_len", ",", "new_pos", "=", "_DecodeVarint32", "(", "buf", ",", "n", ")", "n", "=", "new_pos", "msg_buf", "=", "buf", "[", "n", ...
Parse the binary buffer in input, searching for Prometheus messages of type MetricFamily [0] delimited by a varint32 [1]. [0] https://github.com/prometheus/client_model/blob/086fe7ca28bde6cec2acd5223423c1475a362858/metrics.proto#L76-%20%20L81 # noqa: E501 [1] https://developers.google.com/protocol-buffers...
[ "Parse", "the", "binary", "buffer", "in", "input", "searching", "for", "Prometheus", "messages", "of", "type", "MetricFamily", "[", "0", "]", "delimited", "by", "a", "varint32", "[", "1", "]", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/utils/prometheus/functions.py#L11-L28
train
Parse the Prometheus metric family from the binary buffer buf.
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
riakcs/datadog_checks/riakcs/riakcs.py
multidict
def multidict(ordered_pairs): """Convert duplicate keys values to lists.""" # read all values into lists d = defaultdict(list) for k, v in ordered_pairs: d[k].append(v) # unpack lists that have only 1 item dict_copy = deepcopy(d) for k, v in iteritems(dict_copy): if len(v) ==...
python
def multidict(ordered_pairs): """Convert duplicate keys values to lists.""" # read all values into lists d = defaultdict(list) for k, v in ordered_pairs: d[k].append(v) # unpack lists that have only 1 item dict_copy = deepcopy(d) for k, v in iteritems(dict_copy): if len(v) ==...
[ "def", "multidict", "(", "ordered_pairs", ")", ":", "# read all values into lists", "d", "=", "defaultdict", "(", "list", ")", "for", "k", ",", "v", "in", "ordered_pairs", ":", "d", "[", "k", "]", ".", "append", "(", "v", ")", "# unpack lists that have only ...
Convert duplicate keys values to lists.
[ "Convert", "duplicate", "keys", "values", "to", "lists", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/riakcs/datadog_checks/riakcs/riakcs.py#L16-L27
train
Convert duplicate keys values to lists.
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/requirements.py
read_packages
def read_packages(reqs_file): """ Generator yielding one Package instance for every corresponing line in a requirements file """ for line in stream_file_lines(reqs_file): line = line.strip() if not line.startswith(('#', '--hash')): match = DEP_PATTERN.match(line) ...
python
def read_packages(reqs_file): """ Generator yielding one Package instance for every corresponing line in a requirements file """ for line in stream_file_lines(reqs_file): line = line.strip() if not line.startswith(('#', '--hash')): match = DEP_PATTERN.match(line) ...
[ "def", "read_packages", "(", "reqs_file", ")", ":", "for", "line", "in", "stream_file_lines", "(", "reqs_file", ")", ":", "line", "=", "line", ".", "strip", "(", ")", "if", "not", "line", ".", "startswith", "(", "(", "'#'", ",", "'--hash'", ")", ")", ...
Generator yielding one Package instance for every corresponing line in a requirements file
[ "Generator", "yielding", "one", "Package", "instance", "for", "every", "corresponing", "line", "in", "a", "requirements", "file" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/requirements.py#L163-L174
train
Generator yielding one Package instance for every corresponing line in a requirements 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
datadog_checks_dev/datadog_checks/dev/tooling/requirements.py
PackageCatalog.write_packages
def write_packages(self, reqs_file): """ Dump the packages in the catalog in a requirements file """ write_file_lines(reqs_file, ('{}\n'.format(package) for package in self.packages))
python
def write_packages(self, reqs_file): """ Dump the packages in the catalog in a requirements file """ write_file_lines(reqs_file, ('{}\n'.format(package) for package in self.packages))
[ "def", "write_packages", "(", "self", ",", "reqs_file", ")", ":", "write_file_lines", "(", "reqs_file", ",", "(", "'{}\\n'", ".", "format", "(", "package", ")", "for", "package", "in", "self", ".", "packages", ")", ")" ]
Dump the packages in the catalog in a requirements file
[ "Dump", "the", "packages", "in", "the", "catalog", "in", "a", "requirements", "file" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/requirements.py#L119-L123
train
Dump the packages in the catalog in a requirements 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
datadog_checks_dev/datadog_checks/dev/tooling/requirements.py
PackageCatalog.add_package
def add_package(self, check_name, package): """ Add a Package to the catalog for the given check """ self._package_set.add(package) package_data = self._packages[package.name] self._checks_deps[check_name].append(package) # Versions if package.version: ...
python
def add_package(self, check_name, package): """ Add a Package to the catalog for the given check """ self._package_set.add(package) package_data = self._packages[package.name] self._checks_deps[check_name].append(package) # Versions if package.version: ...
[ "def", "add_package", "(", "self", ",", "check_name", ",", "package", ")", ":", "self", ".", "_package_set", ".", "add", "(", "package", ")", "package_data", "=", "self", ".", "_packages", "[", "package", ".", "name", "]", "self", ".", "_checks_deps", "[...
Add a Package to the catalog for the given check
[ "Add", "a", "Package", "to", "the", "catalog", "for", "the", "given", "check" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/requirements.py#L125-L141
train
Adds a Package to the catalog 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
kubernetes/datadog_checks/kubernetes/kubernetes.py
Kubernetes._update_container_metrics
def _update_container_metrics(self, instance, subcontainer, kube_labels): """Publish metrics for a subcontainer and handle filtering on tags""" tags = list(instance.get('tags', [])) # add support for custom tags if len(subcontainer.get('aliases', [])) >= 1: # The first alias seems ...
python
def _update_container_metrics(self, instance, subcontainer, kube_labels): """Publish metrics for a subcontainer and handle filtering on tags""" tags = list(instance.get('tags', [])) # add support for custom tags if len(subcontainer.get('aliases', [])) >= 1: # The first alias seems ...
[ "def", "_update_container_metrics", "(", "self", ",", "instance", ",", "subcontainer", ",", "kube_labels", ")", ":", "tags", "=", "list", "(", "instance", ".", "get", "(", "'tags'", ",", "[", "]", ")", ")", "# add support for custom tags", "if", "len", "(", ...
Publish metrics for a subcontainer and handle filtering on tags
[ "Publish", "metrics", "for", "a", "subcontainer", "and", "handle", "filtering", "on", "tags" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes/datadog_checks/kubernetes/kubernetes.py#L321-L391
train
Update the tags for a container and handle filtering on tags
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/datadog_checks/kubernetes/kubernetes.py
Kubernetes._update_pods_metrics
def _update_pods_metrics(self, instance, pods): """ Reports the number of running pods on this node, tagged by service and creator We go though all the pods, extract tags then count them by tag list, sorted and serialized in a pipe-separated string (it is an illegar character for tags) ...
python
def _update_pods_metrics(self, instance, pods): """ Reports the number of running pods on this node, tagged by service and creator We go though all the pods, extract tags then count them by tag list, sorted and serialized in a pipe-separated string (it is an illegar character for tags) ...
[ "def", "_update_pods_metrics", "(", "self", ",", "instance", ",", "pods", ")", ":", "tags_map", "=", "defaultdict", "(", "int", ")", "for", "pod", "in", "pods", "[", "'items'", "]", ":", "pod_meta", "=", "pod", ".", "get", "(", "'metadata'", ",", "{", ...
Reports the number of running pods on this node, tagged by service and creator We go though all the pods, extract tags then count them by tag list, sorted and serialized in a pipe-separated string (it is an illegar character for tags)
[ "Reports", "the", "number", "of", "running", "pods", "on", "this", "node", "tagged", "by", "service", "and", "creator" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes/datadog_checks/kubernetes/kubernetes.py#L488-L512
train
Update the metrics for running pods on this 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/datadog_checks/kubernetes/kubernetes.py
Kubernetes._update_kube_events
def _update_kube_events(self, instance, pods_list, event_items): """ Process kube events and send ddog events The namespace filtering is done here instead of KubeEventRetriever to avoid interfering with service discovery """ node_ip, node_name = self.kubeutil.get_node_inf...
python
def _update_kube_events(self, instance, pods_list, event_items): """ Process kube events and send ddog events The namespace filtering is done here instead of KubeEventRetriever to avoid interfering with service discovery """ node_ip, node_name = self.kubeutil.get_node_inf...
[ "def", "_update_kube_events", "(", "self", ",", "instance", ",", "pods_list", ",", "event_items", ")", ":", "node_ip", ",", "node_name", "=", "self", ".", "kubeutil", ".", "get_node_info", "(", ")", "self", ".", "log", ".", "debug", "(", "'Processing events ...
Process kube events and send ddog events The namespace filtering is done here instead of KubeEventRetriever to avoid interfering with service discovery
[ "Process", "kube", "events", "and", "send", "ddog", "events", "The", "namespace", "filtering", "is", "done", "here", "instead", "of", "KubeEventRetriever", "to", "avoid", "interfering", "with", "service", "discovery" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes/datadog_checks/kubernetes/kubernetes.py#L514-L577
train
Update the list of kube events and send ddog events
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/datadog_checks/kubernetes/kubernetes.py
Kubernetes.refresh_leader_status
def refresh_leader_status(self, instance): """ calls kubeutil.refresh_leader and compares the resulting leader status with the previous one. If it changed, update the event collection logic """ if not self.leader_candidate: return leader_status = self...
python
def refresh_leader_status(self, instance): """ calls kubeutil.refresh_leader and compares the resulting leader status with the previous one. If it changed, update the event collection logic """ if not self.leader_candidate: return leader_status = self...
[ "def", "refresh_leader_status", "(", "self", ",", "instance", ")", ":", "if", "not", "self", ".", "leader_candidate", ":", "return", "leader_status", "=", "self", ".", "kubeutil", ".", "is_leader", "self", ".", "kubeutil", ".", "refresh_leader", "(", ")", "#...
calls kubeutil.refresh_leader and compares the resulting leader status with the previous one. If it changed, update the event collection logic
[ "calls", "kubeutil", ".", "refresh_leader", "and", "compares", "the", "resulting", "leader", "status", "with", "the", "previous", "one", ".", "If", "it", "changed", "update", "the", "event", "collection", "logic" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/kubernetes/datadog_checks/kubernetes/kubernetes.py#L579-L597
train
Updates the leader status of 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
cacti/datadog_checks/cacti/cacti.py
Cacti._read_rrd
def _read_rrd(self, rrd_path, hostname, device_name, tags): ''' Main metric fetching method ''' metric_count = 0 try: info = self._get_rrd_info(rrd_path) except Exception: # Unable to read RRD file, ignore it self.log.exception("Unable to read RRD fil...
python
def _read_rrd(self, rrd_path, hostname, device_name, tags): ''' Main metric fetching method ''' metric_count = 0 try: info = self._get_rrd_info(rrd_path) except Exception: # Unable to read RRD file, ignore it self.log.exception("Unable to read RRD fil...
[ "def", "_read_rrd", "(", "self", ",", "rrd_path", ",", "hostname", ",", "device_name", ",", "tags", ")", ":", "metric_count", "=", "0", "try", ":", "info", "=", "self", ".", "_get_rrd_info", "(", "rrd_path", ")", "except", "Exception", ":", "# Unable to re...
Main metric fetching method
[ "Main", "metric", "fetching", "method" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/cacti/datadog_checks/cacti/cacti.py#L114-L164
train
Read the RRD file and return the number of metrics that were 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
cacti/datadog_checks/cacti/cacti.py
Cacti._fetch_rrd_meta
def _fetch_rrd_meta(self, connection, rrd_path_root, whitelist, field_names, tags): ''' Fetch metadata about each RRD in this Cacti DB, returning a list of tuples of (hostname, device_name, rrd_path) ''' def _in_whitelist(rrd): path = rrd.replace('<path_rra>/', '') ...
python
def _fetch_rrd_meta(self, connection, rrd_path_root, whitelist, field_names, tags): ''' Fetch metadata about each RRD in this Cacti DB, returning a list of tuples of (hostname, device_name, rrd_path) ''' def _in_whitelist(rrd): path = rrd.replace('<path_rra>/', '') ...
[ "def", "_fetch_rrd_meta", "(", "self", ",", "connection", ",", "rrd_path_root", ",", "whitelist", ",", "field_names", ",", "tags", ")", ":", "def", "_in_whitelist", "(", "rrd", ")", ":", "path", "=", "rrd", ".", "replace", "(", "'<path_rra>/'", ",", "''", ...
Fetch metadata about each RRD in this Cacti DB, returning a list of tuples of (hostname, device_name, rrd_path)
[ "Fetch", "metadata", "about", "each", "RRD", "in", "this", "Cacti", "DB", "returning", "a", "list", "of", "tuples", "of", "(", "hostname", "device_name", "rrd_path", ")" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/cacti/datadog_checks/cacti/cacti.py#L166-L214
train
Fetch metadata about each RRD in this Cacti DB returning a list of tuples of hostname device_name rrd_path.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
cacti/datadog_checks/cacti/cacti.py
Cacti._format_metric_name
def _format_metric_name(self, m_name, cfunc): ''' Format a cacti metric name into a Datadog-friendly name ''' try: aggr = CFUNC_TO_AGGR[cfunc] except KeyError: aggr = cfunc.lower() try: m_name = CACTI_TO_DD[m_name] if aggr != 'avg': ...
python
def _format_metric_name(self, m_name, cfunc): ''' Format a cacti metric name into a Datadog-friendly name ''' try: aggr = CFUNC_TO_AGGR[cfunc] except KeyError: aggr = cfunc.lower() try: m_name = CACTI_TO_DD[m_name] if aggr != 'avg': ...
[ "def", "_format_metric_name", "(", "self", ",", "m_name", ",", "cfunc", ")", ":", "try", ":", "aggr", "=", "CFUNC_TO_AGGR", "[", "cfunc", "]", "except", "KeyError", ":", "aggr", "=", "cfunc", ".", "lower", "(", ")", "try", ":", "m_name", "=", "CACTI_TO...
Format a cacti metric name into a Datadog-friendly name
[ "Format", "a", "cacti", "metric", "name", "into", "a", "Datadog", "-", "friendly", "name" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/cacti/datadog_checks/cacti/cacti.py#L216-L229
train
Format a cacti metric name into a Datadog - friendly 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/checks/win/wmi/counter_type.py
calculate_perf_100nsec_timer
def calculate_perf_100nsec_timer(previous, current, property_name): """ PERF_100NSEC_TIMER https://technet.microsoft.com/en-us/library/cc728274(v=ws.10).aspx """ n0 = previous[property_name] n1 = current[property_name] d0 = previous["Timestamp_Sys100NS"] d1 = current["Timestamp_Sys100NS...
python
def calculate_perf_100nsec_timer(previous, current, property_name): """ PERF_100NSEC_TIMER https://technet.microsoft.com/en-us/library/cc728274(v=ws.10).aspx """ n0 = previous[property_name] n1 = current[property_name] d0 = previous["Timestamp_Sys100NS"] d1 = current["Timestamp_Sys100NS...
[ "def", "calculate_perf_100nsec_timer", "(", "previous", ",", "current", ",", "property_name", ")", ":", "n0", "=", "previous", "[", "property_name", "]", "n1", "=", "current", "[", "property_name", "]", "d0", "=", "previous", "[", "\"Timestamp_Sys100NS\"", "]", ...
PERF_100NSEC_TIMER https://technet.microsoft.com/en-us/library/cc728274(v=ws.10).aspx
[ "PERF_100NSEC_TIMER" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/counter_type.py#L96-L110
train
Calculates the percentage of elapsed time between two previous and current 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
datadog_checks_base/datadog_checks/base/checks/win/wmi/counter_type.py
calculate_perf_counter_bulk_count
def calculate_perf_counter_bulk_count(previous, current, property_name): """ PERF_COUNTER_BULK_COUNT https://technet.microsoft.com/en-us/library/cc757486(v=ws.10).aspx """ n0 = previous[property_name] n1 = current[property_name] d0 = previous["Timestamp_Sys100NS"] d1 = current["Timestam...
python
def calculate_perf_counter_bulk_count(previous, current, property_name): """ PERF_COUNTER_BULK_COUNT https://technet.microsoft.com/en-us/library/cc757486(v=ws.10).aspx """ n0 = previous[property_name] n1 = current[property_name] d0 = previous["Timestamp_Sys100NS"] d1 = current["Timestam...
[ "def", "calculate_perf_counter_bulk_count", "(", "previous", ",", "current", ",", "property_name", ")", ":", "n0", "=", "previous", "[", "property_name", "]", "n1", "=", "current", "[", "property_name", "]", "d0", "=", "previous", "[", "\"Timestamp_Sys100NS\"", ...
PERF_COUNTER_BULK_COUNT https://technet.microsoft.com/en-us/library/cc757486(v=ws.10).aspx
[ "PERF_COUNTER_BULK_COUNT" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/counter_type.py#L114-L129
train
Calculates the bulk count of a given property in a given previous object.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
datadog_checks_base/datadog_checks/base/checks/win/wmi/counter_type.py
calculate_perf_counter_100ns_queuelen_type
def calculate_perf_counter_100ns_queuelen_type(previous, current, property_name): """ PERF_COUNTER_100NS_QUEUELEN_TYPE Average length of a queue to a resource over time in 100 nanosecond units. https://msdn.microsoft.com/en-us/library/aa392905(v=vs.85).aspx Formula (n1 - n0) / (d1 - d0) """ ...
python
def calculate_perf_counter_100ns_queuelen_type(previous, current, property_name): """ PERF_COUNTER_100NS_QUEUELEN_TYPE Average length of a queue to a resource over time in 100 nanosecond units. https://msdn.microsoft.com/en-us/library/aa392905(v=vs.85).aspx Formula (n1 - n0) / (d1 - d0) """ ...
[ "def", "calculate_perf_counter_100ns_queuelen_type", "(", "previous", ",", "current", ",", "property_name", ")", ":", "n0", "=", "previous", "[", "property_name", "]", "n1", "=", "current", "[", "property_name", "]", "d0", "=", "previous", "[", "\"Timestamp_Sys100...
PERF_COUNTER_100NS_QUEUELEN_TYPE Average length of a queue to a resource over time in 100 nanosecond units. https://msdn.microsoft.com/en-us/library/aa392905(v=vs.85).aspx Formula (n1 - n0) / (d1 - d0)
[ "PERF_COUNTER_100NS_QUEUELEN_TYPE" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/win/wmi/counter_type.py#L184-L201
train
Calculates the 100ns queuelen type of the queue.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
postgres/datadog_checks/postgres/postgres.py
PostgreSql._server_known
def _server_known(cls, host, port): """ Return whether the hostname and port combination was already seen """ with PostgreSql._known_servers_lock: return (host, port) in PostgreSql._known_servers
python
def _server_known(cls, host, port): """ Return whether the hostname and port combination was already seen """ with PostgreSql._known_servers_lock: return (host, port) in PostgreSql._known_servers
[ "def", "_server_known", "(", "cls", ",", "host", ",", "port", ")", ":", "with", "PostgreSql", ".", "_known_servers_lock", ":", "return", "(", "host", ",", "port", ")", "in", "PostgreSql", ".", "_known_servers" ]
Return whether the hostname and port combination was already seen
[ "Return", "whether", "the", "hostname", "and", "port", "combination", "was", "already", "seen" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/postgres/datadog_checks/postgres/postgres.py#L377-L382
train
Return whether the hostname and port combination is already seen.
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
postgres/datadog_checks/postgres/postgres.py
PostgreSql._set_server_known
def _set_server_known(cls, host, port): """ Store the host/port combination for this server """ with PostgreSql._known_servers_lock: PostgreSql._known_servers.add((host, port))
python
def _set_server_known(cls, host, port): """ Store the host/port combination for this server """ with PostgreSql._known_servers_lock: PostgreSql._known_servers.add((host, port))
[ "def", "_set_server_known", "(", "cls", ",", "host", ",", "port", ")", ":", "with", "PostgreSql", ".", "_known_servers_lock", ":", "PostgreSql", ".", "_known_servers", ".", "add", "(", "(", "host", ",", "port", ")", ")" ]
Store the host/port combination for this server
[ "Store", "the", "host", "/", "port", "combination", "for", "this", "server" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/postgres/datadog_checks/postgres/postgres.py#L385-L390
train
Set the host and port combination for this 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...
DataDog/integrations-core
postgres/datadog_checks/postgres/postgres.py
PostgreSql._get_instance_metrics
def _get_instance_metrics(self, key, db, database_size_metrics, collect_default_db): """ Add NEWER_92_METRICS to the default set of COMMON_METRICS when server version is 9.2 or later. Store the list of metrics in the check instance to avoid rebuilding it at every collection cycl...
python
def _get_instance_metrics(self, key, db, database_size_metrics, collect_default_db): """ Add NEWER_92_METRICS to the default set of COMMON_METRICS when server version is 9.2 or later. Store the list of metrics in the check instance to avoid rebuilding it at every collection cycl...
[ "def", "_get_instance_metrics", "(", "self", ",", "key", ",", "db", ",", "database_size_metrics", ",", "collect_default_db", ")", ":", "metrics", "=", "self", ".", "instance_metrics", ".", "get", "(", "key", ")", "if", "metrics", "is", "None", ":", "host", ...
Add NEWER_92_METRICS to the default set of COMMON_METRICS when server version is 9.2 or later. Store the list of metrics in the check instance to avoid rebuilding it at every collection cycle. In case we have multiple instances pointing to the same postgres server monitoring di...
[ "Add", "NEWER_92_METRICS", "to", "the", "default", "set", "of", "COMMON_METRICS", "when", "server", "version", "is", "9", ".", "2", "or", "later", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/postgres/datadog_checks/postgres/postgres.py#L467-L528
train
Get the list of metrics for the current 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
postgres/datadog_checks/postgres/postgres.py
PostgreSql._get_bgw_metrics
def _get_bgw_metrics(self, key, db): """Use either COMMON_BGW_METRICS or COMMON_BGW_METRICS + NEWER_92_BGW_METRICS depending on the postgres version. Uses a dictionnary to save the result for each instance """ # Extended 9.2+ metrics if needed metrics = self.bgw_metrics.g...
python
def _get_bgw_metrics(self, key, db): """Use either COMMON_BGW_METRICS or COMMON_BGW_METRICS + NEWER_92_BGW_METRICS depending on the postgres version. Uses a dictionnary to save the result for each instance """ # Extended 9.2+ metrics if needed metrics = self.bgw_metrics.g...
[ "def", "_get_bgw_metrics", "(", "self", ",", "key", ",", "db", ")", ":", "# Extended 9.2+ metrics if needed", "metrics", "=", "self", ".", "bgw_metrics", ".", "get", "(", "key", ")", "if", "metrics", "is", "None", ":", "# Hack to make sure that if we have multiple...
Use either COMMON_BGW_METRICS or COMMON_BGW_METRICS + NEWER_92_BGW_METRICS depending on the postgres version. Uses a dictionnary to save the result for each instance
[ "Use", "either", "COMMON_BGW_METRICS", "or", "COMMON_BGW_METRICS", "+", "NEWER_92_BGW_METRICS", "depending", "on", "the", "postgres", "version", ".", "Uses", "a", "dictionnary", "to", "save", "the", "result", "for", "each", "instance" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/postgres/datadog_checks/postgres/postgres.py#L530-L564
train
Get the bgw metrics for the given key.
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
postgres/datadog_checks/postgres/postgres.py
PostgreSql._get_archiver_metrics
def _get_archiver_metrics(self, key, db): """Use COMMON_ARCHIVER_METRICS to read from pg_stat_archiver as defined in 9.4 (first version to have this table). Uses a dictionary to save the result for each instance """ # While there's only one set for now, prepare for future additio...
python
def _get_archiver_metrics(self, key, db): """Use COMMON_ARCHIVER_METRICS to read from pg_stat_archiver as defined in 9.4 (first version to have this table). Uses a dictionary to save the result for each instance """ # While there's only one set for now, prepare for future additio...
[ "def", "_get_archiver_metrics", "(", "self", ",", "key", ",", "db", ")", ":", "# While there's only one set for now, prepare for future additions to", "# the table, mirroring _get_bgw_metrics()", "metrics", "=", "self", ".", "archiver_metrics", ".", "get", "(", "key", ")", ...
Use COMMON_ARCHIVER_METRICS to read from pg_stat_archiver as defined in 9.4 (first version to have this table). Uses a dictionary to save the result for each instance
[ "Use", "COMMON_ARCHIVER_METRICS", "to", "read", "from", "pg_stat_archiver", "as", "defined", "in", "9", ".", "4", "(", "first", "version", "to", "have", "this", "table", ")", ".", "Uses", "a", "dictionary", "to", "save", "the", "result", "for", "each", "in...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/postgres/datadog_checks/postgres/postgres.py#L566-L594
train
Get the archiver metrics for the given key.
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
postgres/datadog_checks/postgres/postgres.py
PostgreSql._get_replication_metrics
def _get_replication_metrics(self, key, db): """ Use either REPLICATION_METRICS_10, REPLICATION_METRICS_9_1, or REPLICATION_METRICS_9_1 + REPLICATION_METRICS_9_2, depending on the postgres version. Uses a dictionnary to save the result for each instance """ metrics = self...
python
def _get_replication_metrics(self, key, db): """ Use either REPLICATION_METRICS_10, REPLICATION_METRICS_9_1, or REPLICATION_METRICS_9_1 + REPLICATION_METRICS_9_2, depending on the postgres version. Uses a dictionnary to save the result for each instance """ metrics = self...
[ "def", "_get_replication_metrics", "(", "self", ",", "key", ",", "db", ")", ":", "metrics", "=", "self", ".", "replication_metrics", ".", "get", "(", "key", ")", "if", "self", ".", "_is_10_or_above", "(", "key", ",", "db", ")", "and", "metrics", "is", ...
Use either REPLICATION_METRICS_10, REPLICATION_METRICS_9_1, or REPLICATION_METRICS_9_1 + REPLICATION_METRICS_9_2, depending on the postgres version. Uses a dictionnary to save the result for each instance
[ "Use", "either", "REPLICATION_METRICS_10", "REPLICATION_METRICS_9_1", "or", "REPLICATION_METRICS_9_1", "+", "REPLICATION_METRICS_9_2", "depending", "on", "the", "postgres", "version", ".", "Uses", "a", "dictionnary", "to", "save", "the", "result", "for", "each", "instan...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/postgres/datadog_checks/postgres/postgres.py#L596-L611
train
Get the replication metrics for the given key.
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
postgres/datadog_checks/postgres/postgres.py
PostgreSql._get_activity_metrics
def _get_activity_metrics(self, key, db): """ Use ACTIVITY_METRICS_LT_8_3 or ACTIVITY_METRICS_8_3 or ACTIVITY_METRICS_9_2 depending on the postgres version in conjunction with ACTIVITY_QUERY_10 or ACTIVITY_QUERY_LT_10. Uses a dictionnary to save the result for each instance """ m...
python
def _get_activity_metrics(self, key, db): """ Use ACTIVITY_METRICS_LT_8_3 or ACTIVITY_METRICS_8_3 or ACTIVITY_METRICS_9_2 depending on the postgres version in conjunction with ACTIVITY_QUERY_10 or ACTIVITY_QUERY_LT_10. Uses a dictionnary to save the result for each instance """ m...
[ "def", "_get_activity_metrics", "(", "self", ",", "key", ",", "db", ")", ":", "metrics_data", "=", "self", ".", "activity_metrics", ".", "get", "(", "key", ")", "if", "metrics_data", "is", "None", ":", "query", "=", "self", ".", "ACTIVITY_QUERY_10", "if", ...
Use ACTIVITY_METRICS_LT_8_3 or ACTIVITY_METRICS_8_3 or ACTIVITY_METRICS_9_2 depending on the postgres version in conjunction with ACTIVITY_QUERY_10 or ACTIVITY_QUERY_LT_10. Uses a dictionnary to save the result for each instance
[ "Use", "ACTIVITY_METRICS_LT_8_3", "or", "ACTIVITY_METRICS_8_3", "or", "ACTIVITY_METRICS_9_2", "depending", "on", "the", "postgres", "version", "in", "conjunction", "with", "ACTIVITY_QUERY_10", "or", "ACTIVITY_QUERY_LT_10", ".", "Uses", "a", "dictionnary", "to", "save", ...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/postgres/datadog_checks/postgres/postgres.py#L613-L637
train
Get the activity metrics for the specified 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
postgres/datadog_checks/postgres/postgres.py
PostgreSql._build_relations_config
def _build_relations_config(self, yamlconfig): """Builds a dictionary from relations configuration while maintaining compatibility """ config = {} for element in yamlconfig: if isinstance(element, str): config[element] = {'relation_name': element, 'schemas': [...
python
def _build_relations_config(self, yamlconfig): """Builds a dictionary from relations configuration while maintaining compatibility """ config = {} for element in yamlconfig: if isinstance(element, str): config[element] = {'relation_name': element, 'schemas': [...
[ "def", "_build_relations_config", "(", "self", ",", "yamlconfig", ")", ":", "config", "=", "{", "}", "for", "element", "in", "yamlconfig", ":", "if", "isinstance", "(", "element", ",", "str", ")", ":", "config", "[", "element", "]", "=", "{", "'relation_...
Builds a dictionary from relations configuration while maintaining compatibility
[ "Builds", "a", "dictionary", "from", "relations", "configuration", "while", "maintaining", "compatibility" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/postgres/datadog_checks/postgres/postgres.py#L639-L657
train
Builds a dictionary from relations configuration while maintaining compatibility
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
postgres/datadog_checks/postgres/postgres.py
PostgreSql._collect_stats
def _collect_stats( self, key, db, instance_tags, relations, custom_metrics, collect_function_metrics, collect_count_metrics, collect_activity_metrics, collect_database_size_metrics, collect_default_db, interface_error, ...
python
def _collect_stats( self, key, db, instance_tags, relations, custom_metrics, collect_function_metrics, collect_count_metrics, collect_activity_metrics, collect_database_size_metrics, collect_default_db, interface_error, ...
[ "def", "_collect_stats", "(", "self", ",", "key", ",", "db", ",", "instance_tags", ",", "relations", ",", "custom_metrics", ",", "collect_function_metrics", ",", "collect_count_metrics", ",", "collect_activity_metrics", ",", "collect_database_size_metrics", ",", "collec...
Query pg_stat_* for various metrics If relations is not an empty list, gather per-relation metrics on top of that. If custom_metrics is not an empty list, gather custom metrics defined in postgres.yaml
[ "Query", "pg_stat_", "*", "for", "various", "metrics", "If", "relations", "is", "not", "an", "empty", "list", "gather", "per", "-", "relation", "metrics", "on", "top", "of", "that", ".", "If", "custom_metrics", "is", "not", "an", "empty", "list", "gather",...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/postgres/datadog_checks/postgres/postgres.py#L759-L834
train
Query pg_stat_* for various metrics.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
postgres/datadog_checks/postgres/postgres.py
PostgreSql.get_connection
def get_connection(self, key, host, port, user, password, dbname, ssl, connect_fct, tags, use_cached=True): """Get and memoize connections to instances""" if key in self.dbs and use_cached: return self.dbs[key] elif host != "" and user != "": try: if host...
python
def get_connection(self, key, host, port, user, password, dbname, ssl, connect_fct, tags, use_cached=True): """Get and memoize connections to instances""" if key in self.dbs and use_cached: return self.dbs[key] elif host != "" and user != "": try: if host...
[ "def", "get_connection", "(", "self", ",", "key", ",", "host", ",", "port", ",", "user", ",", "password", ",", "dbname", ",", "ssl", ",", "connect_fct", ",", "tags", ",", "use_cached", "=", "True", ")", ":", "if", "key", "in", "self", ".", "dbs", "...
Get and memoize connections to instances
[ "Get", "and", "memoize", "connections", "to", "instances" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/postgres/datadog_checks/postgres/postgres.py#L843-L876
train
Get and memoize connections to instances
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
postgres/datadog_checks/postgres/postgres.py
PostgreSql._get_custom_queries
def _get_custom_queries(self, db, tags, custom_queries, programming_error): """ Given a list of custom_queries, execute each query and parse the result for metrics """ for custom_query in custom_queries: metric_prefix = custom_query.get('metric_prefix') if not met...
python
def _get_custom_queries(self, db, tags, custom_queries, programming_error): """ Given a list of custom_queries, execute each query and parse the result for metrics """ for custom_query in custom_queries: metric_prefix = custom_query.get('metric_prefix') if not met...
[ "def", "_get_custom_queries", "(", "self", ",", "db", ",", "tags", ",", "custom_queries", ",", "programming_error", ")", ":", "for", "custom_query", "in", "custom_queries", ":", "metric_prefix", "=", "custom_query", ".", "get", "(", "'metric_prefix'", ")", "if",...
Given a list of custom_queries, execute each query and parse the result for metrics
[ "Given", "a", "list", "of", "custom_queries", "execute", "each", "query", "and", "parse", "the", "result", "for", "metrics" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/postgres/datadog_checks/postgres/postgres.py#L878-L970
train
Execute each query and parse the result for metrics
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
ibm_was/datadog_checks/ibm_was/ibm_was.py
IbmWasCheck.process_stats
def process_stats(self, stats, prefix, metric_categories, nested_tags, tags, recursion_level=0): """ The XML will have Stat Nodes and Nodes that contain the metrics themselves This code recursively goes through each Stat Node to properly setup tags where each Stat will have a different t...
python
def process_stats(self, stats, prefix, metric_categories, nested_tags, tags, recursion_level=0): """ The XML will have Stat Nodes and Nodes that contain the metrics themselves This code recursively goes through each Stat Node to properly setup tags where each Stat will have a different t...
[ "def", "process_stats", "(", "self", ",", "stats", ",", "prefix", ",", "metric_categories", ",", "nested_tags", ",", "tags", ",", "recursion_level", "=", "0", ")", ":", "for", "child", "in", "stats", ":", "if", "child", ".", "tag", "in", "metrics", ".", ...
The XML will have Stat Nodes and Nodes that contain the metrics themselves This code recursively goes through each Stat Node to properly setup tags where each Stat will have a different tag key depending on the context.
[ "The", "XML", "will", "have", "Stat", "Nodes", "and", "Nodes", "that", "contain", "the", "metrics", "themselves", "This", "code", "recursively", "goes", "through", "each", "Stat", "Node", "to", "properly", "setup", "tags", "where", "each", "Stat", "will", "h...
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/ibm_was/datadog_checks/ibm_was/ibm_was.py#L81-L92
train
This function processes the XML stats and submits the metrics to the tags list.
Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL...
DataDog/integrations-core
tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py
_to_micros
def _to_micros(dur): """Convert duration 'dur' to microseconds.""" if hasattr(dur, 'total_seconds'): return int(dur.total_seconds() * 10e5) # Python 2.6 return dur.microseconds + (dur.seconds + dur.days * 24 * 3600) * 1000000
python
def _to_micros(dur): """Convert duration 'dur' to microseconds.""" if hasattr(dur, 'total_seconds'): return int(dur.total_seconds() * 10e5) # Python 2.6 return dur.microseconds + (dur.seconds + dur.days * 24 * 3600) * 1000000
[ "def", "_to_micros", "(", "dur", ")", ":", "if", "hasattr", "(", "dur", ",", "'total_seconds'", ")", ":", "return", "int", "(", "dur", ".", "total_seconds", "(", ")", "*", "10e5", ")", "# Python 2.6", "return", "dur", ".", "microseconds", "+", "(", "du...
Convert duration 'dur' to microseconds.
[ "Convert", "duration", "dur", "to", "microseconds", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L283-L288
train
Convert duration 'dur' to microseconds.
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/monitoring.py
_validate_event_listeners
def _validate_event_listeners(option, listeners): """Validate event listeners""" if not isinstance(listeners, Sequence): raise TypeError("%s must be a list or tuple" % (option,)) for listener in listeners: if not isinstance(listener, _EventListener): raise TypeError("Listeners fo...
python
def _validate_event_listeners(option, listeners): """Validate event listeners""" if not isinstance(listeners, Sequence): raise TypeError("%s must be a list or tuple" % (option,)) for listener in listeners: if not isinstance(listener, _EventListener): raise TypeError("Listeners fo...
[ "def", "_validate_event_listeners", "(", "option", ",", "listeners", ")", ":", "if", "not", "isinstance", "(", "listeners", ",", "Sequence", ")", ":", "raise", "TypeError", "(", "\"%s must be a list or tuple\"", "%", "(", "option", ",", ")", ")", "for", "liste...
Validate event listeners
[ "Validate", "event", "listeners" ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L291-L300
train
Validate event listeners.
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/monitoring.py
register
def register(listener): """Register a global event listener. :Parameters: - `listener`: A subclasses of :class:`CommandListener`, :class:`ServerHeartbeatListener`, :class:`ServerListener`, or :class:`TopologyListener`. """ if not isinstance(listener, _EventListener): raise...
python
def register(listener): """Register a global event listener. :Parameters: - `listener`: A subclasses of :class:`CommandListener`, :class:`ServerHeartbeatListener`, :class:`ServerListener`, or :class:`TopologyListener`. """ if not isinstance(listener, _EventListener): raise...
[ "def", "register", "(", "listener", ")", ":", "if", "not", "isinstance", "(", "listener", ",", "_EventListener", ")", ":", "raise", "TypeError", "(", "\"Listeners for %s must be either a \"", "\"CommandListener, ServerHeartbeatListener, \"", "\"ServerListener, or TopologyList...
Register a global event listener. :Parameters: - `listener`: A subclasses of :class:`CommandListener`, :class:`ServerHeartbeatListener`, :class:`ServerListener`, or :class:`TopologyListener`.
[ "Register", "a", "global", "event", "listener", "." ]
ebd41c873cf9f97a8c51bf9459bc6a7536af8acd
https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L303-L322
train
Registers a global event listener.
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...