types.go 939 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package stackdriver
  2. import (
  3. "net/url"
  4. "time"
  5. )
  6. type StackdriverQuery struct {
  7. Target string
  8. Params url.Values
  9. RefID string
  10. }
  11. type StackDriverResponse struct {
  12. TimeSeries []struct {
  13. Metric struct {
  14. Labels struct {
  15. InstanceName string `json:"instance_name"`
  16. } `json:"labels"`
  17. Type string `json:"type"`
  18. } `json:"metric"`
  19. Resource struct {
  20. Type string `json:"type"`
  21. Labels struct {
  22. InstanceID string `json:"instance_id"`
  23. Zone string `json:"zone"`
  24. ProjectID string `json:"project_id"`
  25. } `json:"labels"`
  26. } `json:"resource"`
  27. MetricKind string `json:"metricKind"`
  28. ValueType string `json:"valueType"`
  29. Points []struct {
  30. Interval struct {
  31. StartTime time.Time `json:"startTime"`
  32. EndTime time.Time `json:"endTime"`
  33. } `json:"interval"`
  34. Value struct {
  35. DoubleValue float64 `json:"doubleValue"`
  36. } `json:"value"`
  37. } `json:"points"`
  38. } `json:"timeSeries"`
  39. }