repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py | _EventListeners.event_listeners | def event_listeners(self):
"""List of registered event listeners."""
return (self.__command_listeners[:],
self.__server_heartbeat_listeners[:],
self.__server_listeners[:],
self.__topology_listeners[:]) | python | def event_listeners(self):
"""List of registered event listeners."""
return (self.__command_listeners[:],
self.__server_heartbeat_listeners[:],
self.__server_listeners[:],
self.__topology_listeners[:]) | [
"def",
"event_listeners",
"(",
"self",
")",
":",
"return",
"(",
"self",
".",
"__command_listeners",
"[",
":",
"]",
",",
"self",
".",
"__server_heartbeat_listeners",
"[",
":",
"]",
",",
"self",
".",
"__server_listeners",
"[",
":",
"]",
",",
"self",
".",
"... | List of registered event listeners. | [
"List",
"of",
"registered",
"event",
"listeners",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L711-L716 | train | List of registered 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 | _EventListeners.publish_command_start | def publish_command_start(self, command, database_name,
request_id, connection_id, op_id=None):
"""Publish a CommandStartedEvent to all command listeners.
:Parameters:
- `command`: The command document.
- `database_name`: The name of the database this c... | python | def publish_command_start(self, command, database_name,
request_id, connection_id, op_id=None):
"""Publish a CommandStartedEvent to all command listeners.
:Parameters:
- `command`: The command document.
- `database_name`: The name of the database this c... | [
"def",
"publish_command_start",
"(",
"self",
",",
"command",
",",
"database_name",
",",
"request_id",
",",
"connection_id",
",",
"op_id",
"=",
"None",
")",
":",
"if",
"op_id",
"is",
"None",
":",
"op_id",
"=",
"request_id",
"event",
"=",
"CommandStartedEvent",
... | Publish a CommandStartedEvent to all command listeners.
:Parameters:
- `command`: The command document.
- `database_name`: The name of the database this command was run
against.
- `request_id`: The request id for this operation.
- `connection_id`: The address... | [
"Publish",
"a",
"CommandStartedEvent",
"to",
"all",
"command",
"listeners",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L718-L739 | train | Publish a CommandStartedEvent to all command 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 | _EventListeners.publish_command_success | def publish_command_success(self, duration, reply, command_name,
request_id, connection_id, op_id=None):
"""Publish a CommandSucceededEvent to all command listeners.
:Parameters:
- `duration`: The command duration as a datetime.timedelta.
- `reply`: T... | python | def publish_command_success(self, duration, reply, command_name,
request_id, connection_id, op_id=None):
"""Publish a CommandSucceededEvent to all command listeners.
:Parameters:
- `duration`: The command duration as a datetime.timedelta.
- `reply`: T... | [
"def",
"publish_command_success",
"(",
"self",
",",
"duration",
",",
"reply",
",",
"command_name",
",",
"request_id",
",",
"connection_id",
",",
"op_id",
"=",
"None",
")",
":",
"if",
"op_id",
"is",
"None",
":",
"op_id",
"=",
"request_id",
"event",
"=",
"Co... | Publish a CommandSucceededEvent to all command listeners.
:Parameters:
- `duration`: The command duration as a datetime.timedelta.
- `reply`: The server reply document.
- `command_name`: The command name.
- `request_id`: The request id for this operation.
- `co... | [
"Publish",
"a",
"CommandSucceededEvent",
"to",
"all",
"command",
"listeners",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L741-L762 | train | Publish a CommandSucceededEvent to all command 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 | _EventListeners.publish_command_failure | def publish_command_failure(self, duration, failure, command_name,
request_id, connection_id, op_id=None):
"""Publish a CommandFailedEvent to all command listeners.
:Parameters:
- `duration`: The command duration as a datetime.timedelta.
- `failure`: ... | python | def publish_command_failure(self, duration, failure, command_name,
request_id, connection_id, op_id=None):
"""Publish a CommandFailedEvent to all command listeners.
:Parameters:
- `duration`: The command duration as a datetime.timedelta.
- `failure`: ... | [
"def",
"publish_command_failure",
"(",
"self",
",",
"duration",
",",
"failure",
",",
"command_name",
",",
"request_id",
",",
"connection_id",
",",
"op_id",
"=",
"None",
")",
":",
"if",
"op_id",
"is",
"None",
":",
"op_id",
"=",
"request_id",
"event",
"=",
"... | Publish a CommandFailedEvent to all command listeners.
:Parameters:
- `duration`: The command duration as a datetime.timedelta.
- `failure`: The server reply document or failure description
document.
- `command_name`: The command name.
- `request_id`: The req... | [
"Publish",
"a",
"CommandFailedEvent",
"to",
"all",
"command",
"listeners",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L764-L786 | train | Publish a CommandFailedEvent to all command 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 | _EventListeners.publish_server_heartbeat_started | def publish_server_heartbeat_started(self, connection_id):
"""Publish a ServerHeartbeatStartedEvent to all server heartbeat
listeners.
:Parameters:
- `connection_id`: The address (host/port pair) of the connection.
"""
event = ServerHeartbeatStartedEvent(connection_id)
... | python | def publish_server_heartbeat_started(self, connection_id):
"""Publish a ServerHeartbeatStartedEvent to all server heartbeat
listeners.
:Parameters:
- `connection_id`: The address (host/port pair) of the connection.
"""
event = ServerHeartbeatStartedEvent(connection_id)
... | [
"def",
"publish_server_heartbeat_started",
"(",
"self",
",",
"connection_id",
")",
":",
"event",
"=",
"ServerHeartbeatStartedEvent",
"(",
"connection_id",
")",
"for",
"subscriber",
"in",
"self",
".",
"__server_heartbeat_listeners",
":",
"try",
":",
"subscriber",
".",
... | Publish a ServerHeartbeatStartedEvent to all server heartbeat
listeners.
:Parameters:
- `connection_id`: The address (host/port pair) of the connection. | [
"Publish",
"a",
"ServerHeartbeatStartedEvent",
"to",
"all",
"server",
"heartbeat",
"listeners",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L788-L800 | train | Publish a ServerHeartbeatStartedEvent to all server heartbeat 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 | _EventListeners.publish_server_heartbeat_succeeded | def publish_server_heartbeat_succeeded(self, connection_id, duration,
reply):
"""Publish a ServerHeartbeatSucceededEvent to all server heartbeat
listeners.
:Parameters:
- `connection_id`: The address (host/port pair) of the connection.
... | python | def publish_server_heartbeat_succeeded(self, connection_id, duration,
reply):
"""Publish a ServerHeartbeatSucceededEvent to all server heartbeat
listeners.
:Parameters:
- `connection_id`: The address (host/port pair) of the connection.
... | [
"def",
"publish_server_heartbeat_succeeded",
"(",
"self",
",",
"connection_id",
",",
"duration",
",",
"reply",
")",
":",
"event",
"=",
"ServerHeartbeatSucceededEvent",
"(",
"duration",
",",
"reply",
",",
"connection_id",
")",
"for",
"subscriber",
"in",
"self",
"."... | Publish a ServerHeartbeatSucceededEvent to all server heartbeat
listeners.
:Parameters:
- `connection_id`: The address (host/port pair) of the connection.
- `duration`: The execution time of the event in the highest possible
resolution for the platform.
- `reply`:... | [
"Publish",
"a",
"ServerHeartbeatSucceededEvent",
"to",
"all",
"server",
"heartbeat",
"listeners",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L802-L818 | train | Publish a ServerHeartbeatSucceededEvent to all server heartbeat 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 | _EventListeners.publish_server_heartbeat_failed | def publish_server_heartbeat_failed(self, connection_id, duration, reply):
"""Publish a ServerHeartbeatFailedEvent to all server heartbeat
listeners.
:Parameters:
- `connection_id`: The address (host/port pair) of the connection.
- `duration`: The execution time of the event i... | python | def publish_server_heartbeat_failed(self, connection_id, duration, reply):
"""Publish a ServerHeartbeatFailedEvent to all server heartbeat
listeners.
:Parameters:
- `connection_id`: The address (host/port pair) of the connection.
- `duration`: The execution time of the event i... | [
"def",
"publish_server_heartbeat_failed",
"(",
"self",
",",
"connection_id",
",",
"duration",
",",
"reply",
")",
":",
"event",
"=",
"ServerHeartbeatFailedEvent",
"(",
"duration",
",",
"reply",
",",
"connection_id",
")",
"for",
"subscriber",
"in",
"self",
".",
"_... | Publish a ServerHeartbeatFailedEvent to all server heartbeat
listeners.
:Parameters:
- `connection_id`: The address (host/port pair) of the connection.
- `duration`: The execution time of the event in the highest possible
resolution for the platform.
- `reply`: Th... | [
"Publish",
"a",
"ServerHeartbeatFailedEvent",
"to",
"all",
"server",
"heartbeat",
"listeners",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L820-L835 | train | Publish a ServerHeartbeatFailedEvent to all server heartbeat 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 | _EventListeners.publish_server_opened | def publish_server_opened(self, server_address, topology_id):
"""Publish a ServerOpeningEvent to all server listeners.
:Parameters:
- `server_address`: The address (host/port pair) of the server.
- `topology_id`: A unique identifier for the topology this server
is a part of... | python | def publish_server_opened(self, server_address, topology_id):
"""Publish a ServerOpeningEvent to all server listeners.
:Parameters:
- `server_address`: The address (host/port pair) of the server.
- `topology_id`: A unique identifier for the topology this server
is a part of... | [
"def",
"publish_server_opened",
"(",
"self",
",",
"server_address",
",",
"topology_id",
")",
":",
"event",
"=",
"ServerOpeningEvent",
"(",
"server_address",
",",
"topology_id",
")",
"for",
"subscriber",
"in",
"self",
".",
"__server_listeners",
":",
"try",
":",
"... | Publish a ServerOpeningEvent to all server listeners.
:Parameters:
- `server_address`: The address (host/port pair) of the server.
- `topology_id`: A unique identifier for the topology this server
is a part of. | [
"Publish",
"a",
"ServerOpeningEvent",
"to",
"all",
"server",
"listeners",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L837-L850 | train | Publish a ServerOpeningEvent to all server 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 | _EventListeners.publish_server_closed | def publish_server_closed(self, server_address, topology_id):
"""Publish a ServerClosedEvent to all server listeners.
:Parameters:
- `server_address`: The address (host/port pair) of the server.
- `topology_id`: A unique identifier for the topology this server
is a part of.... | python | def publish_server_closed(self, server_address, topology_id):
"""Publish a ServerClosedEvent to all server listeners.
:Parameters:
- `server_address`: The address (host/port pair) of the server.
- `topology_id`: A unique identifier for the topology this server
is a part of.... | [
"def",
"publish_server_closed",
"(",
"self",
",",
"server_address",
",",
"topology_id",
")",
":",
"event",
"=",
"ServerClosedEvent",
"(",
"server_address",
",",
"topology_id",
")",
"for",
"subscriber",
"in",
"self",
".",
"__server_listeners",
":",
"try",
":",
"s... | Publish a ServerClosedEvent to all server listeners.
:Parameters:
- `server_address`: The address (host/port pair) of the server.
- `topology_id`: A unique identifier for the topology this server
is a part of. | [
"Publish",
"a",
"ServerClosedEvent",
"to",
"all",
"server",
"listeners",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L852-L865 | train | Publish a ServerClosedEvent to all server 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 | _EventListeners.publish_server_description_changed | def publish_server_description_changed(self, previous_description,
new_description, server_address,
topology_id):
"""Publish a ServerDescriptionChangedEvent to all server listeners.
:Parameters:
- `previous_d... | python | def publish_server_description_changed(self, previous_description,
new_description, server_address,
topology_id):
"""Publish a ServerDescriptionChangedEvent to all server listeners.
:Parameters:
- `previous_d... | [
"def",
"publish_server_description_changed",
"(",
"self",
",",
"previous_description",
",",
"new_description",
",",
"server_address",
",",
"topology_id",
")",
":",
"event",
"=",
"ServerDescriptionChangedEvent",
"(",
"previous_description",
",",
"new_description",
",",
"se... | Publish a ServerDescriptionChangedEvent to all server listeners.
:Parameters:
- `previous_description`: The previous server description.
- `server_address`: The address (host/port pair) of the server.
- `new_description`: The new server description.
- `topology_id`: A unique... | [
"Publish",
"a",
"ServerDescriptionChangedEvent",
"to",
"all",
"server",
"listeners",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L867-L886 | train | Publish a ServerDescriptionChangedEvent to all server 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 | _EventListeners.publish_topology_opened | def publish_topology_opened(self, topology_id):
"""Publish a TopologyOpenedEvent to all topology listeners.
:Parameters:
- `topology_id`: A unique identifier for the topology this server
is a part of.
"""
event = TopologyOpenedEvent(topology_id)
for subscribe... | python | def publish_topology_opened(self, topology_id):
"""Publish a TopologyOpenedEvent to all topology listeners.
:Parameters:
- `topology_id`: A unique identifier for the topology this server
is a part of.
"""
event = TopologyOpenedEvent(topology_id)
for subscribe... | [
"def",
"publish_topology_opened",
"(",
"self",
",",
"topology_id",
")",
":",
"event",
"=",
"TopologyOpenedEvent",
"(",
"topology_id",
")",
"for",
"subscriber",
"in",
"self",
".",
"__topology_listeners",
":",
"try",
":",
"subscriber",
".",
"opened",
"(",
"event",... | Publish a TopologyOpenedEvent to all topology listeners.
:Parameters:
- `topology_id`: A unique identifier for the topology this server
is a part of. | [
"Publish",
"a",
"TopologyOpenedEvent",
"to",
"all",
"topology",
"listeners",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L888-L900 | train | Publish a TopologyOpenedEvent to all topology 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 | _EventListeners.publish_topology_closed | def publish_topology_closed(self, topology_id):
"""Publish a TopologyClosedEvent to all topology listeners.
:Parameters:
- `topology_id`: A unique identifier for the topology this server
is a part of.
"""
event = TopologyClosedEvent(topology_id)
for subscribe... | python | def publish_topology_closed(self, topology_id):
"""Publish a TopologyClosedEvent to all topology listeners.
:Parameters:
- `topology_id`: A unique identifier for the topology this server
is a part of.
"""
event = TopologyClosedEvent(topology_id)
for subscribe... | [
"def",
"publish_topology_closed",
"(",
"self",
",",
"topology_id",
")",
":",
"event",
"=",
"TopologyClosedEvent",
"(",
"topology_id",
")",
"for",
"subscriber",
"in",
"self",
".",
"__topology_listeners",
":",
"try",
":",
"subscriber",
".",
"closed",
"(",
"event",... | Publish a TopologyClosedEvent to all topology listeners.
:Parameters:
- `topology_id`: A unique identifier for the topology this server
is a part of. | [
"Publish",
"a",
"TopologyClosedEvent",
"to",
"all",
"topology",
"listeners",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L902-L914 | train | Publish a TopologyClosedEvent to all topology 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 | _EventListeners.publish_topology_description_changed | def publish_topology_description_changed(self, previous_description,
new_description, topology_id):
"""Publish a TopologyDescriptionChangedEvent to all topology listeners.
:Parameters:
- `previous_description`: The previous topology description.
... | python | def publish_topology_description_changed(self, previous_description,
new_description, topology_id):
"""Publish a TopologyDescriptionChangedEvent to all topology listeners.
:Parameters:
- `previous_description`: The previous topology description.
... | [
"def",
"publish_topology_description_changed",
"(",
"self",
",",
"previous_description",
",",
"new_description",
",",
"topology_id",
")",
":",
"event",
"=",
"TopologyDescriptionChangedEvent",
"(",
"previous_description",
",",
"new_description",
",",
"topology_id",
")",
"f... | Publish a TopologyDescriptionChangedEvent to all topology listeners.
:Parameters:
- `previous_description`: The previous topology description.
- `new_description`: The new topology description.
- `topology_id`: A unique identifier for the topology this server
is a part of. | [
"Publish",
"a",
"TopologyDescriptionChangedEvent",
"to",
"all",
"topology",
"listeners",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/monitoring.py#L916-L932 | train | Publish a TopologyDescriptionChangedEvent to all topology 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 | postfix/datadog_checks/postfix/postfix.py | PostfixCheck._get_postqueue_stats | def _get_postqueue_stats(self, postfix_config_dir, tags):
# get some intersting configuratin values from postconf
pc_output, _, _ = get_subprocess_output(['postconf', 'mail_version'], self.log, False)
postfix_version = pc_output.strip('\n').split('=')[1].strip()
pc_output, _, _ = get_su... | python | def _get_postqueue_stats(self, postfix_config_dir, tags):
# get some intersting configuratin values from postconf
pc_output, _, _ = get_subprocess_output(['postconf', 'mail_version'], self.log, False)
postfix_version = pc_output.strip('\n').split('=')[1].strip()
pc_output, _, _ = get_su... | [
"def",
"_get_postqueue_stats",
"(",
"self",
",",
"postfix_config_dir",
",",
"tags",
")",
":",
"# get some intersting configuratin values from postconf",
"pc_output",
",",
"_",
",",
"_",
"=",
"get_subprocess_output",
"(",
"[",
"'postconf'",
",",
"'mail_version'",
"]",
... | root@postfix:/opt/datadog-agent/agent/checks.d# postqueue -p
----Queue ID----- --Size-- ---Arrival Time---- --Sender/Recipient------
3xWyLP6Nmfz23fk 367 Tue Aug 15 16:17:33 root@postfix.devnull.home
(deferred transport)
... | [
"root@postfix",
":",
"/",
"opt",
"/",
"datadog",
"-",
"agent",
"/",
"agent",
"/",
"checks",
".",
"d#",
"postqueue",
"-",
"p",
"----",
"Queue",
"ID",
"-----",
"--",
"Size",
"--",
"---",
"Arrival",
"Time",
"----",
"--",
"Sender",
"/",
"Recipient",
"-----... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/postfix/datadog_checks/postfix/postfix.py#L117-L170 | train | Get statistics on the postqueue. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_dev/datadog_checks/dev/tooling/commands/agent/integrations.py | integrations | def integrations(since, to, write, force):
"""
Generates a markdown file containing the list of integrations shipped in a
given Agent release. Agent version numbers are derived inspecting tags on
`integrations-core` so running this tool might provide unexpected results
if the repo is not up to date ... | python | def integrations(since, to, write, force):
"""
Generates a markdown file containing the list of integrations shipped in a
given Agent release. Agent version numbers are derived inspecting tags on
`integrations-core` so running this tool might provide unexpected results
if the repo is not up to date ... | [
"def",
"integrations",
"(",
"since",
",",
"to",
",",
"write",
",",
"force",
")",
":",
"agent_tags",
"=",
"get_agent_tags",
"(",
"since",
",",
"to",
")",
"# get the list of integrations shipped with the agent from the requirements file",
"req_file_name",
"=",
"os",
"."... | Generates a markdown file containing the list of integrations shipped in a
given Agent release. Agent version numbers are derived inspecting tags on
`integrations-core` so running this tool might provide unexpected results
if the repo is not up to date with the Agent release process.
If neither `--sinc... | [
"Generates",
"a",
"markdown",
"file",
"containing",
"the",
"list",
"of",
"integrations",
"shipped",
"in",
"a",
"given",
"Agent",
"release",
".",
"Agent",
"version",
"numbers",
"are",
"derived",
"inspecting",
"tags",
"on",
"integrations",
"-",
"core",
"so",
"ru... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/agent/integrations.py#L25-L59 | train | Generates a markdown file containing the list of integrations shipped with the Agent release. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | pgbouncer/datadog_checks/pgbouncer/pgbouncer.py | PgBouncer._collect_stats | def _collect_stats(self, db, instance_tags):
"""Query pgbouncer for various metrics
"""
metric_scope = [self.STATS_METRICS, self.POOLS_METRICS, self.DATABASES_METRICS]
try:
with db.cursor(cursor_factory=pgextras.DictCursor) as cursor:
for scope in metric_sco... | python | def _collect_stats(self, db, instance_tags):
"""Query pgbouncer for various metrics
"""
metric_scope = [self.STATS_METRICS, self.POOLS_METRICS, self.DATABASES_METRICS]
try:
with db.cursor(cursor_factory=pgextras.DictCursor) as cursor:
for scope in metric_sco... | [
"def",
"_collect_stats",
"(",
"self",
",",
"db",
",",
"instance_tags",
")",
":",
"metric_scope",
"=",
"[",
"self",
".",
"STATS_METRICS",
",",
"self",
".",
"POOLS_METRICS",
",",
"self",
".",
"DATABASES_METRICS",
"]",
"try",
":",
"with",
"db",
".",
"cursor",... | Query pgbouncer for various metrics | [
"Query",
"pgbouncer",
"for",
"various",
"metrics"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/pgbouncer/datadog_checks/pgbouncer/pgbouncer.py#L92-L134 | train | Query pgbouncer for various metrics and collect stats | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | pgbouncer/datadog_checks/pgbouncer/pgbouncer.py | PgBouncer._get_connect_kwargs | def _get_connect_kwargs(self, host, port, user, password, database_url):
"""
Get the params to pass to psycopg2.connect() based on passed-in vals
from yaml settings file
"""
if database_url:
return {'dsn': database_url}
if not host:
raise CheckExc... | python | def _get_connect_kwargs(self, host, port, user, password, database_url):
"""
Get the params to pass to psycopg2.connect() based on passed-in vals
from yaml settings file
"""
if database_url:
return {'dsn': database_url}
if not host:
raise CheckExc... | [
"def",
"_get_connect_kwargs",
"(",
"self",
",",
"host",
",",
"port",
",",
"user",
",",
"password",
",",
"database_url",
")",
":",
"if",
"database_url",
":",
"return",
"{",
"'dsn'",
":",
"database_url",
"}",
"if",
"not",
"host",
":",
"raise",
"CheckExceptio... | Get the params to pass to psycopg2.connect() based on passed-in vals
from yaml settings file | [
"Get",
"the",
"params",
"to",
"pass",
"to",
"psycopg2",
".",
"connect",
"()",
"based",
"on",
"passed",
"-",
"in",
"vals",
"from",
"yaml",
"settings",
"file"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/pgbouncer/datadog_checks/pgbouncer/pgbouncer.py#L136-L157 | train | Get the params to pass to psycopg2. connect | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | pgbouncer/datadog_checks/pgbouncer/pgbouncer.py | PgBouncer._get_connection | def _get_connection(self, key, host='', port='', user='', password='', database_url='', tags=None, use_cached=True):
"Get and memoize connections to instances"
if key in self.dbs and use_cached:
return self.dbs[key]
try:
connect_kwargs = self._get_connect_kwargs(
... | python | def _get_connection(self, key, host='', port='', user='', password='', database_url='', tags=None, use_cached=True):
"Get and memoize connections to instances"
if key in self.dbs and use_cached:
return self.dbs[key]
try:
connect_kwargs = self._get_connect_kwargs(
... | [
"def",
"_get_connection",
"(",
"self",
",",
"key",
",",
"host",
"=",
"''",
",",
"port",
"=",
"''",
",",
"user",
"=",
"''",
",",
"password",
"=",
"''",
",",
"database_url",
"=",
"''",
",",
"tags",
"=",
"None",
",",
"use_cached",
"=",
"True",
")",
... | Get and memoize connections to instances | [
"Get",
"and",
"memoize",
"connections",
"to",
"instances"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/pgbouncer/datadog_checks/pgbouncer/pgbouncer.py#L159-L188 | 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 | datadog_checks_base/datadog_checks/base/checks/kube_leader/record.py | ElectionRecord.seconds_until_renew | def seconds_until_renew(self):
"""
Returns the number of seconds between the current time
and the set renew time. It can be negative if the
leader election is running late.
"""
delta = self.renew_time - datetime.now(self.renew_time.tzinfo)
return delta.total_secon... | python | def seconds_until_renew(self):
"""
Returns the number of seconds between the current time
and the set renew time. It can be negative if the
leader election is running late.
"""
delta = self.renew_time - datetime.now(self.renew_time.tzinfo)
return delta.total_secon... | [
"def",
"seconds_until_renew",
"(",
"self",
")",
":",
"delta",
"=",
"self",
".",
"renew_time",
"-",
"datetime",
".",
"now",
"(",
"self",
".",
"renew_time",
".",
"tzinfo",
")",
"return",
"delta",
".",
"total_seconds",
"(",
")"
] | Returns the number of seconds between the current time
and the set renew time. It can be negative if the
leader election is running late. | [
"Returns",
"the",
"number",
"of",
"seconds",
"between",
"the",
"current",
"time",
"and",
"the",
"set",
"renew",
"time",
".",
"It",
"can",
"be",
"negative",
"if",
"the",
"leader",
"election",
"is",
"running",
"late",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/kube_leader/record.py#L76-L83 | train | Returns the number of seconds until the current time is set to the set s renew time. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py | _make_error | def _make_error(index, code, errmsg, operation):
"""Create and return an error document.
"""
return {
_UINDEX: index,
_UCODE: code,
_UERRMSG: errmsg,
_UOP: operation
} | python | def _make_error(index, code, errmsg, operation):
"""Create and return an error document.
"""
return {
_UINDEX: index,
_UCODE: code,
_UERRMSG: errmsg,
_UOP: operation
} | [
"def",
"_make_error",
"(",
"index",
",",
"code",
",",
"errmsg",
",",
"operation",
")",
":",
"return",
"{",
"_UINDEX",
":",
"index",
",",
"_UCODE",
":",
"code",
",",
"_UERRMSG",
":",
"errmsg",
",",
"_UOP",
":",
"operation",
"}"
] | Create and return an error document. | [
"Create",
"and",
"return",
"an",
"error",
"document",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L91-L99 | train | Create and return an error document. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py | _merge_legacy | def _merge_legacy(run, full_result, result, index):
"""Merge a result from a legacy opcode into the full results.
"""
affected = result.get('n', 0)
errmsg = result.get("errmsg", result.get("err", ""))
if errmsg:
# wtimeout is not considered a hard failure in
# MongoDB 2.6 so don't t... | python | def _merge_legacy(run, full_result, result, index):
"""Merge a result from a legacy opcode into the full results.
"""
affected = result.get('n', 0)
errmsg = result.get("errmsg", result.get("err", ""))
if errmsg:
# wtimeout is not considered a hard failure in
# MongoDB 2.6 so don't t... | [
"def",
"_merge_legacy",
"(",
"run",
",",
"full_result",
",",
"result",
",",
"index",
")",
":",
"affected",
"=",
"result",
".",
"get",
"(",
"'n'",
",",
"0",
")",
"errmsg",
"=",
"result",
".",
"get",
"(",
"\"errmsg\"",
",",
"result",
".",
"get",
"(",
... | Merge a result from a legacy opcode into the full results. | [
"Merge",
"a",
"result",
"from",
"a",
"legacy",
"opcode",
"into",
"the",
"full",
"results",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L102-L142 | train | Merge a result from a legacy opcode into the full 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 | tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py | _merge_command | def _merge_command(run, full_result, results):
"""Merge a group of results from write commands into the full result.
"""
for offset, result in results:
affected = result.get("n", 0)
if run.op_type == _INSERT:
full_result["nInserted"] += affected
elif run.op_type == _DE... | python | def _merge_command(run, full_result, results):
"""Merge a group of results from write commands into the full result.
"""
for offset, result in results:
affected = result.get("n", 0)
if run.op_type == _INSERT:
full_result["nInserted"] += affected
elif run.op_type == _DE... | [
"def",
"_merge_command",
"(",
"run",
",",
"full_result",
",",
"results",
")",
":",
"for",
"offset",
",",
"result",
"in",
"results",
":",
"affected",
"=",
"result",
".",
"get",
"(",
"\"n\"",
",",
"0",
")",
"if",
"run",
".",
"op_type",
"==",
"_INSERT",
... | Merge a group of results from write commands into the full result. | [
"Merge",
"a",
"group",
"of",
"results",
"from",
"write",
"commands",
"into",
"the",
"full",
"result",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L145-L198 | train | Merge a group of results from write commands into the full 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 | tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py | _Run.add | def add(self, original_index, operation):
"""Add an operation to this Run instance.
:Parameters:
- `original_index`: The original index of this operation
within a larger bulk operation.
- `operation`: The operation document.
"""
self.index_map.append(orig... | python | def add(self, original_index, operation):
"""Add an operation to this Run instance.
:Parameters:
- `original_index`: The original index of this operation
within a larger bulk operation.
- `operation`: The operation document.
"""
self.index_map.append(orig... | [
"def",
"add",
"(",
"self",
",",
"original_index",
",",
"operation",
")",
":",
"self",
".",
"index_map",
".",
"append",
"(",
"original_index",
")",
"self",
".",
"ops",
".",
"append",
"(",
"operation",
")"
] | Add an operation to this Run instance.
:Parameters:
- `original_index`: The original index of this operation
within a larger bulk operation.
- `operation`: The operation document. | [
"Add",
"an",
"operation",
"to",
"this",
"Run",
"instance",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L79-L88 | train | Adds an operation to this Run 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 | tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py | _Bulk.add_insert | def add_insert(self, document):
"""Add an insert document to the list of ops.
"""
validate_is_document_type("document", document)
# Generate ObjectId client side.
if not (isinstance(document, RawBSONDocument) or '_id' in document):
document['_id'] = ObjectId()
... | python | def add_insert(self, document):
"""Add an insert document to the list of ops.
"""
validate_is_document_type("document", document)
# Generate ObjectId client side.
if not (isinstance(document, RawBSONDocument) or '_id' in document):
document['_id'] = ObjectId()
... | [
"def",
"add_insert",
"(",
"self",
",",
"document",
")",
":",
"validate_is_document_type",
"(",
"\"document\"",
",",
"document",
")",
"# Generate ObjectId client side.",
"if",
"not",
"(",
"isinstance",
"(",
"document",
",",
"RawBSONDocument",
")",
"or",
"'_id'",
"i... | Add an insert document to the list of ops. | [
"Add",
"an",
"insert",
"document",
"to",
"the",
"list",
"of",
"ops",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L219-L226 | train | Add an insert document to the list of ops. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/bulk.py | _Bulk.add_replace | def add_replace(self, selector, replacement, upsert=False,
collation=None):
"""Create a replace document and add it to the list of ops.
"""
validate_ok_for_replace(replacement)
cmd = SON([('q', selector), ('u', replacement),
('multi', False), ('upse... | python | def add_replace(self, selector, replacement, upsert=False,
collation=None):
"""Create a replace document and add it to the list of ops.
"""
validate_ok_for_replace(replacement)
cmd = SON([('q', selector), ('u', replacement),
('multi', False), ('upse... | [
"def",
"add_replace",
"(",
"self",
",",
"selector",
",",
"replacement",
",",
"upsert",
"=",
"False",
",",
"collation",
"=",
"None",
")",
":",
"validate_ok_for_replace",
"(",
"replacement",
")",
"cmd",
"=",
"SON",
"(",
"[",
"(",
"'q'",
",",
"selector",
")... | Create a replace document and add it to the list of ops. | [
"Create",
"a",
"replace",
"document",
"and",
"add",
"it",
"to",
"the",
"list",
"of",
"ops",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L241-L252 | train | Create a replace document and add it to the list of ops. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/bulk.py | _Bulk.add_delete | def add_delete(self, selector, limit, collation=None):
"""Create a delete document and add it to the list of ops.
"""
cmd = SON([('q', selector), ('limit', limit)])
collation = validate_collation_or_none(collation)
if collation is not None:
self.uses_collation = True
... | python | def add_delete(self, selector, limit, collation=None):
"""Create a delete document and add it to the list of ops.
"""
cmd = SON([('q', selector), ('limit', limit)])
collation = validate_collation_or_none(collation)
if collation is not None:
self.uses_collation = True
... | [
"def",
"add_delete",
"(",
"self",
",",
"selector",
",",
"limit",
",",
"collation",
"=",
"None",
")",
":",
"cmd",
"=",
"SON",
"(",
"[",
"(",
"'q'",
",",
"selector",
")",
",",
"(",
"'limit'",
",",
"limit",
")",
"]",
")",
"collation",
"=",
"validate_c... | Create a delete document and add it to the list of ops. | [
"Create",
"a",
"delete",
"document",
"and",
"add",
"it",
"to",
"the",
"list",
"of",
"ops",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L254-L262 | train | Create a delete document and add it to the list of ops. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/bulk.py | _Bulk.gen_ordered | def gen_ordered(self):
"""Generate batches of operations, batched by type of
operation, in the order **provided**.
"""
run = None
for idx, (op_type, operation) in enumerate(self.ops):
if run is None:
run = _Run(op_type)
elif run.op_type != ... | python | def gen_ordered(self):
"""Generate batches of operations, batched by type of
operation, in the order **provided**.
"""
run = None
for idx, (op_type, operation) in enumerate(self.ops):
if run is None:
run = _Run(op_type)
elif run.op_type != ... | [
"def",
"gen_ordered",
"(",
"self",
")",
":",
"run",
"=",
"None",
"for",
"idx",
",",
"(",
"op_type",
",",
"operation",
")",
"in",
"enumerate",
"(",
"self",
".",
"ops",
")",
":",
"if",
"run",
"is",
"None",
":",
"run",
"=",
"_Run",
"(",
"op_type",
"... | Generate batches of operations, batched by type of
operation, in the order **provided**. | [
"Generate",
"batches",
"of",
"operations",
"batched",
"by",
"type",
"of",
"operation",
"in",
"the",
"order",
"**",
"provided",
"**",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L264-L276 | train | Generate batches of operations in the order provided. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py | _Bulk.gen_unordered | def gen_unordered(self):
"""Generate batches of operations, batched by type of
operation, in arbitrary order.
"""
operations = [_Run(_INSERT), _Run(_UPDATE), _Run(_DELETE)]
for idx, (op_type, operation) in enumerate(self.ops):
operations[op_type].add(idx, operation)
... | python | def gen_unordered(self):
"""Generate batches of operations, batched by type of
operation, in arbitrary order.
"""
operations = [_Run(_INSERT), _Run(_UPDATE), _Run(_DELETE)]
for idx, (op_type, operation) in enumerate(self.ops):
operations[op_type].add(idx, operation)
... | [
"def",
"gen_unordered",
"(",
"self",
")",
":",
"operations",
"=",
"[",
"_Run",
"(",
"_INSERT",
")",
",",
"_Run",
"(",
"_UPDATE",
")",
",",
"_Run",
"(",
"_DELETE",
")",
"]",
"for",
"idx",
",",
"(",
"op_type",
",",
"operation",
")",
"in",
"enumerate",
... | Generate batches of operations, batched by type of
operation, in arbitrary order. | [
"Generate",
"batches",
"of",
"operations",
"batched",
"by",
"type",
"of",
"operation",
"in",
"arbitrary",
"order",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L278-L288 | train | Generate batches of operations in arbitrary order. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py | _Bulk.execute_command | def execute_command(self, sock_info, generator, write_concern):
"""Execute using write commands.
"""
# nModified is only reported for write commands, not legacy ops.
full_result = {
"writeErrors": [],
"writeConcernErrors": [],
"nInserted": 0,
... | python | def execute_command(self, sock_info, generator, write_concern):
"""Execute using write commands.
"""
# nModified is only reported for write commands, not legacy ops.
full_result = {
"writeErrors": [],
"writeConcernErrors": [],
"nInserted": 0,
... | [
"def",
"execute_command",
"(",
"self",
",",
"sock_info",
",",
"generator",
",",
"write_concern",
")",
":",
"# nModified is only reported for write commands, not legacy ops.",
"full_result",
"=",
"{",
"\"writeErrors\"",
":",
"[",
"]",
",",
"\"writeConcernErrors\"",
":",
... | Execute using write commands. | [
"Execute",
"using",
"write",
"commands",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L290-L332 | train | Execute a list of bulk write commands. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/bulk.py | _Bulk.execute_no_results | def execute_no_results(self, sock_info, generator):
"""Execute all operations, returning no results (w=0).
"""
# Cannot have both unacknowledged write and bypass document validation.
if self.bypass_doc_val and sock_info.max_wire_version >= 4:
raise OperationFailure("Cannot se... | python | def execute_no_results(self, sock_info, generator):
"""Execute all operations, returning no results (w=0).
"""
# Cannot have both unacknowledged write and bypass document validation.
if self.bypass_doc_val and sock_info.max_wire_version >= 4:
raise OperationFailure("Cannot se... | [
"def",
"execute_no_results",
"(",
"self",
",",
"sock_info",
",",
"generator",
")",
":",
"# Cannot have both unacknowledged write and bypass document validation.",
"if",
"self",
".",
"bypass_doc_val",
"and",
"sock_info",
".",
"max_wire_version",
">=",
"4",
":",
"raise",
... | Execute all operations, returning no results (w=0). | [
"Execute",
"all",
"operations",
"returning",
"no",
"results",
"(",
"w",
"=",
"0",
")",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L334-L384 | train | Execute all operations returning no results. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py | _Bulk.execute_legacy | def execute_legacy(self, sock_info, generator, write_concern):
"""Execute using legacy wire protocol ops.
"""
coll = self.collection
full_result = {
"writeErrors": [],
"writeConcernErrors": [],
"nInserted": 0,
"nUpserted": 0,
"n... | python | def execute_legacy(self, sock_info, generator, write_concern):
"""Execute using legacy wire protocol ops.
"""
coll = self.collection
full_result = {
"writeErrors": [],
"writeConcernErrors": [],
"nInserted": 0,
"nUpserted": 0,
"n... | [
"def",
"execute_legacy",
"(",
"self",
",",
"sock_info",
",",
"generator",
",",
"write_concern",
")",
":",
"coll",
"=",
"self",
".",
"collection",
"full_result",
"=",
"{",
"\"writeErrors\"",
":",
"[",
"]",
",",
"\"writeConcernErrors\"",
":",
"[",
"]",
",",
... | Execute using legacy wire protocol ops. | [
"Execute",
"using",
"legacy",
"wire",
"protocol",
"ops",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L386-L463 | train | Execute legacy wire protocol ops. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/bulk.py | _Bulk.execute | def execute(self, write_concern):
"""Execute operations.
"""
if not self.ops:
raise InvalidOperation('No operations to execute')
if self.executed:
raise InvalidOperation('Bulk operations can '
'only be executed once.')
se... | python | def execute(self, write_concern):
"""Execute operations.
"""
if not self.ops:
raise InvalidOperation('No operations to execute')
if self.executed:
raise InvalidOperation('Bulk operations can '
'only be executed once.')
se... | [
"def",
"execute",
"(",
"self",
",",
"write_concern",
")",
":",
"if",
"not",
"self",
".",
"ops",
":",
"raise",
"InvalidOperation",
"(",
"'No operations to execute'",
")",
"if",
"self",
".",
"executed",
":",
"raise",
"InvalidOperation",
"(",
"'Bulk operations can ... | Execute operations. | [
"Execute",
"operations",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L465-L495 | train | Execute the bulk operation. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/bulk.py | BulkUpsertOperation.update_one | def update_one(self, update):
"""Update one document matching the selector.
:Parameters:
- `update` (dict): the update operations to apply
"""
self.__bulk.add_update(self.__selector,
update, multi=False, upsert=True,
... | python | def update_one(self, update):
"""Update one document matching the selector.
:Parameters:
- `update` (dict): the update operations to apply
"""
self.__bulk.add_update(self.__selector,
update, multi=False, upsert=True,
... | [
"def",
"update_one",
"(",
"self",
",",
"update",
")",
":",
"self",
".",
"__bulk",
".",
"add_update",
"(",
"self",
".",
"__selector",
",",
"update",
",",
"multi",
"=",
"False",
",",
"upsert",
"=",
"True",
",",
"collation",
"=",
"self",
".",
"__collation... | Update one document matching the selector.
:Parameters:
- `update` (dict): the update operations to apply | [
"Update",
"one",
"document",
"matching",
"the",
"selector",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L509-L517 | train | Update one document matching the selector. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/bulk.py | BulkUpsertOperation.replace_one | def replace_one(self, replacement):
"""Replace one entire document matching the selector criteria.
:Parameters:
- `replacement` (dict): the replacement document
"""
self.__bulk.add_replace(self.__selector, replacement, upsert=True,
collation=sel... | python | def replace_one(self, replacement):
"""Replace one entire document matching the selector criteria.
:Parameters:
- `replacement` (dict): the replacement document
"""
self.__bulk.add_replace(self.__selector, replacement, upsert=True,
collation=sel... | [
"def",
"replace_one",
"(",
"self",
",",
"replacement",
")",
":",
"self",
".",
"__bulk",
".",
"add_replace",
"(",
"self",
".",
"__selector",
",",
"replacement",
",",
"upsert",
"=",
"True",
",",
"collation",
"=",
"self",
".",
"__collation",
")"
] | Replace one entire document matching the selector criteria.
:Parameters:
- `replacement` (dict): the replacement document | [
"Replace",
"one",
"entire",
"document",
"matching",
"the",
"selector",
"criteria",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L529-L536 | train | Replace one entire document matching the selector criteria. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/bulk.py | BulkWriteOperation.remove_one | def remove_one(self):
"""Remove a single document matching the selector criteria.
"""
self.__bulk.add_delete(self.__selector, _DELETE_ONE,
collation=self.__collation) | python | def remove_one(self):
"""Remove a single document matching the selector criteria.
"""
self.__bulk.add_delete(self.__selector, _DELETE_ONE,
collation=self.__collation) | [
"def",
"remove_one",
"(",
"self",
")",
":",
"self",
".",
"__bulk",
".",
"add_delete",
"(",
"self",
".",
"__selector",
",",
"_DELETE_ONE",
",",
"collation",
"=",
"self",
".",
"__collation",
")"
] | Remove a single document matching the selector criteria. | [
"Remove",
"a",
"single",
"document",
"matching",
"the",
"selector",
"criteria",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L577-L581 | train | Remove a single document matching the selector criteria. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/bulk.py | BulkWriteOperation.remove | def remove(self):
"""Remove all documents matching the selector criteria.
"""
self.__bulk.add_delete(self.__selector, _DELETE_ALL,
collation=self.__collation) | python | def remove(self):
"""Remove all documents matching the selector criteria.
"""
self.__bulk.add_delete(self.__selector, _DELETE_ALL,
collation=self.__collation) | [
"def",
"remove",
"(",
"self",
")",
":",
"self",
".",
"__bulk",
".",
"add_delete",
"(",
"self",
".",
"__selector",
",",
"_DELETE_ALL",
",",
"collation",
"=",
"self",
".",
"__collation",
")"
] | Remove all documents matching the selector criteria. | [
"Remove",
"all",
"documents",
"matching",
"the",
"selector",
"criteria",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L583-L587 | train | Remove all documents matching the selector criteria. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/bulk.py | BulkOperationBuilder.find | def find(self, selector, collation=None):
"""Specify selection criteria for bulk operations.
:Parameters:
- `selector` (dict): the selection criteria for update
and remove operations.
- `collation` (optional): An instance of
:class:`~pymongo.collation.Collati... | python | def find(self, selector, collation=None):
"""Specify selection criteria for bulk operations.
:Parameters:
- `selector` (dict): the selection criteria for update
and remove operations.
- `collation` (optional): An instance of
:class:`~pymongo.collation.Collati... | [
"def",
"find",
"(",
"self",
",",
"selector",
",",
"collation",
"=",
"None",
")",
":",
"validate_is_mapping",
"(",
"\"selector\"",
",",
"selector",
")",
"return",
"BulkWriteOperation",
"(",
"selector",
",",
"self",
".",
"__bulk",
",",
"collation",
")"
] | Specify selection criteria for bulk operations.
:Parameters:
- `selector` (dict): the selection criteria for update
and remove operations.
- `collation` (optional): An instance of
:class:`~pymongo.collation.Collation`. This option is only
supported on Mon... | [
"Specify",
"selection",
"criteria",
"for",
"bulk",
"operations",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L635-L654 | train | Returns a new BulkWriteOperation instance that will be executed by the specified selector. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/bulk.py | BulkOperationBuilder.execute | def execute(self, write_concern=None):
"""Execute all provided operations.
:Parameters:
- write_concern (optional): the write concern for this bulk
execution.
"""
if write_concern is not None:
validate_is_mapping("write_concern", write_concern)
... | python | def execute(self, write_concern=None):
"""Execute all provided operations.
:Parameters:
- write_concern (optional): the write concern for this bulk
execution.
"""
if write_concern is not None:
validate_is_mapping("write_concern", write_concern)
... | [
"def",
"execute",
"(",
"self",
",",
"write_concern",
"=",
"None",
")",
":",
"if",
"write_concern",
"is",
"not",
"None",
":",
"validate_is_mapping",
"(",
"\"write_concern\"",
",",
"write_concern",
")",
"return",
"self",
".",
"__bulk",
".",
"execute",
"(",
"wr... | Execute all provided operations.
:Parameters:
- write_concern (optional): the write concern for this bulk
execution. | [
"Execute",
"all",
"provided",
"operations",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/bulk.py#L666-L675 | train | Execute all provided operations. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/topology.py | Topology.select_servers | def select_servers(self,
selector,
server_selection_timeout=None,
address=None):
"""Return a list of Servers matching selector, or time out.
:Parameters:
- `selector`: function that takes a list of Servers and returns
... | python | def select_servers(self,
selector,
server_selection_timeout=None,
address=None):
"""Return a list of Servers matching selector, or time out.
:Parameters:
- `selector`: function that takes a list of Servers and returns
... | [
"def",
"select_servers",
"(",
"self",
",",
"selector",
",",
"server_selection_timeout",
"=",
"None",
",",
"address",
"=",
"None",
")",
":",
"if",
"server_selection_timeout",
"is",
"None",
":",
"server_timeout",
"=",
"self",
".",
"_settings",
".",
"server_selecti... | Return a list of Servers matching selector, or time out.
:Parameters:
- `selector`: function that takes a list of Servers and returns
a subset of them.
- `server_selection_timeout` (optional): maximum seconds to wait.
If not provided, the default value common.SERVER_... | [
"Return",
"a",
"list",
"of",
"Servers",
"matching",
"selector",
"or",
"time",
"out",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py#L153-L205 | train | Returns a list of Servers matching selector or time out. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/topology.py | Topology.select_server | def select_server(self,
selector,
server_selection_timeout=None,
address=None):
"""Like select_servers, but choose a random server if several match."""
return random.choice(self.select_servers(selector,
... | python | def select_server(self,
selector,
server_selection_timeout=None,
address=None):
"""Like select_servers, but choose a random server if several match."""
return random.choice(self.select_servers(selector,
... | [
"def",
"select_server",
"(",
"self",
",",
"selector",
",",
"server_selection_timeout",
"=",
"None",
",",
"address",
"=",
"None",
")",
":",
"return",
"random",
".",
"choice",
"(",
"self",
".",
"select_servers",
"(",
"selector",
",",
"server_selection_timeout",
... | Like select_servers, but choose a random server if several match. | [
"Like",
"select_servers",
"but",
"choose",
"a",
"random",
"server",
"if",
"several",
"match",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py#L207-L214 | train | Like select_servers but choose a random server if several match. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/topology.py | Topology.on_change | def on_change(self, server_description):
"""Process a new ServerDescription after an ismaster call completes."""
# We do no I/O holding the lock.
with self._lock:
# Any monitored server was definitely in the topology description
# once. Check if it's still in the descript... | python | def on_change(self, server_description):
"""Process a new ServerDescription after an ismaster call completes."""
# We do no I/O holding the lock.
with self._lock:
# Any monitored server was definitely in the topology description
# once. Check if it's still in the descript... | [
"def",
"on_change",
"(",
"self",
",",
"server_description",
")",
":",
"# We do no I/O holding the lock.",
"with",
"self",
".",
"_lock",
":",
"# Any monitored server was definitely in the topology description",
"# once. Check if it's still in the description or if some state-",
"# cha... | Process a new ServerDescription after an ismaster call completes. | [
"Process",
"a",
"new",
"ServerDescription",
"after",
"an",
"ismaster",
"call",
"completes",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py#L239-L268 | train | Process a new ServerDescription after an ismaster call completes. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/topology.py | Topology.get_primary | def get_primary(self):
"""Return primary's address or None."""
# Implemented here in Topology instead of MongoClient, so it can lock.
with self._lock:
topology_type = self._description.topology_type
if topology_type != TOPOLOGY_TYPE.ReplicaSetWithPrimary:
... | python | def get_primary(self):
"""Return primary's address or None."""
# Implemented here in Topology instead of MongoClient, so it can lock.
with self._lock:
topology_type = self._description.topology_type
if topology_type != TOPOLOGY_TYPE.ReplicaSetWithPrimary:
... | [
"def",
"get_primary",
"(",
"self",
")",
":",
"# Implemented here in Topology instead of MongoClient, so it can lock.",
"with",
"self",
".",
"_lock",
":",
"topology_type",
"=",
"self",
".",
"_description",
".",
"topology_type",
"if",
"topology_type",
"!=",
"TOPOLOGY_TYPE",... | Return primary's address or None. | [
"Return",
"primary",
"s",
"address",
"or",
"None",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py#L283-L291 | train | Return primary s address or None. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py | Topology._get_replica_set_members | def _get_replica_set_members(self, selector):
"""Return set of replica set member addresses."""
# Implemented here in Topology instead of MongoClient, so it can lock.
with self._lock:
topology_type = self._description.topology_type
if topology_type not in (TOPOLOGY_TYPE.R... | python | def _get_replica_set_members(self, selector):
"""Return set of replica set member addresses."""
# Implemented here in Topology instead of MongoClient, so it can lock.
with self._lock:
topology_type = self._description.topology_type
if topology_type not in (TOPOLOGY_TYPE.R... | [
"def",
"_get_replica_set_members",
"(",
"self",
",",
"selector",
")",
":",
"# Implemented here in Topology instead of MongoClient, so it can lock.",
"with",
"self",
".",
"_lock",
":",
"topology_type",
"=",
"self",
".",
"_description",
".",
"topology_type",
"if",
"topology... | Return set of replica set member addresses. | [
"Return",
"set",
"of",
"replica",
"set",
"member",
"addresses",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py#L293-L302 | train | Return set of replica set member addresses. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/topology.py | Topology.request_check_all | def request_check_all(self, wait_time=5):
"""Wake all monitors, wait for at least one to check its server."""
with self._lock:
self._request_check_all()
self._condition.wait(wait_time) | python | def request_check_all(self, wait_time=5):
"""Wake all monitors, wait for at least one to check its server."""
with self._lock:
self._request_check_all()
self._condition.wait(wait_time) | [
"def",
"request_check_all",
"(",
"self",
",",
"wait_time",
"=",
"5",
")",
":",
"with",
"self",
".",
"_lock",
":",
"self",
".",
"_request_check_all",
"(",
")",
"self",
".",
"_condition",
".",
"wait",
"(",
"wait_time",
")"
] | Wake all monitors, wait for at least one to check its server. | [
"Wake",
"all",
"monitors",
"wait",
"for",
"at",
"least",
"one",
"to",
"check",
"its",
"server",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py#L312-L316 | train | Wake all monitors wait for at least one to check its 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 | tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py | Topology.reset_server_and_request_check | def reset_server_and_request_check(self, address):
"""Clear our pool for a server, mark it Unknown, and check it soon."""
with self._lock:
self._reset_server(address)
self._request_check(address) | python | def reset_server_and_request_check(self, address):
"""Clear our pool for a server, mark it Unknown, and check it soon."""
with self._lock:
self._reset_server(address)
self._request_check(address) | [
"def",
"reset_server_and_request_check",
"(",
"self",
",",
"address",
")",
":",
"with",
"self",
".",
"_lock",
":",
"self",
".",
"_reset_server",
"(",
"address",
")",
"self",
".",
"_request_check",
"(",
"address",
")"
] | Clear our pool for a server, mark it Unknown, and check it soon. | [
"Clear",
"our",
"pool",
"for",
"a",
"server",
"mark",
"it",
"Unknown",
"and",
"check",
"it",
"soon",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py#L332-L336 | train | Reset the server and request 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 | tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py | Topology.close | def close(self):
"""Clear pools and terminate monitors. Topology reopens on demand."""
with self._lock:
for server in self._servers.values():
server.close()
# Mark all servers Unknown.
self._description = self._description.reset()
self._up... | python | def close(self):
"""Clear pools and terminate monitors. Topology reopens on demand."""
with self._lock:
for server in self._servers.values():
server.close()
# Mark all servers Unknown.
self._description = self._description.reset()
self._up... | [
"def",
"close",
"(",
"self",
")",
":",
"with",
"self",
".",
"_lock",
":",
"for",
"server",
"in",
"self",
".",
"_servers",
".",
"values",
"(",
")",
":",
"server",
".",
"close",
"(",
")",
"# Mark all servers Unknown.",
"self",
".",
"_description",
"=",
"... | Clear pools and terminate monitors. Topology reopens on demand. | [
"Clear",
"pools",
"and",
"terminate",
"monitors",
".",
"Topology",
"reopens",
"on",
"demand",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py#L344-L360 | train | Clear pools and terminate monitors. Topology reopens on demand. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/topology.py | Topology._reset_server | def _reset_server(self, address):
"""Clear our pool for a server and mark it Unknown.
Hold the lock when calling this. Does *not* request an immediate check.
"""
server = self._servers.get(address)
# "server" is None if another thread removed it from the topology.
if se... | python | def _reset_server(self, address):
"""Clear our pool for a server and mark it Unknown.
Hold the lock when calling this. Does *not* request an immediate check.
"""
server = self._servers.get(address)
# "server" is None if another thread removed it from the topology.
if se... | [
"def",
"_reset_server",
"(",
"self",
",",
"address",
")",
":",
"server",
"=",
"self",
".",
"_servers",
".",
"get",
"(",
"address",
")",
"# \"server\" is None if another thread removed it from the topology.",
"if",
"server",
":",
"server",
".",
"reset",
"(",
")",
... | Clear our pool for a server and mark it Unknown.
Hold the lock when calling this. Does *not* request an immediate check. | [
"Clear",
"our",
"pool",
"for",
"a",
"server",
"and",
"mark",
"it",
"Unknown",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py#L390-L403 | train | Clear our pool for a server and mark it Unknown. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/topology.py | Topology._request_check | def _request_check(self, address):
"""Wake one monitor. Hold the lock when calling this."""
server = self._servers.get(address)
# "server" is None if another thread removed it from the topology.
if server:
server.request_check() | python | def _request_check(self, address):
"""Wake one monitor. Hold the lock when calling this."""
server = self._servers.get(address)
# "server" is None if another thread removed it from the topology.
if server:
server.request_check() | [
"def",
"_request_check",
"(",
"self",
",",
"address",
")",
":",
"server",
"=",
"self",
".",
"_servers",
".",
"get",
"(",
"address",
")",
"# \"server\" is None if another thread removed it from the topology.",
"if",
"server",
":",
"server",
".",
"request_check",
"(",... | Wake one monitor. Hold the lock when calling this. | [
"Wake",
"one",
"monitor",
".",
"Hold",
"the",
"lock",
"when",
"calling",
"this",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py#L405-L411 | train | Wake one monitor. Hold the lock when calling this. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/topology.py | Topology._update_servers | def _update_servers(self):
"""Sync our Servers from TopologyDescription.server_descriptions.
Hold the lock while calling this.
"""
for address, sd in self._description.server_descriptions().items():
if address not in self._servers:
monitor = self._settings.mo... | python | def _update_servers(self):
"""Sync our Servers from TopologyDescription.server_descriptions.
Hold the lock while calling this.
"""
for address, sd in self._description.server_descriptions().items():
if address not in self._servers:
monitor = self._settings.mo... | [
"def",
"_update_servers",
"(",
"self",
")",
":",
"for",
"address",
",",
"sd",
"in",
"self",
".",
"_description",
".",
"server_descriptions",
"(",
")",
".",
"items",
"(",
")",
":",
"if",
"address",
"not",
"in",
"self",
".",
"_servers",
":",
"monitor",
"... | Sync our Servers from TopologyDescription.server_descriptions.
Hold the lock while calling this. | [
"Sync",
"our",
"Servers",
"from",
"TopologyDescription",
".",
"server_descriptions",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py#L418-L450 | train | Sync our Servers from TopologyDescription. server_descriptions. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/topology.py | Topology._error_message | def _error_message(self, selector):
"""Format an error message if server selection fails.
Hold the lock when calling this.
"""
is_replica_set = self._description.topology_type in (
TOPOLOGY_TYPE.ReplicaSetWithPrimary,
TOPOLOGY_TYPE.ReplicaSetNoPrimary)
i... | python | def _error_message(self, selector):
"""Format an error message if server selection fails.
Hold the lock when calling this.
"""
is_replica_set = self._description.topology_type in (
TOPOLOGY_TYPE.ReplicaSetWithPrimary,
TOPOLOGY_TYPE.ReplicaSetNoPrimary)
i... | [
"def",
"_error_message",
"(",
"self",
",",
"selector",
")",
":",
"is_replica_set",
"=",
"self",
".",
"_description",
".",
"topology_type",
"in",
"(",
"TOPOLOGY_TYPE",
".",
"ReplicaSetWithPrimary",
",",
"TOPOLOGY_TYPE",
".",
"ReplicaSetNoPrimary",
")",
"if",
"is_re... | Format an error message if server selection fails.
Hold the lock when calling this. | [
"Format",
"an",
"error",
"message",
"if",
"server",
"selection",
"fails",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/topology.py#L472-L527 | train | Format an error message for the server selection fails. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | vsphere/datadog_checks/vsphere/mor_cache.py | MorCache.init_instance | def init_instance(self, key):
"""
Create an empty instance if it doesn't exist.
If the instance already exists, this is a noop.
"""
with self._mor_lock:
if key not in self._mor:
self._mor[key] = {} | python | def init_instance(self, key):
"""
Create an empty instance if it doesn't exist.
If the instance already exists, this is a noop.
"""
with self._mor_lock:
if key not in self._mor:
self._mor[key] = {} | [
"def",
"init_instance",
"(",
"self",
",",
"key",
")",
":",
"with",
"self",
".",
"_mor_lock",
":",
"if",
"key",
"not",
"in",
"self",
".",
"_mor",
":",
"self",
".",
"_mor",
"[",
"key",
"]",
"=",
"{",
"}"
] | Create an empty instance if it doesn't exist.
If the instance already exists, this is a noop. | [
"Create",
"an",
"empty",
"instance",
"if",
"it",
"doesn",
"t",
"exist",
".",
"If",
"the",
"instance",
"already",
"exists",
"this",
"is",
"a",
"noop",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/mor_cache.py#L24-L31 | train | Create an empty instance if it doesn t exist. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | vsphere/datadog_checks/vsphere/mor_cache.py | MorCache.set_mor | def set_mor(self, key, name, mor):
"""
Store a Mor object in the cache with the given name.
If the key is not in the cache, raises a KeyError.
"""
with self._mor_lock:
self._mor[key][name] = mor
self._mor[key][name]['creation_time'] = time.time() | python | def set_mor(self, key, name, mor):
"""
Store a Mor object in the cache with the given name.
If the key is not in the cache, raises a KeyError.
"""
with self._mor_lock:
self._mor[key][name] = mor
self._mor[key][name]['creation_time'] = time.time() | [
"def",
"set_mor",
"(",
"self",
",",
"key",
",",
"name",
",",
"mor",
")",
":",
"with",
"self",
".",
"_mor_lock",
":",
"self",
".",
"_mor",
"[",
"key",
"]",
"[",
"name",
"]",
"=",
"mor",
"self",
".",
"_mor",
"[",
"key",
"]",
"[",
"name",
"]",
"... | Store a Mor object in the cache with the given name.
If the key is not in the cache, raises a KeyError. | [
"Store",
"a",
"Mor",
"object",
"in",
"the",
"cache",
"with",
"the",
"given",
"name",
".",
"If",
"the",
"key",
"is",
"not",
"in",
"the",
"cache",
"raises",
"a",
"KeyError",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/mor_cache.py#L48-L55 | train | Store a Mor object in the cache with the given name. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | vsphere/datadog_checks/vsphere/mor_cache.py | MorCache.get_mor | def get_mor(self, key, name):
"""
Return the Mor object identified by `name` for the given instance key.
If the key is not in the cache, raises a KeyError.
If there's no Mor with the given name, raises a MorNotFoundError.
"""
with self._mor_lock:
mors = self._... | python | def get_mor(self, key, name):
"""
Return the Mor object identified by `name` for the given instance key.
If the key is not in the cache, raises a KeyError.
If there's no Mor with the given name, raises a MorNotFoundError.
"""
with self._mor_lock:
mors = self._... | [
"def",
"get_mor",
"(",
"self",
",",
"key",
",",
"name",
")",
":",
"with",
"self",
".",
"_mor_lock",
":",
"mors",
"=",
"self",
".",
"_mor",
"[",
"key",
"]",
"try",
":",
"return",
"mors",
"[",
"name",
"]",
"except",
"KeyError",
":",
"raise",
"MorNotF... | Return the Mor object identified by `name` for the given instance key.
If the key is not in the cache, raises a KeyError.
If there's no Mor with the given name, raises a MorNotFoundError. | [
"Return",
"the",
"Mor",
"object",
"identified",
"by",
"name",
"for",
"the",
"given",
"instance",
"key",
".",
"If",
"the",
"key",
"is",
"not",
"in",
"the",
"cache",
"raises",
"a",
"KeyError",
".",
"If",
"there",
"s",
"no",
"Mor",
"with",
"the",
"given",... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/mor_cache.py#L57-L68 | train | Returns the Mor object identified by name for the given instance 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 | vsphere/datadog_checks/vsphere/mor_cache.py | MorCache.set_metrics | def set_metrics(self, key, name, metrics):
"""
Store a list of metric identifiers for the given instance key and Mor
object name.
If the key is not in the cache, raises a KeyError.
If the Mor object is not in the cache, raises a MorNotFoundError
"""
with self._mor... | python | def set_metrics(self, key, name, metrics):
"""
Store a list of metric identifiers for the given instance key and Mor
object name.
If the key is not in the cache, raises a KeyError.
If the Mor object is not in the cache, raises a MorNotFoundError
"""
with self._mor... | [
"def",
"set_metrics",
"(",
"self",
",",
"key",
",",
"name",
",",
"metrics",
")",
":",
"with",
"self",
".",
"_mor_lock",
":",
"mor",
"=",
"self",
".",
"_mor",
"[",
"key",
"]",
".",
"get",
"(",
"name",
")",
"if",
"mor",
"is",
"None",
":",
"raise",
... | Store a list of metric identifiers for the given instance key and Mor
object name.
If the key is not in the cache, raises a KeyError.
If the Mor object is not in the cache, raises a MorNotFoundError | [
"Store",
"a",
"list",
"of",
"metric",
"identifiers",
"for",
"the",
"given",
"instance",
"key",
"and",
"Mor",
"object",
"name",
".",
"If",
"the",
"key",
"is",
"not",
"in",
"the",
"cache",
"raises",
"a",
"KeyError",
".",
"If",
"the",
"Mor",
"object",
"is... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/mor_cache.py#L70-L81 | train | Sets the list of metric identifiers for the given instance key and Mor object 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 | vsphere/datadog_checks/vsphere/mor_cache.py | MorCache.mors | def mors(self, key):
"""
Generator returning all the mors in the cache for the given instance key.
"""
with self._mor_lock:
for k, v in iteritems(self._mor.get(key, {})):
yield k, v | python | def mors(self, key):
"""
Generator returning all the mors in the cache for the given instance key.
"""
with self._mor_lock:
for k, v in iteritems(self._mor.get(key, {})):
yield k, v | [
"def",
"mors",
"(",
"self",
",",
"key",
")",
":",
"with",
"self",
".",
"_mor_lock",
":",
"for",
"k",
",",
"v",
"in",
"iteritems",
"(",
"self",
".",
"_mor",
".",
"get",
"(",
"key",
",",
"{",
"}",
")",
")",
":",
"yield",
"k",
",",
"v"
] | Generator returning all the mors in the cache for the given instance key. | [
"Generator",
"returning",
"all",
"the",
"mors",
"in",
"the",
"cache",
"for",
"the",
"given",
"instance",
"key",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/mor_cache.py#L83-L89 | train | Generator returning all the mors in the cache for the given instance 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 | vsphere/datadog_checks/vsphere/mor_cache.py | MorCache.mors_batch | def mors_batch(self, key, batch_size):
"""
Generator returning as many dictionaries containing `batch_size` Mor
objects as needed to iterate all the content of the cache. This has
to be iterated twice, like:
for batch in cache.mors_batch('key', 100):
for name... | python | def mors_batch(self, key, batch_size):
"""
Generator returning as many dictionaries containing `batch_size` Mor
objects as needed to iterate all the content of the cache. This has
to be iterated twice, like:
for batch in cache.mors_batch('key', 100):
for name... | [
"def",
"mors_batch",
"(",
"self",
",",
"key",
",",
"batch_size",
")",
":",
"with",
"self",
".",
"_mor_lock",
":",
"mors_dict",
"=",
"self",
".",
"_mor",
".",
"get",
"(",
"key",
")",
"if",
"mors_dict",
"is",
"None",
":",
"yield",
"{",
"}",
"mor_names"... | Generator returning as many dictionaries containing `batch_size` Mor
objects as needed to iterate all the content of the cache. This has
to be iterated twice, like:
for batch in cache.mors_batch('key', 100):
for name, mor in batch:
# use the Mor object he... | [
"Generator",
"returning",
"as",
"many",
"dictionaries",
"containing",
"batch_size",
"Mor",
"objects",
"as",
"needed",
"to",
"iterate",
"all",
"the",
"content",
"of",
"the",
"cache",
".",
"This",
"has",
"to",
"be",
"iterated",
"twice",
"like",
":"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/mor_cache.py#L91-L111 | train | Generator returning as many Mor objects as needed to iterate all the content of the cache. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | vsphere/datadog_checks/vsphere/mor_cache.py | MorCache.purge | def purge(self, key, ttl):
"""
Remove all the items in the cache for the given key that are older than
ttl seconds.
If the key is not in the cache, raises a KeyError.
"""
mors_to_purge = []
now = time.time()
with self._mor_lock:
# Don't change ... | python | def purge(self, key, ttl):
"""
Remove all the items in the cache for the given key that are older than
ttl seconds.
If the key is not in the cache, raises a KeyError.
"""
mors_to_purge = []
now = time.time()
with self._mor_lock:
# Don't change ... | [
"def",
"purge",
"(",
"self",
",",
"key",
",",
"ttl",
")",
":",
"mors_to_purge",
"=",
"[",
"]",
"now",
"=",
"time",
".",
"time",
"(",
")",
"with",
"self",
".",
"_mor_lock",
":",
"# Don't change the dict during iteration!",
"# First collect the names of the Mors t... | Remove all the items in the cache for the given key that are older than
ttl seconds.
If the key is not in the cache, raises a KeyError. | [
"Remove",
"all",
"the",
"items",
"in",
"the",
"cache",
"for",
"the",
"given",
"key",
"that",
"are",
"older",
"than",
"ttl",
"seconds",
".",
"If",
"the",
"key",
"is",
"not",
"in",
"the",
"cache",
"raises",
"a",
"KeyError",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/vsphere/datadog_checks/vsphere/mor_cache.py#L113-L131 | train | Remove all the items in the cache for the given key that are older than ttl seconds. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | envoy/datadog_checks/envoy/parser.py | parse_metric | def parse_metric(metric, metric_mapping=METRIC_TREE):
"""Takes a metric formatted by Envoy and splits it into a unique
metric name. Returns the unique metric name, a list of tags, and
the name of the submission method.
Example:
'listener.0.0.0.0_80.downstream_cx_total' ->
('listener.dow... | python | def parse_metric(metric, metric_mapping=METRIC_TREE):
"""Takes a metric formatted by Envoy and splits it into a unique
metric name. Returns the unique metric name, a list of tags, and
the name of the submission method.
Example:
'listener.0.0.0.0_80.downstream_cx_total' ->
('listener.dow... | [
"def",
"parse_metric",
"(",
"metric",
",",
"metric_mapping",
"=",
"METRIC_TREE",
")",
":",
"metric_parts",
"=",
"[",
"]",
"tag_names",
"=",
"[",
"]",
"tag_values",
"=",
"[",
"]",
"tag_builder",
"=",
"[",
"]",
"unknown_tags",
"=",
"[",
"]",
"num_tags",
"=... | Takes a metric formatted by Envoy and splits it into a unique
metric name. Returns the unique metric name, a list of tags, and
the name of the submission method.
Example:
'listener.0.0.0.0_80.downstream_cx_total' ->
('listener.downstream_cx_total', ['address:0.0.0.0_80'], 'count') | [
"Takes",
"a",
"metric",
"formatted",
"by",
"Envoy",
"and",
"splits",
"it",
"into",
"a",
"unique",
"metric",
"name",
".",
"Returns",
"the",
"unique",
"metric",
"name",
"a",
"list",
"of",
"tags",
"and",
"the",
"name",
"of",
"the",
"submission",
"method",
"... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/envoy/datadog_checks/envoy/parser.py#L23-L88 | train | Takes a metric formatted by Envoy and splits it into a unique taxonomy and returns the unique taxonomy name a list of tags and a unique taxonomy name. Returns the unique taxonomy name a list of tags and a unique taxonomy 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 | envoy/datadog_checks/envoy/parser.py | parse_histogram | def parse_histogram(metric, histogram):
"""Iterates over histogram data, yielding metric-value pairs."""
for match in HISTOGRAM.finditer(histogram):
percentile, value = match.groups()
value = float(value)
if not isnan(value):
try:
yield metric + PERCENTILE_SU... | python | def parse_histogram(metric, histogram):
"""Iterates over histogram data, yielding metric-value pairs."""
for match in HISTOGRAM.finditer(histogram):
percentile, value = match.groups()
value = float(value)
if not isnan(value):
try:
yield metric + PERCENTILE_SU... | [
"def",
"parse_histogram",
"(",
"metric",
",",
"histogram",
")",
":",
"for",
"match",
"in",
"HISTOGRAM",
".",
"finditer",
"(",
"histogram",
")",
":",
"percentile",
",",
"value",
"=",
"match",
".",
"groups",
"(",
")",
"value",
"=",
"float",
"(",
"value",
... | Iterates over histogram data, yielding metric-value pairs. | [
"Iterates",
"over",
"histogram",
"data",
"yielding",
"metric",
"-",
"value",
"pairs",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/envoy/datadog_checks/envoy/parser.py#L106-L118 | train | Iterates over histogram data yielding metric - 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 | tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py | GridFS.put | def put(self, data, **kwargs):
"""Put data in GridFS as a new file.
Equivalent to doing::
try:
f = new_file(**kwargs)
f.write(data)
finally:
f.close()
`data` can be either an instance of :class:`str` (:class:`bytes`
in pyth... | python | def put(self, data, **kwargs):
"""Put data in GridFS as a new file.
Equivalent to doing::
try:
f = new_file(**kwargs)
f.write(data)
finally:
f.close()
`data` can be either an instance of :class:`str` (:class:`bytes`
in pyth... | [
"def",
"put",
"(",
"self",
",",
"data",
",",
"*",
"*",
"kwargs",
")",
":",
"grid_file",
"=",
"GridIn",
"(",
"self",
".",
"__collection",
",",
"*",
"*",
"kwargs",
")",
"try",
":",
"grid_file",
".",
"write",
"(",
"data",
")",
"finally",
":",
"grid_fi... | Put data in GridFS as a new file.
Equivalent to doing::
try:
f = new_file(**kwargs)
f.write(data)
finally:
f.close()
`data` can be either an instance of :class:`str` (:class:`bytes`
in python 3) or a file-like object providing a :m... | [
"Put",
"data",
"in",
"GridFS",
"as",
"a",
"new",
"file",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py#L89-L126 | train | Put data in GridFS as a new file. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py | GridFS.delete | def delete(self, file_id):
"""Delete a file from GridFS by ``"_id"``.
Deletes all data belonging to the file with ``"_id"``:
`file_id`.
.. warning:: Any processes/threads reading from the file while
this method is executing will likely see an invalid/corrupt
file.... | python | def delete(self, file_id):
"""Delete a file from GridFS by ``"_id"``.
Deletes all data belonging to the file with ``"_id"``:
`file_id`.
.. warning:: Any processes/threads reading from the file while
this method is executing will likely see an invalid/corrupt
file.... | [
"def",
"delete",
"(",
"self",
",",
"file_id",
")",
":",
"self",
".",
"__files",
".",
"delete_one",
"(",
"{",
"\"_id\"",
":",
"file_id",
"}",
")",
"self",
".",
"__chunks",
".",
"delete_many",
"(",
"{",
"\"files_id\"",
":",
"file_id",
"}",
")"
] | Delete a file from GridFS by ``"_id"``.
Deletes all data belonging to the file with ``"_id"``:
`file_id`.
.. warning:: Any processes/threads reading from the file while
this method is executing will likely see an invalid/corrupt
file. Care should be taken to avoid concurr... | [
"Delete",
"a",
"file",
"from",
"GridFS",
"by",
"_id",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py#L203-L224 | train | Delete a file from GridFS 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 | tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py | GridFS.find_one | def find_one(self, filter=None, *args, **kwargs):
"""Get a single file from gridfs.
All arguments to :meth:`find` are also valid arguments for
:meth:`find_one`, although any `limit` argument will be
ignored. Returns a single :class:`~gridfs.grid_file.GridOut`,
or ``None`` if no ... | python | def find_one(self, filter=None, *args, **kwargs):
"""Get a single file from gridfs.
All arguments to :meth:`find` are also valid arguments for
:meth:`find_one`, although any `limit` argument will be
ignored. Returns a single :class:`~gridfs.grid_file.GridOut`,
or ``None`` if no ... | [
"def",
"find_one",
"(",
"self",
",",
"filter",
"=",
"None",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"filter",
"is",
"not",
"None",
"and",
"not",
"isinstance",
"(",
"filter",
",",
"Mapping",
")",
":",
"filter",
"=",
"{",
"\"_id\""... | Get a single file from gridfs.
All arguments to :meth:`find` are also valid arguments for
:meth:`find_one`, although any `limit` argument will be
ignored. Returns a single :class:`~gridfs.grid_file.GridOut`,
or ``None`` if no matching file is found. For example::
file = fs.... | [
"Get",
"a",
"single",
"file",
"from",
"gridfs",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py#L239-L264 | train | Returns a single file from gridfs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py | GridFS.exists | def exists(self, document_or_id=None, **kwargs):
"""Check if a file exists in this instance of :class:`GridFS`.
The file to check for can be specified by the value of its
``_id`` key, or by passing in a query document. A query
document can be passed in as dictionary, or by using keyword... | python | def exists(self, document_or_id=None, **kwargs):
"""Check if a file exists in this instance of :class:`GridFS`.
The file to check for can be specified by the value of its
``_id`` key, or by passing in a query document. A query
document can be passed in as dictionary, or by using keyword... | [
"def",
"exists",
"(",
"self",
",",
"document_or_id",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"kwargs",
":",
"return",
"self",
".",
"__files",
".",
"find_one",
"(",
"kwargs",
",",
"[",
"\"_id\"",
"]",
")",
"is",
"not",
"None",
"return",
... | Check if a file exists in this instance of :class:`GridFS`.
The file to check for can be specified by the value of its
``_id`` key, or by passing in a query document. A query
document can be passed in as dictionary, or by using keyword
arguments. Thus, the following three calls are equi... | [
"Check",
"if",
"a",
"file",
"exists",
"in",
"this",
"instance",
"of",
":",
"class",
":",
"GridFS",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py#L323-L358 | train | Check if a file exists in this instance of GridFS. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py | GridFSBucket.open_upload_stream | def open_upload_stream(self, filename, chunk_size_bytes=None,
metadata=None):
"""Opens a Stream that the application can write the contents of the
file to.
The user must specify the filename, and can choose to add any
additional information in the metadata fie... | python | def open_upload_stream(self, filename, chunk_size_bytes=None,
metadata=None):
"""Opens a Stream that the application can write the contents of the
file to.
The user must specify the filename, and can choose to add any
additional information in the metadata fie... | [
"def",
"open_upload_stream",
"(",
"self",
",",
"filename",
",",
"chunk_size_bytes",
"=",
"None",
",",
"metadata",
"=",
"None",
")",
":",
"validate_string",
"(",
"\"filename\"",
",",
"filename",
")",
"opts",
"=",
"{",
"\"filename\"",
":",
"filename",
",",
"\"... | Opens a Stream that the application can write the contents of the
file to.
The user must specify the filename, and can choose to add any
additional information in the metadata field of the file document or
modify the chunk size.
For example::
my_db = MongoClient().tes... | [
"Opens",
"a",
"Stream",
"that",
"the",
"application",
"can",
"write",
"the",
"contents",
"of",
"the",
"file",
"to",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py#L411-L451 | train | Opens a Stream that the application can write the contents of the file 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 | tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py | GridFSBucket.open_upload_stream_with_id | def open_upload_stream_with_id(
self, file_id, filename, chunk_size_bytes=None, metadata=None):
"""Opens a Stream that the application can write the contents of the
file to.
The user must specify the file id and filename, and can choose to add
any additional information in t... | python | def open_upload_stream_with_id(
self, file_id, filename, chunk_size_bytes=None, metadata=None):
"""Opens a Stream that the application can write the contents of the
file to.
The user must specify the file id and filename, and can choose to add
any additional information in t... | [
"def",
"open_upload_stream_with_id",
"(",
"self",
",",
"file_id",
",",
"filename",
",",
"chunk_size_bytes",
"=",
"None",
",",
"metadata",
"=",
"None",
")",
":",
"validate_string",
"(",
"\"filename\"",
",",
"filename",
")",
"opts",
"=",
"{",
"\"_id\"",
":",
"... | Opens a Stream that the application can write the contents of the
file to.
The user must specify the file id and filename, and can choose to add
any additional information in the metadata field of the file document
or modify the chunk size.
For example::
my_db = Mongo... | [
"Opens",
"a",
"Stream",
"that",
"the",
"application",
"can",
"write",
"the",
"contents",
"of",
"the",
"file",
"to",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py#L453-L498 | train | Opens a Stream that the application can write the contents of the file 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 | tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py | GridFSBucket.upload_from_stream_with_id | def upload_from_stream_with_id(self, file_id, filename, source,
chunk_size_bytes=None, metadata=None):
"""Uploads a user file to a GridFS bucket with a custom file id.
Reads the contents of the user file from `source` and uploads
it to the file `filename`. Sou... | python | def upload_from_stream_with_id(self, file_id, filename, source,
chunk_size_bytes=None, metadata=None):
"""Uploads a user file to a GridFS bucket with a custom file id.
Reads the contents of the user file from `source` and uploads
it to the file `filename`. Sou... | [
"def",
"upload_from_stream_with_id",
"(",
"self",
",",
"file_id",
",",
"filename",
",",
"source",
",",
"chunk_size_bytes",
"=",
"None",
",",
"metadata",
"=",
"None",
")",
":",
"with",
"self",
".",
"open_upload_stream_with_id",
"(",
"file_id",
",",
"filename",
... | Uploads a user file to a GridFS bucket with a custom file id.
Reads the contents of the user file from `source` and uploads
it to the file `filename`. Source can be a string or file-like object.
For example::
my_db = MongoClient().test
fs = GridFSBucket(my_db)
fil... | [
"Uploads",
"a",
"user",
"file",
"to",
"a",
"GridFS",
"bucket",
"with",
"a",
"custom",
"file",
"id",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py#L538-L573 | train | Uploads a user file from a stream to a GridFS bucket with a custom file 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 | tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py | GridFSBucket.open_download_stream | def open_download_stream(self, file_id):
"""Opens a Stream from which the application can read the contents of
the stored file specified by file_id.
For example::
my_db = MongoClient().test
fs = GridFSBucket(my_db)
# get _id of file to read.
file_id = fs... | python | def open_download_stream(self, file_id):
"""Opens a Stream from which the application can read the contents of
the stored file specified by file_id.
For example::
my_db = MongoClient().test
fs = GridFSBucket(my_db)
# get _id of file to read.
file_id = fs... | [
"def",
"open_download_stream",
"(",
"self",
",",
"file_id",
")",
":",
"gout",
"=",
"GridOut",
"(",
"self",
".",
"_collection",
",",
"file_id",
")",
"# Raise NoFile now, instead of on first attribute access.",
"gout",
".",
"_ensure_file",
"(",
")",
"return",
"gout"
] | Opens a Stream from which the application can read the contents of
the stored file specified by file_id.
For example::
my_db = MongoClient().test
fs = GridFSBucket(my_db)
# get _id of file to read.
file_id = fs.upload_from_stream("test_file", "data I want to sto... | [
"Opens",
"a",
"Stream",
"from",
"which",
"the",
"application",
"can",
"read",
"the",
"contents",
"of",
"the",
"stored",
"file",
"specified",
"by",
"file_id",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py#L575-L599 | train | Opens a Stream from which the application can read the contents of
the stored file specified by file_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 | tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py | GridFSBucket.download_to_stream | def download_to_stream(self, file_id, destination):
"""Downloads the contents of the stored file specified by file_id and
writes the contents to `destination`.
For example::
my_db = MongoClient().test
fs = GridFSBucket(my_db)
# Get _id of file to read
fi... | python | def download_to_stream(self, file_id, destination):
"""Downloads the contents of the stored file specified by file_id and
writes the contents to `destination`.
For example::
my_db = MongoClient().test
fs = GridFSBucket(my_db)
# Get _id of file to read
fi... | [
"def",
"download_to_stream",
"(",
"self",
",",
"file_id",
",",
"destination",
")",
":",
"gout",
"=",
"self",
".",
"open_download_stream",
"(",
"file_id",
")",
"for",
"chunk",
"in",
"gout",
":",
"destination",
".",
"write",
"(",
"chunk",
")"
] | Downloads the contents of the stored file specified by file_id and
writes the contents to `destination`.
For example::
my_db = MongoClient().test
fs = GridFSBucket(my_db)
# Get _id of file to read
file_id = fs.upload_from_stream("test_file", "data I want to stor... | [
"Downloads",
"the",
"contents",
"of",
"the",
"stored",
"file",
"specified",
"by",
"file_id",
"and",
"writes",
"the",
"contents",
"to",
"destination",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py#L601-L625 | train | Downloads the contents of the stored file specified by file_id and writes the contents to destination. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py | GridFSBucket.delete | def delete(self, file_id):
"""Given an file_id, delete this stored file's files collection document
and associated chunks from a GridFS bucket.
For example::
my_db = MongoClient().test
fs = GridFSBucket(my_db)
# Get _id of file to delete
file_id = fs.upl... | python | def delete(self, file_id):
"""Given an file_id, delete this stored file's files collection document
and associated chunks from a GridFS bucket.
For example::
my_db = MongoClient().test
fs = GridFSBucket(my_db)
# Get _id of file to delete
file_id = fs.upl... | [
"def",
"delete",
"(",
"self",
",",
"file_id",
")",
":",
"res",
"=",
"self",
".",
"_files",
".",
"delete_one",
"(",
"{",
"\"_id\"",
":",
"file_id",
"}",
")",
"self",
".",
"_chunks",
".",
"delete_many",
"(",
"{",
"\"files_id\"",
":",
"file_id",
"}",
")... | Given an file_id, delete this stored file's files collection document
and associated chunks from a GridFS bucket.
For example::
my_db = MongoClient().test
fs = GridFSBucket(my_db)
# Get _id of file to delete
file_id = fs.upload_from_stream("test_file", "data I w... | [
"Given",
"an",
"file_id",
"delete",
"this",
"stored",
"file",
"s",
"files",
"collection",
"document",
"and",
"associated",
"chunks",
"from",
"a",
"GridFS",
"bucket",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py#L627-L648 | train | Given an file_id delete this stored file s files collection document
and associated chunks from a GridFS bucket. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py | GridFSBucket.open_download_stream_by_name | def open_download_stream_by_name(self, filename, revision=-1):
"""Opens a Stream from which the application can read the contents of
`filename` and optional `revision`.
For example::
my_db = MongoClient().test
fs = GridFSBucket(my_db)
grid_out = fs.open_download_s... | python | def open_download_stream_by_name(self, filename, revision=-1):
"""Opens a Stream from which the application can read the contents of
`filename` and optional `revision`.
For example::
my_db = MongoClient().test
fs = GridFSBucket(my_db)
grid_out = fs.open_download_s... | [
"def",
"open_download_stream_by_name",
"(",
"self",
",",
"filename",
",",
"revision",
"=",
"-",
"1",
")",
":",
"validate_string",
"(",
"\"filename\"",
",",
"filename",
")",
"query",
"=",
"{",
"\"filename\"",
":",
"filename",
"}",
"cursor",
"=",
"self",
".",
... | Opens a Stream from which the application can read the contents of
`filename` and optional `revision`.
For example::
my_db = MongoClient().test
fs = GridFSBucket(my_db)
grid_out = fs.open_download_stream_by_name("test_file")
contents = grid_out.read()
R... | [
"Opens",
"a",
"Stream",
"from",
"which",
"the",
"application",
"can",
"read",
"the",
"contents",
"of",
"filename",
"and",
"optional",
"revision",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/gridfs/__init__.py#L694-L742 | train | Opens a Stream from which the application can read the contents of the specified 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/commands/env/ls.py | ls | def ls(checks):
"""List active or available environments."""
if checks:
checks = sorted(get_testable_checks() & set(checks))
for check in checks:
envs = get_available_tox_envs(check, e2e_only=True)
if envs:
echo_success('{}:'.format(check))
... | python | def ls(checks):
"""List active or available environments."""
if checks:
checks = sorted(get_testable_checks() & set(checks))
for check in checks:
envs = get_available_tox_envs(check, e2e_only=True)
if envs:
echo_success('{}:'.format(check))
... | [
"def",
"ls",
"(",
"checks",
")",
":",
"if",
"checks",
":",
"checks",
"=",
"sorted",
"(",
"get_testable_checks",
"(",
")",
"&",
"set",
"(",
"checks",
")",
")",
"for",
"check",
"in",
"checks",
":",
"envs",
"=",
"get_available_tox_envs",
"(",
"check",
","... | List active or available environments. | [
"List",
"active",
"or",
"available",
"environments",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/env/ls.py#L14-L34 | train | List active or available environments. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | haproxy/datadog_checks/haproxy/haproxy.py | HAProxy._fetch_url_data | def _fetch_url_data(self, url, username, password, verify, custom_headers):
''' Hit a given http url and return the stats lines '''
# Try to fetch data from the stats URL
auth = (username, password)
url = "%s%s" % (url, STATS_URL)
custom_headers.update(headers(self.agentConfig))... | python | def _fetch_url_data(self, url, username, password, verify, custom_headers):
''' Hit a given http url and return the stats lines '''
# Try to fetch data from the stats URL
auth = (username, password)
url = "%s%s" % (url, STATS_URL)
custom_headers.update(headers(self.agentConfig))... | [
"def",
"_fetch_url_data",
"(",
"self",
",",
"url",
",",
"username",
",",
"password",
",",
"verify",
",",
"custom_headers",
")",
":",
"# Try to fetch data from the stats URL",
"auth",
"=",
"(",
"username",
",",
"password",
")",
"url",
"=",
"\"%s%s\"",
"%",
"(",... | Hit a given http url and return the stats lines | [
"Hit",
"a",
"given",
"http",
"url",
"and",
"return",
"the",
"stats",
"lines"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/haproxy/datadog_checks/haproxy/haproxy.py#L163-L191 | train | Fetch stats from a given http url and return the stats lines | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | haproxy/datadog_checks/haproxy/haproxy.py | HAProxy._fetch_socket_data | def _fetch_socket_data(self, parsed_url):
''' Hit a given stats socket and return the stats lines '''
self.log.debug("Fetching haproxy stats from socket: %s" % parsed_url.geturl())
if parsed_url.scheme == 'tcp':
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s... | python | def _fetch_socket_data(self, parsed_url):
''' Hit a given stats socket and return the stats lines '''
self.log.debug("Fetching haproxy stats from socket: %s" % parsed_url.geturl())
if parsed_url.scheme == 'tcp':
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s... | [
"def",
"_fetch_socket_data",
"(",
"self",
",",
"parsed_url",
")",
":",
"self",
".",
"log",
".",
"debug",
"(",
"\"Fetching haproxy stats from socket: %s\"",
"%",
"parsed_url",
".",
"geturl",
"(",
")",
")",
"if",
"parsed_url",
".",
"scheme",
"==",
"'tcp'",
":",
... | Hit a given stats socket and return the stats lines | [
"Hit",
"a",
"given",
"stats",
"socket",
"and",
"return",
"the",
"stats",
"lines"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/haproxy/datadog_checks/haproxy/haproxy.py#L193-L217 | train | Fetch the stats lines from a given stats socket and return the stats lines | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | haproxy/datadog_checks/haproxy/haproxy.py | HAProxy._process_data | def _process_data(
self,
data,
collect_aggregates_only,
process_events,
url=None,
collect_status_metrics=False,
collect_status_metrics_by_host=False,
tag_service_check_by_host=False,
services_incl_filter=None,
services_excl_filter=None,
... | python | def _process_data(
self,
data,
collect_aggregates_only,
process_events,
url=None,
collect_status_metrics=False,
collect_status_metrics_by_host=False,
tag_service_check_by_host=False,
services_incl_filter=None,
services_excl_filter=None,
... | [
"def",
"_process_data",
"(",
"self",
",",
"data",
",",
"collect_aggregates_only",
",",
"process_events",
",",
"url",
"=",
"None",
",",
"collect_status_metrics",
"=",
"False",
",",
"collect_status_metrics_by_host",
"=",
"False",
",",
"tag_service_check_by_host",
"=",
... | Main data-processing loop. For each piece of useful data, we'll
either save a metric, save an event or both. | [
"Main",
"data",
"-",
"processing",
"loop",
".",
"For",
"each",
"piece",
"of",
"useful",
"data",
"we",
"ll",
"either",
"save",
"a",
"metric",
"save",
"an",
"event",
"or",
"both",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/haproxy/datadog_checks/haproxy/haproxy.py#L219-L339 | train | Process the data for the current entry - set of known hosts. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | haproxy/datadog_checks/haproxy/haproxy.py | HAProxy._update_data_dict | def _update_data_dict(self, data_dict, back_or_front):
"""
Adds spct if relevant, adds service
"""
data_dict['back_or_front'] = back_or_front
# The percentage of used sessions based on 'scur' and 'slim'
if 'slim' in data_dict and 'scur' in data_dict:
try:
... | python | def _update_data_dict(self, data_dict, back_or_front):
"""
Adds spct if relevant, adds service
"""
data_dict['back_or_front'] = back_or_front
# The percentage of used sessions based on 'scur' and 'slim'
if 'slim' in data_dict and 'scur' in data_dict:
try:
... | [
"def",
"_update_data_dict",
"(",
"self",
",",
"data_dict",
",",
"back_or_front",
")",
":",
"data_dict",
"[",
"'back_or_front'",
"]",
"=",
"back_or_front",
"# The percentage of used sessions based on 'scur' and 'slim'",
"if",
"'slim'",
"in",
"data_dict",
"and",
"'scur'",
... | Adds spct if relevant, adds service | [
"Adds",
"spct",
"if",
"relevant",
"adds",
"service"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/haproxy/datadog_checks/haproxy/haproxy.py#L401-L411 | train | Updates the data_dict with the current values of the relevant keys. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | haproxy/datadog_checks/haproxy/haproxy.py | HAProxy._should_process | def _should_process(self, data_dict, collect_aggregates_only):
"""
if collect_aggregates_only, we process only the aggregates
else we process all except Services.BACKEND
"""
if collect_aggregates_only:
if self._is_aggregate(data_dict):
return T... | python | def _should_process(self, data_dict, collect_aggregates_only):
"""
if collect_aggregates_only, we process only the aggregates
else we process all except Services.BACKEND
"""
if collect_aggregates_only:
if self._is_aggregate(data_dict):
return T... | [
"def",
"_should_process",
"(",
"self",
",",
"data_dict",
",",
"collect_aggregates_only",
")",
":",
"if",
"collect_aggregates_only",
":",
"if",
"self",
".",
"_is_aggregate",
"(",
"data_dict",
")",
":",
"return",
"True",
"return",
"False",
"elif",
"data_dict",
"["... | if collect_aggregates_only, we process only the aggregates
else we process all except Services.BACKEND | [
"if",
"collect_aggregates_only",
"we",
"process",
"only",
"the",
"aggregates",
"else",
"we",
"process",
"all",
"except",
"Services",
".",
"BACKEND"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/haproxy/datadog_checks/haproxy/haproxy.py#L428-L439 | train | Returns True if we should process the data_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 | haproxy/datadog_checks/haproxy/haproxy.py | HAProxy._tag_from_regex | def _tag_from_regex(self, tags_regex, service_name):
"""
Use a named regexp on the current service_name to create extra tags
Example HAProxy service name: be_edge_http_sre-prod_elk
Example named regexp: be_edge_http_(?P<team>[a-z]+)\\-(?P<env>[a-z]+)_(?P<app>.*)
Resulting tags: [... | python | def _tag_from_regex(self, tags_regex, service_name):
"""
Use a named regexp on the current service_name to create extra tags
Example HAProxy service name: be_edge_http_sre-prod_elk
Example named regexp: be_edge_http_(?P<team>[a-z]+)\\-(?P<env>[a-z]+)_(?P<app>.*)
Resulting tags: [... | [
"def",
"_tag_from_regex",
"(",
"self",
",",
"tags_regex",
",",
"service_name",
")",
":",
"if",
"not",
"tags_regex",
"or",
"not",
"service_name",
":",
"return",
"[",
"]",
"match",
"=",
"re",
".",
"compile",
"(",
"tags_regex",
")",
".",
"match",
"(",
"serv... | Use a named regexp on the current service_name to create extra tags
Example HAProxy service name: be_edge_http_sre-prod_elk
Example named regexp: be_edge_http_(?P<team>[a-z]+)\\-(?P<env>[a-z]+)_(?P<app>.*)
Resulting tags: ['team:sre','env:prod','app:elk'] | [
"Use",
"a",
"named",
"regexp",
"on",
"the",
"current",
"service_name",
"to",
"create",
"extra",
"tags",
"Example",
"HAProxy",
"service",
"name",
":",
"be_edge_http_sre",
"-",
"prod_elk",
"Example",
"named",
"regexp",
":",
"be_edge_http_",
"(",
"?P<team",
">",
... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/haproxy/datadog_checks/haproxy/haproxy.py#L456-L473 | train | Create a list of Datadog tags from a regex | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | haproxy/datadog_checks/haproxy/haproxy.py | HAProxy._normalize_status | def _normalize_status(status):
"""
Try to normalize the HAProxy status as one of the statuses defined in `ALL_STATUSES`,
if it can't be matched return the status as-is in a tag-friendly format
ex: 'UP 1/2' -> 'up'
'no check' -> 'no_check'
"""
formatted_status ... | python | def _normalize_status(status):
"""
Try to normalize the HAProxy status as one of the statuses defined in `ALL_STATUSES`,
if it can't be matched return the status as-is in a tag-friendly format
ex: 'UP 1/2' -> 'up'
'no check' -> 'no_check'
"""
formatted_status ... | [
"def",
"_normalize_status",
"(",
"status",
")",
":",
"formatted_status",
"=",
"status",
".",
"lower",
"(",
")",
".",
"replace",
"(",
"\" \"",
",",
"\"_\"",
")",
"for",
"normalized_status",
"in",
"Services",
".",
"ALL_STATUSES",
":",
"if",
"formatted_status",
... | Try to normalize the HAProxy status as one of the statuses defined in `ALL_STATUSES`,
if it can't be matched return the status as-is in a tag-friendly format
ex: 'UP 1/2' -> 'up'
'no check' -> 'no_check' | [
"Try",
"to",
"normalize",
"the",
"HAProxy",
"status",
"as",
"one",
"of",
"the",
"statuses",
"defined",
"in",
"ALL_STATUSES",
"if",
"it",
"can",
"t",
"be",
"matched",
"return",
"the",
"status",
"as",
"-",
"is",
"in",
"a",
"tag",
"-",
"friendly",
"format",... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/haproxy/datadog_checks/haproxy/haproxy.py#L476-L487 | train | Normalizes the HAProxy status as one of the statuses defined in ALL_STATUSES and returns the status as - is in a tag - friendly format. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | haproxy/datadog_checks/haproxy/haproxy.py | HAProxy._process_metrics | def _process_metrics(
self, data, url, services_incl_filter=None, services_excl_filter=None, custom_tags=None, active_tag=None
):
"""
Data is a dictionary related to one host
(one line) extracted from the csv.
It should look like:
{'pxname':'dogweb', 'svname':'i-45621... | python | def _process_metrics(
self, data, url, services_incl_filter=None, services_excl_filter=None, custom_tags=None, active_tag=None
):
"""
Data is a dictionary related to one host
(one line) extracted from the csv.
It should look like:
{'pxname':'dogweb', 'svname':'i-45621... | [
"def",
"_process_metrics",
"(",
"self",
",",
"data",
",",
"url",
",",
"services_incl_filter",
"=",
"None",
",",
"services_excl_filter",
"=",
"None",
",",
"custom_tags",
"=",
"None",
",",
"active_tag",
"=",
"None",
")",
":",
"hostname",
"=",
"data",
"[",
"'... | Data is a dictionary related to one host
(one line) extracted from the csv.
It should look like:
{'pxname':'dogweb', 'svname':'i-4562165', 'scur':'42', ...} | [
"Data",
"is",
"a",
"dictionary",
"related",
"to",
"one",
"host",
"(",
"one",
"line",
")",
"extracted",
"from",
"the",
"csv",
".",
"It",
"should",
"look",
"like",
":",
"{",
"pxname",
":",
"dogweb",
"svname",
":",
"i",
"-",
"4562165",
"scur",
":",
"42"... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/haproxy/datadog_checks/haproxy/haproxy.py#L601-L637 | train | Process metrics from a single line of the CSV 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 | haproxy/datadog_checks/haproxy/haproxy.py | HAProxy._process_event | def _process_event(self, data, url, services_incl_filter=None, services_excl_filter=None, custom_tags=None):
'''
Main event processing loop. An event will be created for a service
status change.
Service checks on the server side can be used to provide the same functionality
'''
... | python | def _process_event(self, data, url, services_incl_filter=None, services_excl_filter=None, custom_tags=None):
'''
Main event processing loop. An event will be created for a service
status change.
Service checks on the server side can be used to provide the same functionality
'''
... | [
"def",
"_process_event",
"(",
"self",
",",
"data",
",",
"url",
",",
"services_incl_filter",
"=",
"None",
",",
"services_excl_filter",
"=",
"None",
",",
"custom_tags",
"=",
"None",
")",
":",
"hostname",
"=",
"data",
"[",
"'svname'",
"]",
"service_name",
"=",
... | Main event processing loop. An event will be created for a service
status change.
Service checks on the server side can be used to provide the same functionality | [
"Main",
"event",
"processing",
"loop",
".",
"An",
"event",
"will",
"be",
"created",
"for",
"a",
"service",
"status",
"change",
".",
"Service",
"checks",
"on",
"the",
"server",
"side",
"can",
"be",
"used",
"to",
"provide",
"the",
"same",
"functionality"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/haproxy/datadog_checks/haproxy/haproxy.py#L639-L673 | train | Process an event from the server side. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | haproxy/datadog_checks/haproxy/haproxy.py | HAProxy._process_service_check | def _process_service_check(
self, data, url, tag_by_host=False, services_incl_filter=None, services_excl_filter=None, custom_tags=None
):
''' Report a service check, tagged by the service and the backend.
Statuses are defined in `STATUS_TO_SERVICE_CHECK` mapping.
'''
cust... | python | def _process_service_check(
self, data, url, tag_by_host=False, services_incl_filter=None, services_excl_filter=None, custom_tags=None
):
''' Report a service check, tagged by the service and the backend.
Statuses are defined in `STATUS_TO_SERVICE_CHECK` mapping.
'''
cust... | [
"def",
"_process_service_check",
"(",
"self",
",",
"data",
",",
"url",
",",
"tag_by_host",
"=",
"False",
",",
"services_incl_filter",
"=",
"None",
",",
"services_excl_filter",
"=",
"None",
",",
"custom_tags",
"=",
"None",
")",
":",
"custom_tags",
"=",
"[",
"... | Report a service check, tagged by the service and the backend.
Statuses are defined in `STATUS_TO_SERVICE_CHECK` mapping. | [
"Report",
"a",
"service",
"check",
"tagged",
"by",
"the",
"service",
"and",
"the",
"backend",
".",
"Statuses",
"are",
"defined",
"in",
"STATUS_TO_SERVICE_CHECK",
"mapping",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/haproxy/datadog_checks/haproxy/haproxy.py#L703-L729 | train | Process a single service 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 | tokumx/datadog_checks/tokumx/vendor/pymongo/server_selectors.py | apply_single_tag_set | def apply_single_tag_set(tag_set, selection):
"""All servers matching one tag set.
A tag set is a dict. A server matches if its tags are a superset:
A server tagged {'a': '1', 'b': '2'} matches the tag set {'a': '1'}.
The empty tag set {} matches any server.
"""
def tags_match(server_tags):
... | python | def apply_single_tag_set(tag_set, selection):
"""All servers matching one tag set.
A tag set is a dict. A server matches if its tags are a superset:
A server tagged {'a': '1', 'b': '2'} matches the tag set {'a': '1'}.
The empty tag set {} matches any server.
"""
def tags_match(server_tags):
... | [
"def",
"apply_single_tag_set",
"(",
"tag_set",
",",
"selection",
")",
":",
"def",
"tags_match",
"(",
"server_tags",
")",
":",
"for",
"key",
",",
"value",
"in",
"tag_set",
".",
"items",
"(",
")",
":",
"if",
"key",
"not",
"in",
"server_tags",
"or",
"server... | All servers matching one tag set.
A tag set is a dict. A server matches if its tags are a superset:
A server tagged {'a': '1', 'b': '2'} matches the tag set {'a': '1'}.
The empty tag set {} matches any server. | [
"All",
"servers",
"matching",
"one",
"tag",
"set",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/server_selectors.py#L113-L129 | train | Applies a single tag set to a server selection. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/server_selectors.py | apply_tag_sets | def apply_tag_sets(tag_sets, selection):
"""All servers match a list of tag sets.
tag_sets is a list of dicts. The empty tag set {} matches any server,
and may be provided at the end of the list as a fallback. So
[{'a': 'value'}, {}] expresses a preference for servers tagged
{'a': 'value'}, but acc... | python | def apply_tag_sets(tag_sets, selection):
"""All servers match a list of tag sets.
tag_sets is a list of dicts. The empty tag set {} matches any server,
and may be provided at the end of the list as a fallback. So
[{'a': 'value'}, {}] expresses a preference for servers tagged
{'a': 'value'}, but acc... | [
"def",
"apply_tag_sets",
"(",
"tag_sets",
",",
"selection",
")",
":",
"for",
"tag_set",
"in",
"tag_sets",
":",
"with_tag_set",
"=",
"apply_single_tag_set",
"(",
"tag_set",
",",
"selection",
")",
"if",
"with_tag_set",
":",
"return",
"with_tag_set",
"return",
"sel... | All servers match a list of tag sets.
tag_sets is a list of dicts. The empty tag set {} matches any server,
and may be provided at the end of the list as a fallback. So
[{'a': 'value'}, {}] expresses a preference for servers tagged
{'a': 'value'}, but accepts any server if none matches the first
pr... | [
"All",
"servers",
"match",
"a",
"list",
"of",
"tag",
"sets",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/server_selectors.py#L132-L146 | train | Applies a list of tag sets to a list of servers. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/metadata.py | metadata | def metadata(check):
"""Validates metadata.csv files
If `check` is specified, only the check will be validated,
otherwise all metadata files in the repo will be.
"""
metric_sources = get_metric_sources()
if check:
if check not in metric_sources:
abort('Metadata file `{}` do... | python | def metadata(check):
"""Validates metadata.csv files
If `check` is specified, only the check will be validated,
otherwise all metadata files in the repo will be.
"""
metric_sources = get_metric_sources()
if check:
if check not in metric_sources:
abort('Metadata file `{}` do... | [
"def",
"metadata",
"(",
"check",
")",
":",
"metric_sources",
"=",
"get_metric_sources",
"(",
")",
"if",
"check",
":",
"if",
"check",
"not",
"in",
"metric_sources",
":",
"abort",
"(",
"'Metadata file `{}` does not exist.'",
".",
"format",
"(",
"get_metadata_file",
... | Validates metadata.csv files
If `check` is specified, only the check will be validated,
otherwise all metadata files in the repo will be. | [
"Validates",
"metadata",
".",
"csv",
"files"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_dev/datadog_checks/dev/tooling/commands/validate/metadata.py#L172-L313 | train | Validates metadata. csv files and returns a list of all the available metadata files. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | tokumx/datadog_checks/tokumx/vendor/pymongo/auth.py | _build_credentials_tuple | def _build_credentials_tuple(mech, source, user, passwd, extra):
"""Build and return a mechanism specific credentials tuple.
"""
user = _unicode(user) if user is not None else None
password = passwd if passwd is None else _unicode(passwd)
if mech == 'GSSAPI':
properties = extra.get('authmech... | python | def _build_credentials_tuple(mech, source, user, passwd, extra):
"""Build and return a mechanism specific credentials tuple.
"""
user = _unicode(user) if user is not None else None
password = passwd if passwd is None else _unicode(passwd)
if mech == 'GSSAPI':
properties = extra.get('authmech... | [
"def",
"_build_credentials_tuple",
"(",
"mech",
",",
"source",
",",
"user",
",",
"passwd",
",",
"extra",
")",
":",
"user",
"=",
"_unicode",
"(",
"user",
")",
"if",
"user",
"is",
"not",
"None",
"else",
"None",
"password",
"=",
"passwd",
"if",
"passwd",
... | Build and return a mechanism specific credentials tuple. | [
"Build",
"and",
"return",
"a",
"mechanism",
"specific",
"credentials",
"tuple",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/auth.py#L66-L87 | train | Build and return a mechanism specific credentials tuple. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/auth.py | _parse_scram_response | def _parse_scram_response(response):
"""Split a scram response into key, value pairs."""
return dict(item.split(b"=", 1) for item in response.split(b",")) | python | def _parse_scram_response(response):
"""Split a scram response into key, value pairs."""
return dict(item.split(b"=", 1) for item in response.split(b",")) | [
"def",
"_parse_scram_response",
"(",
"response",
")",
":",
"return",
"dict",
"(",
"item",
".",
"split",
"(",
"b\"=\"",
",",
"1",
")",
"for",
"item",
"in",
"response",
".",
"split",
"(",
"b\",\"",
")",
")"
] | Split a scram response into key, value pairs. | [
"Split",
"a",
"scram",
"response",
"into",
"key",
"value",
"pairs",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/auth.py#L185-L187 | train | Split a scram response into 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 | tokumx/datadog_checks/tokumx/vendor/pymongo/auth.py | _authenticate_scram_sha1 | def _authenticate_scram_sha1(credentials, sock_info):
"""Authenticate using SCRAM-SHA-1."""
username = credentials.username
password = credentials.password
source = credentials.source
# Make local
_hmac = hmac.HMAC
_sha1 = sha1
user = username.encode("utf-8").replace(b"=", b"=3D").repl... | python | def _authenticate_scram_sha1(credentials, sock_info):
"""Authenticate using SCRAM-SHA-1."""
username = credentials.username
password = credentials.password
source = credentials.source
# Make local
_hmac = hmac.HMAC
_sha1 = sha1
user = username.encode("utf-8").replace(b"=", b"=3D").repl... | [
"def",
"_authenticate_scram_sha1",
"(",
"credentials",
",",
"sock_info",
")",
":",
"username",
"=",
"credentials",
".",
"username",
"password",
"=",
"credentials",
".",
"password",
"source",
"=",
"credentials",
".",
"source",
"# Make local",
"_hmac",
"=",
"hmac",
... | Authenticate using SCRAM-SHA-1. | [
"Authenticate",
"using",
"SCRAM",
"-",
"SHA",
"-",
"1",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/auth.py#L190-L251 | train | Authenticate using SCRAM - SHA - 1. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/auth.py | _authenticate_gssapi | def _authenticate_gssapi(credentials, sock_info):
"""Authenticate using GSSAPI.
"""
if not HAVE_KERBEROS:
raise ConfigurationError('The "kerberos" module must be '
'installed to use GSSAPI authentication.')
try:
username = credentials.username
pa... | python | def _authenticate_gssapi(credentials, sock_info):
"""Authenticate using GSSAPI.
"""
if not HAVE_KERBEROS:
raise ConfigurationError('The "kerberos" module must be '
'installed to use GSSAPI authentication.')
try:
username = credentials.username
pa... | [
"def",
"_authenticate_gssapi",
"(",
"credentials",
",",
"sock_info",
")",
":",
"if",
"not",
"HAVE_KERBEROS",
":",
"raise",
"ConfigurationError",
"(",
"'The \"kerberos\" module must be '",
"'installed to use GSSAPI authentication.'",
")",
"try",
":",
"username",
"=",
"cred... | Authenticate using GSSAPI. | [
"Authenticate",
"using",
"GSSAPI",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/auth.py#L282-L389 | train | Authenticate using GSSAPI. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/auth.py | _authenticate_plain | def _authenticate_plain(credentials, sock_info):
"""Authenticate using SASL PLAIN (RFC 4616)
"""
source = credentials.source
username = credentials.username
password = credentials.password
payload = ('\x00%s\x00%s' % (username, password)).encode('utf-8')
cmd = SON([('saslStart', 1),
... | python | def _authenticate_plain(credentials, sock_info):
"""Authenticate using SASL PLAIN (RFC 4616)
"""
source = credentials.source
username = credentials.username
password = credentials.password
payload = ('\x00%s\x00%s' % (username, password)).encode('utf-8')
cmd = SON([('saslStart', 1),
... | [
"def",
"_authenticate_plain",
"(",
"credentials",
",",
"sock_info",
")",
":",
"source",
"=",
"credentials",
".",
"source",
"username",
"=",
"credentials",
".",
"username",
"password",
"=",
"credentials",
".",
"password",
"payload",
"=",
"(",
"'\\x00%s\\x00%s'",
... | Authenticate using SASL PLAIN (RFC 4616) | [
"Authenticate",
"using",
"SASL",
"PLAIN",
"(",
"RFC",
"4616",
")"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/auth.py#L392-L403 | train | Authenticate using SASL PLAIN ( RFC 4616 )
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/auth.py | _authenticate_cram_md5 | def _authenticate_cram_md5(credentials, sock_info):
"""Authenticate using CRAM-MD5 (RFC 2195)
"""
source = credentials.source
username = credentials.username
password = credentials.password
# The password used as the mac key is the
# same as what we use for MONGODB-CR
passwd = _password_... | python | def _authenticate_cram_md5(credentials, sock_info):
"""Authenticate using CRAM-MD5 (RFC 2195)
"""
source = credentials.source
username = credentials.username
password = credentials.password
# The password used as the mac key is the
# same as what we use for MONGODB-CR
passwd = _password_... | [
"def",
"_authenticate_cram_md5",
"(",
"credentials",
",",
"sock_info",
")",
":",
"source",
"=",
"credentials",
".",
"source",
"username",
"=",
"credentials",
".",
"username",
"password",
"=",
"credentials",
".",
"password",
"# The password used as the mac key is the",
... | Authenticate using CRAM-MD5 (RFC 2195) | [
"Authenticate",
"using",
"CRAM",
"-",
"MD5",
"(",
"RFC",
"2195",
")"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/auth.py#L406-L428 | train | Authenticate using CRAM - MD5 ( RFC 2195 section 7. 1. 1. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/auth.py | _authenticate_x509 | def _authenticate_x509(credentials, sock_info):
"""Authenticate using MONGODB-X509.
"""
query = SON([('authenticate', 1),
('mechanism', 'MONGODB-X509')])
if credentials.username is not None:
query['user'] = credentials.username
elif sock_info.max_wire_version < 5:
ra... | python | def _authenticate_x509(credentials, sock_info):
"""Authenticate using MONGODB-X509.
"""
query = SON([('authenticate', 1),
('mechanism', 'MONGODB-X509')])
if credentials.username is not None:
query['user'] = credentials.username
elif sock_info.max_wire_version < 5:
ra... | [
"def",
"_authenticate_x509",
"(",
"credentials",
",",
"sock_info",
")",
":",
"query",
"=",
"SON",
"(",
"[",
"(",
"'authenticate'",
",",
"1",
")",
",",
"(",
"'mechanism'",
",",
"'MONGODB-X509'",
")",
"]",
")",
"if",
"credentials",
".",
"username",
"is",
"... | Authenticate using MONGODB-X509. | [
"Authenticate",
"using",
"MONGODB",
"-",
"X509",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/auth.py#L431-L442 | train | Authenticate using MONGODB - X509. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/auth.py | _authenticate_mongo_cr | def _authenticate_mongo_cr(credentials, sock_info):
"""Authenticate using MONGODB-CR.
"""
source = credentials.source
username = credentials.username
password = credentials.password
# Get a nonce
response = sock_info.command(source, {'getnonce': 1})
nonce = response['nonce']
key = _a... | python | def _authenticate_mongo_cr(credentials, sock_info):
"""Authenticate using MONGODB-CR.
"""
source = credentials.source
username = credentials.username
password = credentials.password
# Get a nonce
response = sock_info.command(source, {'getnonce': 1})
nonce = response['nonce']
key = _a... | [
"def",
"_authenticate_mongo_cr",
"(",
"credentials",
",",
"sock_info",
")",
":",
"source",
"=",
"credentials",
".",
"source",
"username",
"=",
"credentials",
".",
"username",
"password",
"=",
"credentials",
".",
"password",
"# Get a nonce",
"response",
"=",
"sock_... | Authenticate using MONGODB-CR. | [
"Authenticate",
"using",
"MONGODB",
"-",
"CR",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/auth.py#L445-L461 | train | Authenticate using MONGODB - CR. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/auth.py | authenticate | def authenticate(credentials, sock_info):
"""Authenticate sock_info."""
mechanism = credentials.mechanism
auth_func = _AUTH_MAP.get(mechanism)
auth_func(credentials, sock_info) | python | def authenticate(credentials, sock_info):
"""Authenticate sock_info."""
mechanism = credentials.mechanism
auth_func = _AUTH_MAP.get(mechanism)
auth_func(credentials, sock_info) | [
"def",
"authenticate",
"(",
"credentials",
",",
"sock_info",
")",
":",
"mechanism",
"=",
"credentials",
".",
"mechanism",
"auth_func",
"=",
"_AUTH_MAP",
".",
"get",
"(",
"mechanism",
")",
"auth_func",
"(",
"credentials",
",",
"sock_info",
")"
] | Authenticate sock_info. | [
"Authenticate",
"sock_info",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/tokumx/datadog_checks/tokumx/vendor/pymongo/auth.py#L482-L486 | train | Authenticate sock_info. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,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/openmetrics/mixins.py | OpenMetricsScraperMixin.parse_metric_family | def parse_metric_family(self, response, scraper_config):
"""
Parse the MetricFamily from a valid requests.Response object to provide a MetricFamily object (see [0])
The text format uses iter_lines() generator.
:param response: requests.Response
:return: core.Metric
"""
... | python | def parse_metric_family(self, response, scraper_config):
"""
Parse the MetricFamily from a valid requests.Response object to provide a MetricFamily object (see [0])
The text format uses iter_lines() generator.
:param response: requests.Response
:return: core.Metric
"""
... | [
"def",
"parse_metric_family",
"(",
"self",
",",
"response",
",",
"scraper_config",
")",
":",
"input_gen",
"=",
"response",
".",
"iter_lines",
"(",
"chunk_size",
"=",
"self",
".",
"REQUESTS_CHUNK_SIZE",
",",
"decode_unicode",
"=",
"True",
")",
"if",
"scraper_conf... | Parse the MetricFamily from a valid requests.Response object to provide a MetricFamily object (see [0])
The text format uses iter_lines() generator.
:param response: requests.Response
:return: core.Metric | [
"Parse",
"the",
"MetricFamily",
"from",
"a",
"valid",
"requests",
".",
"Response",
"object",
"to",
"provide",
"a",
"MetricFamily",
"object",
"(",
"see",
"[",
"0",
"]",
")",
"The",
"text",
"format",
"uses",
"iter_lines",
"()",
"generator",
".",
":",
"param"... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py#L225-L241 | train | Parse the MetricFamily from a valid requests. Response object to provide a MetricFamily object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py | OpenMetricsScraperMixin._text_filter_input | def _text_filter_input(self, input_gen, scraper_config):
"""
Filters out the text input line by line to avoid parsing and processing
metrics we know we don't want to process. This only works on `text/plain`
payloads, and is an INTERNAL FEATURE implemented for the kubelet check
:p... | python | def _text_filter_input(self, input_gen, scraper_config):
"""
Filters out the text input line by line to avoid parsing and processing
metrics we know we don't want to process. This only works on `text/plain`
payloads, and is an INTERNAL FEATURE implemented for the kubelet check
:p... | [
"def",
"_text_filter_input",
"(",
"self",
",",
"input_gen",
",",
"scraper_config",
")",
":",
"for",
"line",
"in",
"input_gen",
":",
"for",
"item",
"in",
"scraper_config",
"[",
"'_text_filter_blacklist'",
"]",
":",
"if",
"item",
"in",
"line",
":",
"break",
"e... | Filters out the text input line by line to avoid parsing and processing
metrics we know we don't want to process. This only works on `text/plain`
payloads, and is an INTERNAL FEATURE implemented for the kubelet check
:param input_get: line generator
:output: generator of filtered lines | [
"Filters",
"out",
"the",
"text",
"input",
"line",
"by",
"line",
"to",
"avoid",
"parsing",
"and",
"processing",
"metrics",
"we",
"know",
"we",
"don",
"t",
"want",
"to",
"process",
".",
"This",
"only",
"works",
"on",
"text",
"/",
"plain",
"payloads",
"and"... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py#L243-L257 | train | Filter out the text input line by line to avoid parsing and processing
metrics. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py | OpenMetricsScraperMixin.scrape_metrics | def scrape_metrics(self, scraper_config):
"""
Poll the data from prometheus and return the metrics as a generator.
"""
response = self.poll(scraper_config)
try:
# no dry run if no label joins
if not scraper_config['label_joins']:
scraper_co... | python | def scrape_metrics(self, scraper_config):
"""
Poll the data from prometheus and return the metrics as a generator.
"""
response = self.poll(scraper_config)
try:
# no dry run if no label joins
if not scraper_config['label_joins']:
scraper_co... | [
"def",
"scrape_metrics",
"(",
"self",
",",
"scraper_config",
")",
":",
"response",
"=",
"self",
".",
"poll",
"(",
"scraper_config",
")",
"try",
":",
"# no dry run if no label joins",
"if",
"not",
"scraper_config",
"[",
"'label_joins'",
"]",
":",
"scraper_config",
... | Poll the data from prometheus and return the metrics as a generator. | [
"Poll",
"the",
"data",
"from",
"prometheus",
"and",
"return",
"the",
"metrics",
"as",
"a",
"generator",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py#L263-L289 | train | Scrape the metrics from prometheus and return the metrics as a generator. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py | OpenMetricsScraperMixin.process | def process(self, scraper_config, metric_transformers=None):
"""
Polls the data from prometheus and pushes them as gauges
`endpoint` is the metrics endpoint to use to poll metrics from Prometheus
Note that if the instance has a 'tags' attribute, it will be pushed
automatically a... | python | def process(self, scraper_config, metric_transformers=None):
"""
Polls the data from prometheus and pushes them as gauges
`endpoint` is the metrics endpoint to use to poll metrics from Prometheus
Note that if the instance has a 'tags' attribute, it will be pushed
automatically a... | [
"def",
"process",
"(",
"self",
",",
"scraper_config",
",",
"metric_transformers",
"=",
"None",
")",
":",
"for",
"metric",
"in",
"self",
".",
"scrape_metrics",
"(",
"scraper_config",
")",
":",
"self",
".",
"process_metric",
"(",
"metric",
",",
"scraper_config",... | Polls the data from prometheus and pushes them as gauges
`endpoint` is the metrics endpoint to use to poll metrics from Prometheus
Note that if the instance has a 'tags' attribute, it will be pushed
automatically as additional custom tags and added to the metrics | [
"Polls",
"the",
"data",
"from",
"prometheus",
"and",
"pushes",
"them",
"as",
"gauges",
"endpoint",
"is",
"the",
"metrics",
"endpoint",
"to",
"use",
"to",
"poll",
"metrics",
"from",
"Prometheus"
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py#L291-L300 | train | Processes the metrics from Prometheus and pushes them as gauges
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py | OpenMetricsScraperMixin.process_metric | def process_metric(self, metric, scraper_config, metric_transformers=None):
"""
Handle a prometheus metric according to the following flow:
- search scraper_config['metrics_mapper'] for a prometheus.metric <--> datadog.metric mapping
- call check method with the same name as the ... | python | def process_metric(self, metric, scraper_config, metric_transformers=None):
"""
Handle a prometheus metric according to the following flow:
- search scraper_config['metrics_mapper'] for a prometheus.metric <--> datadog.metric mapping
- call check method with the same name as the ... | [
"def",
"process_metric",
"(",
"self",
",",
"metric",
",",
"scraper_config",
",",
"metric_transformers",
"=",
"None",
")",
":",
"# If targeted metric, store labels",
"self",
".",
"_store_labels",
"(",
"metric",
",",
"scraper_config",
")",
"if",
"metric",
".",
"name... | Handle a prometheus metric according to the following flow:
- search scraper_config['metrics_mapper'] for a prometheus.metric <--> datadog.metric mapping
- call check method with the same name as the metric
- log some info if none of the above worked
`metric_transformers` is... | [
"Handle",
"a",
"prometheus",
"metric",
"according",
"to",
"the",
"following",
"flow",
":",
"-",
"search",
"scraper_config",
"[",
"metrics_mapper",
"]",
"for",
"a",
"prometheus",
".",
"metric",
"<",
"--",
">",
"datadog",
".",
"metric",
"mapping",
"-",
"call",... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py#L348-L393 | train | Process a metric according to the metrics_mapper and the metric_transformers dictionary. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py | OpenMetricsScraperMixin.poll | def poll(self, scraper_config, headers=None):
"""
Custom headers can be added to the default headers.
Returns a valid requests.Response, raise requests.HTTPError if the status code of the requests.Response
isn't valid - see response.raise_for_status()
The caller needs to close ... | python | def poll(self, scraper_config, headers=None):
"""
Custom headers can be added to the default headers.
Returns a valid requests.Response, raise requests.HTTPError if the status code of the requests.Response
isn't valid - see response.raise_for_status()
The caller needs to close ... | [
"def",
"poll",
"(",
"self",
",",
"scraper_config",
",",
"headers",
"=",
"None",
")",
":",
"endpoint",
"=",
"scraper_config",
".",
"get",
"(",
"'prometheus_url'",
")",
"# Should we send a service check for when we make a request",
"health_service_check",
"=",
"scraper_co... | Custom headers can be added to the default headers.
Returns a valid requests.Response, raise requests.HTTPError if the status code of the requests.Response
isn't valid - see response.raise_for_status()
The caller needs to close the requests.Response
:param endpoint: string url endpoin... | [
"Custom",
"headers",
"can",
"be",
"added",
"to",
"the",
"default",
"headers",
"."
] | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py#L395-L434 | train | Poll the prometheus server for new metrics and return a valid response. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
DataDog/integrations-core | datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py | OpenMetricsScraperMixin.submit_openmetric | def submit_openmetric(self, metric_name, metric, scraper_config, hostname=None):
"""
For each sample in the metric, report it as a gauge with all labels as tags
except if a labels dict is passed, in which case keys are label names we'll extract
and corresponding values are tag names we'l... | python | def submit_openmetric(self, metric_name, metric, scraper_config, hostname=None):
"""
For each sample in the metric, report it as a gauge with all labels as tags
except if a labels dict is passed, in which case keys are label names we'll extract
and corresponding values are tag names we'l... | [
"def",
"submit_openmetric",
"(",
"self",
",",
"metric_name",
",",
"metric",
",",
"scraper_config",
",",
"hostname",
"=",
"None",
")",
":",
"if",
"metric",
".",
"type",
"in",
"[",
"\"gauge\"",
",",
"\"counter\"",
",",
"\"rate\"",
"]",
":",
"metric_name_with_n... | For each sample in the metric, report it as a gauge with all labels as tags
except if a labels dict is passed, in which case keys are label names we'll extract
and corresponding values are tag names we'll use (eg: {'node': 'node'}).
Histograms generate a set of values instead of a unique metric... | [
"For",
"each",
"sample",
"in",
"the",
"metric",
"report",
"it",
"as",
"a",
"gauge",
"with",
"all",
"labels",
"as",
"tags",
"except",
"if",
"a",
"labels",
"dict",
"is",
"passed",
"in",
"which",
"case",
"keys",
"are",
"label",
"names",
"we",
"ll",
"extra... | ebd41c873cf9f97a8c51bf9459bc6a7536af8acd | https://github.com/DataDog/integrations-core/blob/ebd41c873cf9f97a8c51bf9459bc6a7536af8acd/datadog_checks_base/datadog_checks/base/checks/openmetrics/mixins.py#L483-L517 | train | Submit an OpenMetric to Datadog. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.