fix: clear the spark sampler when switching to usage display mode
This commit is contained in:
@@ -76,9 +76,11 @@ export class InflightMonitor extends SingletonAction<InflightSettings> {
|
||||
runtime.ensureConnections(cfgFromSettings(state.settings));
|
||||
state.unwatchStats?.();
|
||||
state.unwatchStats = undefined;
|
||||
if (state.sampler) clearInterval(state.sampler);
|
||||
state.sampler = undefined;
|
||||
if (this.displayOf(state) === "usage") {
|
||||
state.unwatchStats = runtime.watchStats(this.modelKeyOf(state));
|
||||
} else if (!state.sampler) {
|
||||
} else {
|
||||
state.sampler = setInterval(() => this.sample(state), 1000);
|
||||
}
|
||||
this.render(state);
|
||||
|
||||
Reference in New Issue
Block a user