Improving metric queries (#3424)

This commit is contained in:
Alex Andreev authored and GitHub committed 2021-07-22 09:57:14 -04:00
1 parent 84c767a3d2
commit c6a4d55d86
33 files changed
+452 -357

No files matched your search

@@ -18,32 +18,12 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import { action, observable, makeObservable } from "mobx";
import { KubeObjectStore } from "../../kube-object.store";
import { autoBind } from "../../utils";
import { IPvcMetrics, PersistentVolumeClaim, pvcApi } from "../../api/endpoints";
import { apiManager } from "../../api/api-manager";
import { PersistentVolumeClaim, pvcApi } from "../../api/endpoints";
import { KubeObjectStore } from "../../kube-object.store";
export class VolumeClaimStore extends KubeObjectStore<PersistentVolumeClaim> {
api = pvcApi;
@observable metrics: IPvcMetrics = null;
constructor() {
super();
makeObservable(this);
autoBind(this);
}
@action
async loadMetrics(pvc: PersistentVolumeClaim) {
this.metrics = await pvcApi.getMetrics(pvc.getName(), pvc.getNs());
}
reset() {
this.metrics = null;
}
}
export const volumeClaimStore = new VolumeClaimStore();