Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AiAPIClient ¶
type AiAPIClient struct {
// contains filtered or unexported fields
}
AiAPIClient is used to call Application Insights Api
func NewAiAPIClient ¶
func NewAiAPIClient() AiAPIClient
NewAiAPIClient creates a client for calling Application insights api
func (AiAPIClient) GetMetric ¶
func (ai AiAPIClient) GetMetric(metricInfo MetricRequest) (*MetricsResponse, error)
GetMetric calls to API to retrieve a specific metric
type MetricRequest ¶
type MetricRequest struct {
MetricName string
Aggregation string
Timespan string
Interval string
Segment string
OrderBy string
Filter string
}
MetricRequest represents options for the AI endpoint
func NewMetricRequest ¶
func NewMetricRequest(metricName string) MetricRequest
NewMetricRequest creates a new metric request with defaults for optional parameters
type MetricsResponse ¶
type MetricsResponse struct {
StatusCode int
Value struct {
Start time.Time `json:"start"`
End time.Time `json:"end"`
Interval string `json:"interval"`
Segments []Segment `json:"segments"`
MetricValues Segment
} `json:"value"`
}
MetricsResponse is the response from the api that holds metric values and segments
type Segment ¶
type Segment struct {
Start time.Time `json:"start"`
End time.Time `json:"end"`
MetricValues map[string]map[string]interface{}
}
Segment holds the metric values for a given segment
func (*Segment) UnmarshalJSON ¶
UnmarshalJSON is a custom UnMarshaler that parses the Segment information
Click to show internal directories.
Click to hide internal directories.