Skip to content
Snippets Groups Projects
Commit 7819baa4 authored by George Sedov's avatar George Sedov
Browse files

and the final touch

parent 6717c534
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,6 @@ import { reactive } from "vue";
import { GroupDelayResponse } from "../generated_proto/AsapoMonitoringQueryService_pb";
import { FixedTimeRange } from "../lib/TimeRange";
import { timeStore } from "./timeStore";
import {PipelineNode} from "../lib/ToplogyPipelineDefinitions";
export interface GroupDelayStoreState {
lastUpdateRange: FixedTimeRange,
......@@ -26,18 +25,18 @@ class GroupDelayStore {
if (delayMs > 60 * 60 * 1000) {
return ">1H"
} else if (delayMs > 60 * 1000) {
return Math.floor(delayMs / 60*1000).toString() + "mins"
return Math.floor(delayMs / 60000).toString() + " mins"
} else if (delayMs > 1000) {
return Math.floor(delayMs / 1000).toString() + "secs"
return Math.floor(delayMs / 1000).toString() + " secs"
}
return "0."+delayMs.toString().padStart(4, '0')+"millis"
return "0."+delayMs.toString().padStart(4, '0')+" secs"
}
public parseServerResponse(groupDelayData: GroupDelayResponse): void {
const newGroupIds: string[] = [];
for(const groupId of groupDelayData.getGroupidsList()) {
const value: string = groupId.getGroupid() + groupId.getDelayms()
newGroupIds.push( groupId.getGroupid().padEnd(25, ' ') + this.beautifyDelayMs(groupId.getDelayms()) )
newGroupIds.push( groupId.getGroupid().padEnd(25, '\xa0') + this.beautifyDelayMs(groupId.getDelayms()) )
}
this.internalState.GroupIdList = newGroupIds
......@@ -47,10 +46,10 @@ class GroupDelayStore {
}
public couldBeOutdated(): boolean {
const maxPipelineToplogyOldnessInSec = 60;
const maxDelayOldnessInSec = 5;
return Math.abs(this.internalState.lastUpdateRange.fromUnixSec - timeStore.state.lastFixedTimeRange.fromUnixSec) > maxPipelineToplogyOldnessInSec ||
Math.abs(this.internalState.lastUpdateRange.toUnixSec - timeStore.state.lastFixedTimeRange.toUnixSec) > maxPipelineToplogyOldnessInSec
return Math.abs(this.internalState.lastUpdateRange.fromUnixSec - timeStore.state.lastFixedTimeRange.fromUnixSec) > maxDelayOldnessInSec ||
Math.abs(this.internalState.lastUpdateRange.toUnixSec - timeStore.state.lastFixedTimeRange.toUnixSec) > maxDelayOldnessInSec
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment