Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Feb 3, 2023
1 parent 031f901 commit 8a4531a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/app/Dashboard/Charts/ChartController.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import {
BehaviorSubject,
combineLatest,
concatMap,
distinctUntilChanged,
filter,
finalize,
map,
Expand Down Expand Up @@ -94,11 +93,12 @@ export class ChartController {
}`,
{ connectUrl: target.connectUrl }
)
// TODO error handling
.pipe(map((resp) => resp.data.targetNodes[0].recordings.active.aggregate.count > 0))
);
})
)
.subscribe(this._hasRecording$);
.subscribe((v) => this._hasRecording$.next(v));

this._target
.target()
Expand All @@ -111,13 +111,10 @@ export class ChartController {
if (!hasRecording || subscribers === 0) {
return;
}
console.log('uploading to jfr-datasource...');
this._api.uploadActiveRecordingToGrafana(RECORDING_NAME).subscribe((_) => {
/* do nothing */
});
});

this._refCount$.subscribe((count) => console.log('card controller subscribers', count));
}

refresh(): Observable<number> {
Expand All @@ -137,7 +134,7 @@ export class ChartController {
}

hasActiveRecording(): Observable<boolean> {
return this._hasRecording$.asObservable().pipe(distinctUntilChanged());
return this._hasRecording$.asObservable();
}

startRecording(): Observable<boolean> {
Expand Down

0 comments on commit 8a4531a

Please sign in to comment.