Browse Source

hsr bugfix

pull/25/head
Alexey Velikiy 3 years ago
parent
commit
ed353c3da9
  1. 3
      client/src/components/pods/anomaly_pod.ts
  2. 2
      server/src/services/analytic_service/analytic_unit/anomaly_analytic_unit.rs

3
client/src/components/pods/anomaly_pod.ts

@ -8,7 +8,6 @@ import { SegmentsSet } from '@/types/segment_set';
export type UpdateDataCallback = (range: TimeRange) => Promise<{
timeserie: LineTimeSerie[],
hsr: LineTimeSerie[],
segments: Segment[]
}>;
@ -21,7 +20,6 @@ export class AnomalyPod extends HasticPod<UpdateDataCallback> {
segmentSet: SegmentsSet<Segment>
) {
super(el, udc, segmentSet)
this.fetchData();
}
@ -39,7 +37,6 @@ export class AnomalyPod extends HasticPod<UpdateDataCallback> {
.then(resp => {
this.updateSegments(resp.segments);
this.updateData(resp.timeserie, undefined, true);
console.log(resp.hsr);
})
.catch(() => { /* set "error" message */ })
}

2
server/src/services/analytic_service/analytic_unit/anomaly_analytic_unit.rs

@ -81,7 +81,7 @@ impl AnalyticUnit for AnomalyAnalyticUnit {
for t in 1..ts.len() {
let alpha = self.config.alpha;
let stv = alpha * ts[t].1 + (1.9 - alpha) * sts[t - 1].1;
let stv = alpha * ts[t].1 + (1.0 - alpha) * sts[t - 1].1;
sts.push((ts[t].0, stv));
}

Loading…
Cancel
Save