MCPcopy Create free account
hub / github.com/dbcli/mssql-cli / write

Method write

mssqlcli/telemetry_upload.py:80–113  ·  view source on GitHub ↗

Enqueues the passed in data to the queue.

(self, data, context=None)

Source from the content-addressed store, hash-verified

78 TelemetryChannel.__init__(self, context, queue)
79
80 def write(self, data, context=None):
81 """
82 Enqueues the passed in data to the queue.
83 """
84 local_context = context or self._context
85 if not local_context:
86 raise Exception('Context was required but not provided')
87
88 if not data:
89 raise Exception('Data was required but not provided')
90
91 envelope = contracts.Envelope()
92 # The only difference in behavior from it's parent class is setting the flag below.
93 # Suppress Vortex ingest header.
94 envelope.flags = 0x200000
95 envelope.name = data.ENVELOPE_TYPE_NAME
96 envelope.time = datetime.datetime.utcnow().isoformat() + 'Z'
97 envelope.ikey = local_context.instrumentation_key
98 tags = envelope.tags
99 for key, value in self._write_tags(local_context):
100 tags[key] = value
101 envelope.data = contracts.Data()
102 envelope.data.base_type = data.DATA_TYPE_NAME
103 if hasattr(data, 'properties') and local_context.properties:
104 properties = data.properties
105 if not properties:
106 properties = {}
107 data.properties = properties
108 for key in local_context.properties:
109 if key not in properties:
110 properties[key] = local_context.properties[key]
111 envelope.data.base_data = data
112
113 self._queue.put(envelope)
114
115
116def build_vortex_telemetry_client(service_endpoint_uri):

Callers 11

dos2unix.pyFile · 0.80
register_aliasFunction · 0.80
upgrade_configFunction · 0.80
_get_user_idFunction · 0.80
sendMethod · 0.80
uploadFunction · 0.80
saveMethod · 0.80
deleteMethod · 0.80
send_requestMethod · 0.80
wrappagerFunction · 0.80
step_send_source_commandFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected