Documentation ¶
Index ¶
- Constants
- func BuildQuery(q *model.CompoundQuery) *owlModel.Query
- func GetCompoundQueryByUuid(uuid uuid.UUID) *model.CompoundQuery
- func LoadIcmpRecordsOfCompoundQuery(q *model.CompoundQuery, paging *commonModel.Paging) []*model.DynamicRecord
- func ToQueryDetail(q *model.CompoundQuery) *model.CompoundQueryDetail
- type CityMetric
- type EpochTime
- type IcmpResult
- type NqmDsl
- type ProvinceMetric
- type ServiceController
- type TargetMetric
- type TimeRangeOfDsl
Constants ¶
const UNKNOWN_ID_FOR_QUERY = -2
This value is used to indicate the non-existing id for data(province, city, or ISP) Instead of -1(e.x. A agent doesn't has information of ISP), this value is used in query.
const UNKNOWN_NAME_FOR_QUERY = "<UNKNOWN>"
Variables ¶
This section is empty.
Functions ¶
func BuildQuery ¶
func BuildQuery(q *model.CompoundQuery) *owlModel.Query
func GetCompoundQueryByUuid ¶
func GetCompoundQueryByUuid(uuid uuid.UUID) *model.CompoundQuery
func LoadIcmpRecordsOfCompoundQuery ¶
func LoadIcmpRecordsOfCompoundQuery(q *model.CompoundQuery, paging *commonModel.Paging) []*model.DynamicRecord
Loads data by compound query.
This function do not filter the data with metric DSL.
func ToQueryDetail ¶
func ToQueryDetail(q *model.CompoundQuery) *model.CompoundQueryDetail
Types ¶
type CityMetric ¶
type CityMetric struct { City *owlModel.City2 `json:"city"` Metrics *model.Metrics `json:"metrics"` Targets []TargetMetric `json:"targets"` }
The data used for reporting of ICMP statistics, which contains detail of target node(grouping by city)
type IcmpResult ¶
type IcmpResult struct {
// contains filtered or unexported fields
}
The raw result returned from JSONRPC
func (*IcmpResult) UnmarshalJSON ¶
func (r *IcmpResult) UnmarshalJSON(p []byte) error
Used to unmarshal JSON with specific structure of IcmpResult(because of reusing struct)
type NqmDsl ¶
type NqmDsl struct { GroupingColumns []string `json:"grouping_columns"` StartTime *EpochTime `json:"start_time,omitempty"` EndTime *EpochTime `json:"end_time,omitempty"` TimeRanges []*TimeRangeOfDsl `json:"time_ranges"` IdsOfAgents []int32 `json:"ids_of_agents"` IdsOfAgentIsps []int16 `json:"ids_of_agent_isps"` IdsOfAgentProvinces []int16 `json:"ids_of_agent_provinces"` IdsOfAgentCities []int16 `json:"ids_of_agent_cities"` IdsOfAgentNameTags []int16 `json:"ids_of_agent_name_tags"` IdsOfAgentGroupTags []int32 `json:"ids_of_agent_group_tags"` IdsOfTargets []int32 `json:"ids_of_targets"` IdsOfTargetProvinces []int16 `json:"ids_of_target_provinces"` IdsOfTargetIsps []int16 `json:"ids_of_target_isps"` IdsOfTargetCities []int16 `json:"ids_of_target_cities"` IdsOfTargetNameTags []int16 `json:"ids_of_target_name_tags"` IdsOfTargetGroupTags []int32 `json:"ids_of_target_group_tags"` IspRelation model.PropRelation `json:"isp_relation"` ProvinceRelation model.PropRelation `json:"province_relation"` CityRelation model.PropRelation `json:"city_relation"` NameTagRelation model.PropRelation `json:"name_tag_relation"` }
Represents the DSL for query over Icmp log
type ProvinceMetric ¶
type ProvinceMetric struct { Province *owlModel.Province `json:"province"` Metrics *model.Metrics `json:"metrics"` }
The data used for reporting of ICMP statistics(grouping by provinces of agents)
type ServiceController ¶
type ServiceController struct { GetStatisticsOfIcmpByDsl func(*NqmDsl) ([]IcmpResult, error) GetProvinceById func(int16) *owlModel.Province GetIspById func(int16) *owlModel.Isp GetCityById func(int16) *owlModel.City2 GetTargetById func(int32) *nqmModel.SimpleTarget1 }
*
- 1. Main controller for NQM reporting
- 2. Makes the unit test more easily(by replacing lambda used in method)
func GetDefaultServiceController ¶
func GetDefaultServiceController() *ServiceController
func (*ServiceController) ListByProvinces ¶
func (srv *ServiceController) ListByProvinces(dslParams *dsl.QueryParams) []ProvinceMetric
Query data for provinces
func (*ServiceController) ListTargetsWithCityDetail ¶
func (srv *ServiceController) ListTargetsWithCityDetail(dslParams *dsl.QueryParams) []CityMetric
Query data for detail of city
type TargetMetric ¶
type TargetMetric struct { Id int32 `json:"id"` Host string `json:"host"` Isp *owlModel.Isp `json:"isp"` Metrics *model.Metrics `json:"metrics"` }
The data used for reporting of ICMP statistics target node