Browse Source

update 添加倾角数据 查询解析处理

dev
lucas 4 months ago
parent
commit
fbdca81b13
  1. 4
      adaptors/安心云es主题特征to河北公路设施监测.go
  2. 2
      consumers/consumerHBJCAS.go
  3. 58
      models/esThemeAggDateHistogram.go

4
adaptors/安心云es主题特征to河北公路设施监测.go

@ -18,9 +18,9 @@ type Adaptor_AXYES_HBGL struct {
}
func (the Adaptor_AXYES_HBGL) Transform(rawMsg string) []NeedPush {
esAggTop := models.EsAggTop{}
esAggDateHistogram := models.EsThemeAggDateHistogram{}
var needPush []NeedPush
err := json.Unmarshal([]byte(rawMsg), &esAggTop)
err := json.Unmarshal([]byte(rawMsg), &esAggDateHistogram)
if err != nil {
return nil
}

2
consumers/consumerHBJCAS.go

@ -142,7 +142,7 @@ func (the *consumerHBJCAS) getESQueryStr(structureId, factorId, start, end strin
}
},
"aggs": {
"groupBySensorId": {
"groupSensor": {
"terms": {
"field": "sensor"
},

58
models/esThemeAggDateHistogram.go

@ -0,0 +1,58 @@
package models
import "time"
type EsThemeAggDateHistogram struct {
Took int `json:"took"`
TimedOut bool `json:"timed_out"`
Shards struct {
Total int `json:"total"`
Successful int `json:"successful"`
Skipped int `json:"skipped"`
Failed int `json:"failed"`
} `json:"_shards"`
Hits struct {
Total int `json:"total"`
MaxScore float64 `json:"max_score"`
Hits []interface{} `json:"hits"`
} `json:"hits"`
Aggregations GPBySensorIdAggByDateHistogram `json:"aggregations"`
}
type GPBySensorIdAggByDateHistogram struct {
GroupSensor struct {
DocCountErrorUpperBound int `json:"doc_count_error_upper_bound"`
SumOtherDocCount int `json:"sum_other_doc_count"`
Buckets []Buckets `json:"buckets"`
} `json:"groupSensor"`
}
type Buckets struct {
Key int `json:"key"`
DocCount int `json:"doc_count"`
GroupDate struct {
Buckets []BucketsXY `json:"buckets"`
} `json:"groupDate"`
}
type BucketsXY struct {
KeyAsString time.Time `json:"key_as_string"`
Key int64 `json:"key"`
DocCount int `json:"doc_count"`
X ExtendedStats `json:"x"`
Y ExtendedStats `json:"y"`
}
type ExtendedStats struct {
Count int `json:"count"`
Min float64 `json:"min"`
Max float64 `json:"max"`
Avg float64 `json:"avg"`
Sum float64 `json:"sum"`
SumOfSquares float64 `json:"sum_of_squares"`
Variance float64 `json:"variance"`
StdDeviation float64 `json:"std_deviation"`
StdDeviationBounds struct {
Upper float64 `json:"upper"`
Lower float64 `json:"lower"`
} `json:"std_deviation_bounds"`
}
Loading…
Cancel
Save