mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
refactor
This commit is contained in:
@@ -102,6 +102,11 @@ class WshServerType {
|
||||
return WOS.wshServerRpcHelper_call("remotefileinfo", data, opts);
|
||||
}
|
||||
|
||||
// command "remotestreamcpudata" [responsestream]
|
||||
RemoteStreamCpuDataCommand(opts?: RpcOpts): AsyncGenerator<TimeSeriesData, void, boolean> {
|
||||
return WOS.wshServerRpcHelper_responsestream("remotestreamcpudata", null, opts);
|
||||
}
|
||||
|
||||
// command "remotestreamfile" [responsestream]
|
||||
RemoteStreamFileCommand(data: CommandRemoteStreamFileData, opts?: RpcOpts): AsyncGenerator<CommandRemoteStreamFileRtnData, void, boolean> {
|
||||
return WOS.wshServerRpcHelper_responsestream("remotestreamfile", data, opts);
|
||||
@@ -128,7 +133,7 @@ class WshServerType {
|
||||
}
|
||||
|
||||
// command "streamcpudata" [responsestream]
|
||||
StreamCpuDataCommand(data: CpuDataRequest, opts?: RpcOpts): AsyncGenerator<CpuDataType, void, boolean> {
|
||||
StreamCpuDataCommand(data: CpuDataRequest, opts?: RpcOpts): AsyncGenerator<TimeSeriesData, void, boolean> {
|
||||
return WOS.wshServerRpcHelper_responsestream("streamcpudata", data, opts);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import * as React from "react";
|
||||
import "./cpuplot.less";
|
||||
|
||||
type Point = {
|
||||
time: number;
|
||||
time: number; // note this is in seconds not milliseconds
|
||||
value: number;
|
||||
};
|
||||
|
||||
@@ -89,7 +89,8 @@ function CpuPlotView({ model }: { model: CpuPlotViewModel }) {
|
||||
);
|
||||
try {
|
||||
for await (const datum of dataGen) {
|
||||
addPlotData(datum);
|
||||
const ts = datum.ts;
|
||||
addPlotData({ time: ts / 1000, value: datum.values?.["cpu"] });
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
|
||||
Vendored
+6
-6
@@ -158,12 +158,6 @@ declare global {
|
||||
count: number;
|
||||
};
|
||||
|
||||
// wshrpc.CpuDataType
|
||||
type CpuDataType = {
|
||||
time: number;
|
||||
value: number;
|
||||
};
|
||||
|
||||
// wstore.FileDef
|
||||
type FileDef = {
|
||||
filetype?: string;
|
||||
@@ -437,6 +431,12 @@ declare global {
|
||||
disablewebgl: boolean;
|
||||
};
|
||||
|
||||
// wshrpc.TimeSeriesData
|
||||
type TimeSeriesData = {
|
||||
ts: number;
|
||||
values: {[key: string]: number};
|
||||
};
|
||||
|
||||
// wstore.UIContext
|
||||
type UIContext = {
|
||||
windowid: string;
|
||||
|
||||
Reference in New Issue
Block a user