-
Notifications
You must be signed in to change notification settings - Fork 4
/
types_forecasting.go
58 lines (52 loc) · 1.86 KB
/
types_forecasting.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package types
import (
"time"
"gopkg.in/mgo.v2/bson"
)
/*Critical Interval is the interval of time analyzed to take a scaling decision*/
type CriticalInterval struct {
TimeStart time.Time `json:"TimeStart"`
Requests float64 `json:"Requests"` //max/min point in the interval
TimeEnd time.Time `json:"TimeEnd"`
TimePeak time.Time
}
/*Represent the number of requests for a time T*/
type ForecastedValue struct {
TimeStamp time.Time `json:"timestamp"`
Requests float64 `json:"requests"`
}
/*Set of values received from the Forecasting component*/
type Forecast struct {
IDdb bson.ObjectId `bson:"_id"`
ServiceName string `json:"service_name" bson:"service_name"`
ForecastedValues []ForecastedValue `json:"values" bson:"values"`
TimeWindowStart time.Time `json:"start_time" bson:"start_time"`
TimeWindowEnd time.Time `json:"end_time" bson:"end_time"`
IDPrediction string `json:"id" bson:"id_predictions"`
}
/*ProcessedForecast metadata after processing the time serie*/
type ProcessedForecast struct {
CriticalIntervals [] CriticalInterval
}
/*Points of Interest*/
type PoI struct {
Peak bool `json:"peak"`
Index int `json:"index"`
Left_ips float64 `json:"left_ips"`
Right_ips float64 `json:"right_ips"`
Widht_heights float64 `json:"widht_heights"`
Index_in_interval_right []int `json:"index_in_interval_right"`
Index_in_interval_left []int `json:"index_in_interval_left"`
Start struct {
Index int `json:"index"`
Left_ips float64 `json:"left_ips"`
Right_ips float64 `json:"right_ips"`
Widht_heights float64 `json:"widht_heights"`
} `json:"index_left_valley"`
End struct {
Index int `json:"index"`
Left_ips float64 `json:"left_ips"`
Right_ips float64 `json:"right_ips"`
Widht_heights float64 `json:"widht_heights"`
} `json:"index_right_valley"`
}