Browse Source
* Introduce anomaly analytic unit * todo * Render anomaly analytic unit config * Optional HSR #273 * minor fix for #273 * fix codestyle * minor ui fix * Improve ui * render confidence interval * Update src/panel/graph_panel/controllers/analytic_controller.ts * use from and to in runDetectmaster
6 changed files with 174 additions and 65 deletions
@ -0,0 +1,33 @@
|
||||
import { AnalyticUnit, DetectorType } from './analytic_unit'; |
||||
|
||||
import _ from 'lodash'; |
||||
|
||||
const DEFAULTS = { |
||||
detectorType: DetectorType.ANOMALY, |
||||
type: 'ANOMALY', |
||||
alpha: 0.5, |
||||
confidence: 1 |
||||
}; |
||||
|
||||
export class AnomalyAnalyticUnit extends AnalyticUnit { |
||||
|
||||
constructor(_serverObject?: any) { |
||||
super(_serverObject); |
||||
_.defaults(this._serverObject, DEFAULTS); |
||||
} |
||||
|
||||
toJSON() { |
||||
const baseJSON = super.toJSON(); |
||||
return { |
||||
...baseJSON, |
||||
alpha: this.alpha, |
||||
confidence: this.confidence |
||||
}; |
||||
} |
||||
|
||||
set alpha(val: number) { this._serverObject.alpha = val; } |
||||
get alpha(): number { return this._serverObject.alpha; } |
||||
|
||||
set confidence(val: number) { this._serverObject.confidence = val; } |
||||
get confidence(): number { return this._serverObject.confidence; } |
||||
} |
Loading…
Reference in new issue