Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Shutting down a MeterProvider with a asynchronous instrument can take a long time

Aperta
#131 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
matlab

Direzione di ricerca

Start by running the supplied MATLAB loop and compare shutdown timing for the observable gauge and synchronous counter. Inspect the MeterProvider creation and opentelemetry.sdk.common.Cleanup.shutdown path, then review the asynchronous example in test/texamples.m. Done means asynchronous shutdown no longer intermittently takes about 30 seconds and the example test no longer needs filtering.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Run the following code in a loop. Many iterations take only about 0.01 seconds to run but some can take a long time (~30 seconds).

function out = currentsecond()
% callback function for an observable gauge

dt = datetime("now");
s = second(dt);

out = opentelemetry.metrics.ObservableResult;
out = out.observe(s);
for i=1:10, 
   mp = opentelemetry.sdk.metrics.MeterProvider();  
   opentelemetry.metrics.Provider.setMeterProvider(mp);
   clear
   mp = opentelemetry.metrics.Provider.getMeterProvider();   
   m = getMeter(mp, "foo"); 
   g = createObservableGauge(m, @currentsecond, "bar");
   tic;   
   opentelemetry.sdk.common.Cleanup.shutdown(mp);   
   toc; 
end

In comparison, if the code is changed to create a synchronous instrument (e.g. counter) instead of an asynchronous one, then shutdown never takes a long time, always around 0.01 seconds.

This issue causes an asynchronous example test in test/texamples.m to be filtered out due to the time it takes to run the test.

Lingua principale
MATLAB
Stelle
19
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di mathworks/OpenTelemetry-MATLAB

Tutte le issue di mathworks/OpenTelemetry-MATLAB

Issue simili

Altre issue su MATLAB

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.