Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 1560512

Browse files
committed
flush
1 parent 0afdcc9 commit 1560512

File tree

9 files changed

+5
-14
lines changed

9 files changed

+5
-14
lines changed

contrib/opencensus-ext-azure/examples/logs/error.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,3 @@ def main():
3232

3333
if __name__ == '__main__':
3434
main()
35-
input("...")

contrib/opencensus-ext-azure/examples/logs/event.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,3 @@
2323
logger.addHandler(AzureEventHandler())
2424
logger.setLevel(logging.INFO)
2525
logger.info('Hello, World!')
26-
27-
input("...")

contrib/opencensus-ext-azure/examples/logs/properties.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,3 @@
3232
result = 1 / 0 # generate a ZeroDivisionError
3333
except Exception:
3434
logger.exception('Captured an exception.', extra=properties)
35-
36-
input("...")

contrib/opencensus-ext-azure/examples/logs/simple.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,3 @@
2121
# and place it in the APPLICATIONINSIGHTS_CONNECTION_STRING
2222
# environment variable.
2323
logger.addHandler(AzureLogHandler())
24-
logger.warning('Hello, World!')
25-
26-
input("...")

contrib/opencensus-ext-azure/examples/metrics/simple.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ def main():
5050

5151
mmap.measure_int_put(CARROTS_MEASURE, 1000)
5252
mmap.record(tmap)
53-
time.sleep(60)
5453

5554
print("Done recording metrics")
5655

contrib/opencensus-ext-azure/examples/traces/credential.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,3 @@
3535

3636
with tracer.span(name='foo'):
3737
print('Hello, World!')
38-
input(...)

contrib/opencensus-ext-azure/examples/traces/simple.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@
2323

2424
with tracer.span(name='foo'):
2525
print('Hello, World!')
26-
input(...)

contrib/opencensus-ext-azure/opencensus/ext/azure/log_exporter/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import atexit
1516
import logging
1617
import os
1718
import random
@@ -63,6 +64,7 @@ def __init__(self, **options):
6364
self._queue = Queue(capacity=self.options.queue_capacity)
6465
self._worker = Worker(self._queue, self)
6566
self._worker.start()
67+
# atexit.register(self.close, self.options.grace_period)
6668
# start statsbeat on exporter instantiation
6769
if not os.environ.get("APPLICATIONINSIGHTS_STATSBEAT_DISABLED_ALL"):
6870
statsbeat_metrics.collect_statsbeat_metrics(self.options)
@@ -88,11 +90,11 @@ def _export(self, batch, event=None): # pragma: NO COVER
8890
if event:
8991
event.set()
9092

91-
def close(self):
93+
def close(self, timeout=None):
9294
if self.storage:
9395
self.storage.close()
9496
if self._worker:
95-
self._worker.stop()
97+
self._worker.stop(timeout)
9698

9799
def createLock(self):
98100
self.lock = None

contrib/opencensus-ext-azure/opencensus/ext/azure/metrics_exporter/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __init__(self, is_stats=False, **options):
5858
retention_period=self.options.storage_retention_period,
5959
source=self.__class__.__name__,
6060
)
61-
self._atexit_handler = atexit.register(self.shutdown)
61+
self._atexit_handler = atexit.register(self.shutdown, self.options.grace_period)
6262
self.exporter_thread = None
6363
# For redirects
6464
self._consecutive_redirects = 0 # To prevent circular redirects

0 commit comments

Comments
 (0)